Falkon Develop
Cross-platform Qt-based web browser
siteicon.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 SITEICON_H
19#define SITEICON_H
20
21#include "qzcommon.h"
22#include "toolbutton.h"
23
24class QTimer;
25
26class LocationBar;
27class WebView;
28class BrowserWindow;
29
31{
32 Q_OBJECT
33
34public:
35 explicit SiteIcon(LocationBar *parent);
36
37 void setBrowserWindow(BrowserWindow *window);
38 void setWebView(WebView* view);
39 void setIcon(const QIcon &icon);
40
41private Q_SLOTS:
42 void updateIcon();
43 void popupClosed();
44
45private:
46 void contextMenuEvent(QContextMenuEvent* e) override;
47 void mousePressEvent(QMouseEvent* e) override;
48 void mouseReleaseEvent(QMouseEvent* e) override;
49 void mouseMoveEvent(QMouseEvent* e) override;
50
51 bool showPopup();
52
53 BrowserWindow* m_window;
54 LocationBar* m_locationBar;
55 WebView* m_view;
56 QTimer* m_updateTimer;
57
58 QPoint m_dragStartPosition;
59 QIcon m_icon;
60};
61
62#endif // SITEICON_H
void mousePressEvent(QMouseEvent *e) override
Definition: toolbutton.cpp:186
void mouseReleaseEvent(QMouseEvent *e) override
Definition: toolbutton.cpp:203
void contextMenuEvent(QContextMenuEvent *e) override
Definition: toolbutton.cpp:230
void setIcon(const QIcon &icon)
Definition: toolbutton.cpp:85
#define FALKON_EXPORT
Definition: qzcommon.h:28