The Battle for Wesnoth  1.13.4+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 - 2016 by David White <[email protected]>
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 #ifndef NOTIFICATIONS_NOTIFICATIONS_HPP_INCLUDED
16 #define NOTIFICATIONS_NOTIFICATIONS_HPP_INCLUDED
17 
18 #include <string>
19 
20 namespace desktop {
21 
22 namespace notifications
23 {
25 
26 /**
27  * Displays a desktop notification @a message, from @a owner, of type @a t.
28  *
29  * If it is an appropriate time to send a desktop notification (i.e. the window
30  * does not have focus and the feature is not disabled by the preferences),
31  * and wesnoth was compiled with support for this feature, a notification will
32  * be issued. If there is no support for notifications, this fcn is a no-op.
33  *
34  * @note Currently we have support for dbus (linux), windows tray notifications,
35  * and growl (Apple). To enable one of these, the corresponding compilation unit
36  * dbus_notification.cpp, growl_notification.cpp, windows_tray_notification.cpp,
37  * must be compiled, and the corresponding C++ symbol HAVE_LIBDBUS, HAVE_GROWL,
38  * _WIN32 must be defined for that compilation unit _and for this one_.
39  */
40  void send(const std::string& owner, const std::string& message, type t);
41 
42 /** Returns whether we were compiled with support for desktop notifications. */
43  bool available();
44 }
45 
46 }
47 
48 #endif
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1221
GLdouble GLdouble t
Definition: glew.h:1366
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.
GLsizei GLenum GLuint GLuint GLsizei char * message
Definition: glew.h:2499
GLsizei const GLcharARB ** string
Definition: glew.h:4503