The Battle for Wesnoth
1.15.9+dev
desktop
notifications.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY.
11
12
See the COPYING file for more details.
13
*/
14
15
#pragma once
16
17
#include <string>
18
19
namespace
desktop
{
20
21
namespace
notifications
22
{
23
enum
type
{
CHAT
,
TURN_CHANGED
,
OTHER
};
24
25
/**
26
* Displays a desktop notification @a message, from @a owner, of type @a t.
27
*
28
* If it is an appropriate time to send a desktop notification (i.e. the window
29
* does not have focus and the feature is not disabled by the preferences),
30
* and wesnoth was compiled with support for this feature, a notification will
31
* be issued. If there is no support for notifications, this fcn is a no-op.
32
*
33
* @note Currently we have support for dbus (linux), windows tray notifications,
34
* and NSUserNotification (Apple). To enable one of these, the corresponding compilation unit
35
* dbus_notification.cpp, apple_notification.cpp, windows_tray_notification.cpp,
36
* must be compiled, and the corresponding C++ symbol HAVE_LIBDBUS,
37
* _WIN32 must be defined for that compilation unit _and for this one_.
38
*/
39
void
send
(
const
std::string& owner,
const
std::string& message,
type
t
);
40
41
/** Returns whether we were compiled with support for desktop notifications. */
42
bool
available
();
43
}
44
45
}
desktop::notifications::OTHER
Definition:
notifications.hpp:23
desktop::notifications::CHAT
Definition:
notifications.hpp:23
desktop
Definition:
apple_battery_info.hpp:19
desktop::notifications::available
bool available()
Returns whether we were compiled with support for desktop notifications.
Definition:
notifications.cpp:40
desktop::notifications::send
void send(const std::string &, const std::string &, type)
Displays a desktop notification message, from owner, of type t.
Definition:
notifications.cpp:42
desktop::notifications::type
type
Definition:
notifications.hpp:23
t
double t
Definition:
astarsearch.cpp:64
desktop::notifications::TURN_CHANGED
Definition:
notifications.hpp:23
Generated by
1.8.13