2011-04-27 09:05:54 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2013-07-11 16:21:57 +02:00
|
|
|
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
|
2011-04-27 09:05:54 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-04-22 16:03:38 +02:00
|
|
|
#ifndef DESKTOPNOTIFICATIONSFACTORY_H
|
|
|
|
#define DESKTOPNOTIFICATIONSFACTORY_H
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include "qz_namespace.h"
|
|
|
|
|
2011-04-22 16:03:38 +02:00
|
|
|
#include <QObject>
|
2011-04-23 22:33:25 +02:00
|
|
|
#include <QPoint>
|
2012-12-20 14:45:35 +01:00
|
|
|
#include <QPointer>
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QPixmap;
|
2011-04-22 16:03:38 +02:00
|
|
|
|
2011-04-23 22:33:25 +02:00
|
|
|
class DesktopNotification;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QT_QUPZILLA_EXPORT DesktopNotificationsFactory : public QObject
|
2011-04-22 16:03:38 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-04-23 22:33:25 +02:00
|
|
|
enum Type { DesktopNative, PopupWidget };
|
2012-01-13 15:28:30 +01:00
|
|
|
|
2011-04-23 22:33:25 +02:00
|
|
|
explicit DesktopNotificationsFactory(QObject* parent = 0);
|
2011-04-22 16:03:38 +02:00
|
|
|
|
2012-01-21 20:27:45 +01:00
|
|
|
void loadSettings();
|
|
|
|
|
2012-07-10 11:56:24 +02:00
|
|
|
bool supportsNativeNotifications() const;
|
|
|
|
|
2012-07-08 14:03:50 +02:00
|
|
|
void showNotification(const QPixmap &icon, const QString &heading, const QString &text);
|
2011-11-19 18:21:22 +01:00
|
|
|
void nativeNotificationPreview();
|
|
|
|
|
2011-04-23 22:33:25 +02:00
|
|
|
private:
|
|
|
|
bool m_enabled;
|
|
|
|
int m_timeout;
|
|
|
|
Type m_notifType;
|
|
|
|
QPoint m_position;
|
|
|
|
|
2012-12-20 14:45:35 +01:00
|
|
|
QPointer<DesktopNotification> m_desktopNotif;
|
2012-04-12 15:41:28 +02:00
|
|
|
quint32 m_uint;
|
2011-04-22 16:03:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DESKTOPNOTIFICATIONSFACTORY_H
|