Falkon Develop
Cross-platform Qt-based web browser
desktopnotification.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 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 DESKTOPNOTIFICATION_H
19#define DESKTOPNOTIFICATION_H
20
21#include "qzcommon.h"
22
23#include <QWidget>
24#include <QPixmap>
25
26namespace Ui
27{
29}
30
31class FALKON_EXPORT DesktopNotification : public QWidget
32{
33 Q_OBJECT
34
35public:
36 explicit DesktopNotification(bool setPosition = false);
37 void setPixmap(const QPixmap &icon) { m_icon = icon; }
38 void setHeading(const QString &heading) { m_heading = heading; }
39 void setText(const QString &text) { m_text = text; }
40 void setTimeout(int timeout) { m_timeout = timeout; }
41 void show();
42 ~DesktopNotification() override;
43
44private:
45 void mousePressEvent(QMouseEvent* e) override;
46 void mouseMoveEvent(QMouseEvent* e) override;
47
48 Ui::DesktopNotification* ui;
49 bool m_settingPosition;
50 QPoint m_dragPosition;
51
52 QPixmap m_icon;
53 QString m_heading;
54 QString m_text;
55 int m_timeout;
56 QTimer* m_timer;
57};
58
59#endif // DESKTOPNOTIFICATION_H
void setTimeout(int timeout)
void setPixmap(const QPixmap &icon)
void setHeading(const QString &heading)
void setText(const QString &text)
#define FALKON_EXPORT
Definition: qzcommon.h:28