Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
qt
notificator.h
Go to the documentation of this file.
1
// Copyright (c) 2011-present 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
#include <bitcoin-build-config.h>
// IWYU pragma: keep
9
10
#include <QIcon>
11
#include <QObject>
12
13
QT_BEGIN_NAMESPACE
14
class
QSystemTrayIcon;
15
16
#ifdef USE_DBUS
17
class
QDBusInterface;
18
#endif
19
QT_END_NAMESPACE
20
22
class
Notificator
:
public
QObject
23
{
24
Q_OBJECT
25
26
public
:
30
Notificator
(
const
QString &
programName
, QSystemTrayIcon *
trayIcon
, QWidget *
parent
);
31
~Notificator
();
32
33
// Message class
34
enum
Class
35
{
36
Information
,
37
Warning
,
38
Critical
39
};
40
41
public
Q_SLOTS:
50
void
notify
(
Class
cls,
const
QString &title,
const
QString &text,
51
const
QIcon &icon = QIcon(),
int
millisTimeout = 10000);
52
53
private
:
54
QWidget *
parent
;
55
enum
Mode
{
56
None
,
57
Freedesktop
,
58
QSystemTray
,
59
UserNotificationCenter
60
};
61
QString
programName
;
62
Mode
mode
{
None
};
63
QSystemTrayIcon *
trayIcon
;
64
#ifdef USE_DBUS
65
QDBusInterface* interface{
nullptr
};
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,
int
millisTimeout);
70
#ifdef Q_OS_MACOS
71
void
notifyMacUserNotificationCenter(
const
QString &title,
const
QString &text);
72
#endif
73
};
74
75
#endif
// BITCOIN_QT_NOTIFICATOR_H
Notificator::programName
QString programName
Definition
notificator.h:61
Notificator::parent
QWidget * parent
Definition
notificator.h:54
Notificator::~Notificator
~Notificator()
Definition
notificator.cpp:59
Notificator::mode
Mode mode
Definition
notificator.h:62
Notificator::Class
Class
Definition
notificator.h:35
Notificator::Information
@ Information
Informational message.
Definition
notificator.h:36
Notificator::Critical
@ Critical
An error occurred.
Definition
notificator.h:38
Notificator::Warning
@ Warning
Notify user of potential problem.
Definition
notificator.h:37
Notificator::Mode
Mode
Definition
notificator.h:55
Notificator::UserNotificationCenter
@ UserNotificationCenter
Use the 10.8+ User Notification Center (Mac only).
Definition
notificator.h:59
Notificator::QSystemTray
@ QSystemTray
Use QSystemTrayIcon::showMessage().
Definition
notificator.h:58
Notificator::Freedesktop
@ Freedesktop
Use DBus org.freedesktop.Notifications.
Definition
notificator.h:57
Notificator::None
@ None
Ignore informational notifications, and show a modal pop-up dialog for Critical notifications.
Definition
notificator.h:56
Notificator::notifySystray
void notifySystray(Class cls, const QString &title, const QString &text, int millisTimeout)
Definition
notificator.cpp:198
Notificator::Notificator
Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent)
Create a new notificator.
Definition
notificator.cpp:33
Notificator::trayIcon
QSystemTrayIcon * trayIcon
Definition
notificator.h:63
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:218
Generated on
for Bitcoin Core by
1.17.0