The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
notifications.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2017 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project http://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 {
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 growl (Apple). To enable one of these, the corresponding compilation unit
35  * dbus_notification.cpp, growl_notification.cpp, windows_tray_notification.cpp,
36  * must be compiled, and the corresponding C++ symbol HAVE_LIBDBUS, HAVE_GROWL,
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 }
std::vector< char_t > string
bool available()
Returns whether we were compiled with support for desktop notifications.
void send(const std::string &, const std::string &, type)
Displays a desktop notification message, from owner, of type t.
double t
Definition: astarsearch.cpp:64