Falkon Develop
Cross-platform Qt-based web browser
desktopnotificationsfactory.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
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 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef DESKTOPNOTIFICATIONSFACTORY_H
19#define DESKTOPNOTIFICATIONSFACTORY_H
20
21#include "qzcommon.h"
22
23#include <QObject>
24#include <QPoint>
25#include <QPointer>
26
27class QPixmap;
28class QDBusMessage;
29class QDBusError;
30
32
34{
35 Q_OBJECT
36
37public:
38 enum Type { DesktopNative, PopupWidget };
39
40 explicit DesktopNotificationsFactory(QObject* parent = nullptr);
41
42 void loadSettings();
43
44 bool supportsNativeNotifications() const;
45
46 void showNotification(const QString &heading, const QString &text);
47 void showNotification(const QPixmap &icon, const QString &heading, const QString &text);
48 void nativeNotificationPreview();
49
50private Q_SLOTS:
51 void updateLastId(const QDBusMessage &msg);
52 void error(const QDBusError &error);
53
54private:
55 bool m_enabled;
56 int m_timeout;
57 Type m_notifType;
58 QPoint m_position;
59
60 QPointer<DesktopNotification> m_desktopNotif;
61 quint32 m_uint;
62};
63
64#endif // DESKTOPNOTIFICATIONSFACTORY_H
#define FALKON_EXPORT
Definition: qzcommon.h:28