PRCYCoin  2.0.0.7rc1
P2P Digital Currency
notificator.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_NOTIFICATOR_H
6 #define BITCOIN_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 {
40  };
41 
42 public Q_SLOTS:
51  void notify(Class cls, const QString& title, const QString& text, const QIcon& icon = QIcon(), int millisTimeout = 10000);
52 
53 private:
54  QWidget* parent;
55  enum Mode {
56  None,
60  };
61  QString programName;
63  QSystemTrayIcon* trayIcon;
64 #ifdef USE_DBUS
65  QDBusInterface* interface;
66 
67  void notifyDBus(Class cls, const QString& title, const QString& text, const QIcon& icon, int millisTimeout);
68 #endif
69  void notifySystray(Class cls, const QString& title, const QString& text, const QIcon& icon, int millisTimeout);
70 #ifdef Q_OS_MAC
71  void notifyMacUserNotificationCenter(Class cls, const QString& title, const QString& text, const QIcon& icon);
72 #endif
73 };
74 
75 #endif // BITCOIN_QT_NOTIFICATOR_H
Notificator::Critical
@ Critical
An error occurred.
Definition: notificator.h:39
Notificator::QSystemTray
@ QSystemTray
Use QSystemTray::showMessage.
Definition: notificator.h:58
Notificator::notify
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
Definition: notificator.cpp:236
Notificator::UserNotificationCenter
@ UserNotificationCenter
Use the 10.8+ User Notification Center (Mac only)
Definition: notificator.h:59
Notificator::trayIcon
QSystemTrayIcon * trayIcon
Definition: notificator.h:63
Notificator::notifySystray
void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
Definition: notificator.cpp:207
Notificator::parent
QWidget * parent
Definition: notificator.h:54
Notificator
Cross-platform desktop notification client.
Definition: notificator.h:24
Notificator::Freedesktop
@ Freedesktop
Use DBus org.freedesktop.Notifications.
Definition: notificator.h:57
prcycoin-config.h
Notificator::mode
Mode mode
Definition: notificator.h:62
Notificator::Information
@ Information
Informational message.
Definition: notificator.h:37
Notificator::None
@ None
Ignore informational notifications, and show a modal pop-up dialog for Critical notifications.
Definition: notificator.h:56
Notificator::Mode
Mode
Definition: notificator.h:55
Notificator::programName
QString programName
Definition: notificator.h:61
Notificator::Notificator
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent)
Create a new notificator.
Definition: notificator.cpp:31
Notificator::~Notificator
~Notificator()
Definition: notificator.cpp:59
Notificator::Class
Class
Definition: notificator.h:36
Notificator::Warning
@ Warning
Notify user of potential problem.
Definition: notificator.h:38