Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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 BITCOIN_QT_NOTIFICATOR_H
6#define BITCOIN_QT_NOTIFICATOR_H
7
8#if defined(HAVE_CONFIG_H)
9#include <config/bitcoin-config.h>
10#endif
11
12#include <QIcon>
13#include <QObject>
14
16class QSystemTrayIcon;
17
18#ifdef USE_DBUS
19class QDBusInterface;
20#endif
22
24class Notificator : public QObject {
26
27public:
32 QWidget *parent);
34
35 // Message class
41
42public Q_SLOTS:
53 void notify(Class cls, const QString &title, const QString &text,
54 const QIcon &icon = QIcon(), int millisTimeout = 10000);
55
56private:
57 QWidget *parent;
69#ifdef USE_DBUS
71
72 void notifyDBus(Class cls, const QString &title, const QString &text,
73 const QIcon &icon, int millisTimeout);
74#endif
75 void notifySystray(Class cls, const QString &title, const QString &text,
76 int millisTimeout);
77#ifdef Q_OS_MAC
79 const QString &text);
80#endif
81};
82
83#endif // BITCOIN_QT_NOTIFICATOR_H
Cross-platform desktop notification client.
Definition notificator.h:24
QString programName
Definition notificator.h:66
QWidget * parent
Definition notificator.h:57
@ Information
Informational message.
Definition notificator.h:37
@ Critical
An error occurred.
Definition notificator.h:39
@ Warning
Notify user of potential problem.
Definition notificator.h:38
@ UserNotificationCenter
Use the 10.8+ User Notification Center (Mac only)
Definition notificator.h:63
@ QSystemTray
Use QSystemTrayIcon::showMessage()
Definition notificator.h:62
@ Freedesktop
Use DBus org.freedesktop.Notifications.
Definition notificator.h:61
@ None
Ignore informational notifications, and show a modal pop-up dialog for Critical notifications.
Definition notificator.h:59
void notifySystray(Class cls, const QString &title, const QString &text, int millisTimeout)
QSystemTrayIcon * trayIcon
Definition notificator.h:68
void notify(Class cls, const QString &title, const QString &text, const QIcon &icon=QIcon(), int millisTimeout=10000)
Show notification message.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85