Falkon Develop
Cross-platform Qt-based web browser
bookmarkstoolbar.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2017 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 BOOKMARKSTOOLBAR_H
19#define BOOKMARKSTOOLBAR_H
20
21#include <QWidget>
22
23#include "qzcommon.h"
24
25class QHBoxLayout;
26class QTimer;
27
28class BrowserWindow;
29class Bookmarks;
30class BookmarkItem;
32
33class FALKON_EXPORT BookmarksToolbar : public QWidget
34{
35 Q_OBJECT
36public:
37 explicit BookmarksToolbar(BrowserWindow* window, QWidget* parent = nullptr);
38
39private Q_SLOTS:
40 void contextMenuRequested(const QPoint &pos);
41
42 void refresh();
43 void bookmarksChanged();
44 void showOnlyIconsChanged(bool state);
45 void showOnlyTextChanged(bool state);
46
47 void openBookmarkInNewTab();
48 void openBookmarkInNewWindow();
49 void openBookmarkInNewPrivateWindow();
50 void createNewFolder();
51 void editBookmark();
52 void deleteBookmark();
53
54private:
55 void clear();
56 void addItem(BookmarkItem* item);
57 BookmarksToolbarButton* buttonAt(const QPoint &pos);
58
59 QSize minimumSizeHint() const override;
60
61 void dropEvent(QDropEvent* e) override;
62 void dragEnterEvent(QDragEnterEvent* e) override;
63 void dragMoveEvent(QDragMoveEvent* e) override;
64 void dragLeaveEvent(QDragLeaveEvent* e) override;
65 void paintEvent(QPaintEvent* p) override;
66
67 BrowserWindow* m_window;
68 Bookmarks* m_bookmarks;
69 BookmarkItem* m_clickedBookmark;
70 QHBoxLayout* m_layout;
71 QTimer* m_updateTimer;
72 QAction* m_actShowOnlyIcons = nullptr;
73 QAction* m_actShowOnlyText = nullptr;
74
75 int m_dropRow;
76 QPoint m_dropPos;
77 void clearDropIndicator();
78};
79
80#endif // BOOKMARKSTOOLBAR_H
State state
#define FALKON_EXPORT
Definition: qzcommon.h:28