Fabcoin Core  0.16.2
P2P Digital Currency
notificator.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef FABCOIN_QT_NOTIFICATOR_H
6 #define FABCOIN_QT_NOTIFICATOR_H
7 
8 #if defined(HAVE_CONFIG_H)
10 #endif
11 
12 #include <QIcon>
13 #include <QObject>
14 
15 QT_BEGIN_NAMESPACE
16 class QSystemTrayIcon;
17 
18 #ifdef USE_DBUS
19 class QDBusInterface;
20 #endif
21 QT_END_NAMESPACE
22 
24 class Notificator: public QObject
25 {
26  Q_OBJECT
27 
28 public:
32  Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent);
33  ~Notificator();
34 
35  // Message class
36  enum Class
37  {
41  };
42 
43 public Q_SLOTS:
52  void notify(Class cls, const QString &title, const QString &text,
53  const QIcon &icon = QIcon(), int millisTimeout = 10000);
54 
55 private:
56  QWidget *parent;
57  enum Mode {
58  None,
64  };
65  QString programName;
67  QSystemTrayIcon *trayIcon;
68 #ifdef USE_DBUS
69  QDBusInterface *interface;
70 
71  void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
72 #endif
73  void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);
74 #ifdef Q_OS_MAC
75  void notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon);
76  void notifyMacUserNotificationCenter(Class cls, const QString &title, const QString &text, const QIcon &icon);
77 #endif
78 };
79 
80 #endif // FABCOIN_QT_NOTIFICATOR_H
QString programName
Definition: notificator.h:65
Use DBus org.freedesktop.Notifications.
Definition: notificator.h:59
QWidget * parent
Definition: notificator.h:56
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent)
Create a new notificator.
Definition: notificator.cpp:36
Notify user of potential problem.
Definition: notificator.h:39
Ignore informational notifications, and show a modal pop-up dialog for Critical notifications.
Definition: notificator.h:58
Use the 10.8+ User Notification Center (Mac only)
Definition: notificator.h:63
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
Cross-platform desktop notification client.
Definition: notificator.h:24
Informational message.
Definition: notificator.h:38
An error occurred.
Definition: notificator.h:40
QSystemTrayIcon * trayIcon
Definition: notificator.h:67
Use the Growl 1.2 notification system (Mac only)
Definition: notificator.h:61
Use QSystemTray::showMessage.
Definition: notificator.h:60
void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
Use the Growl 1.3 notification system (Mac only)
Definition: notificator.h:62