Falkon Develop
Cross-platform Qt-based web browser
bookmarksmanager.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 BOOKMARKSMANAGER_H
19#define BOOKMARKSMANAGER_H
20
21#include <QWidget>
22#include <QPointer>
23
24#include "qzcommon.h"
25
26#include "bookmarkitem.h"
27
28namespace Ui
29{
31}
32
33class QUrl;
34
35class BrowserWindow;
36class Bookmarks;
37
38class FALKON_EXPORT BookmarksManager : public QWidget
39{
40 Q_OBJECT
41
42public:
43 explicit BookmarksManager(BrowserWindow* window, QWidget* parent = nullptr);
44 ~BookmarksManager() override;
45
46 void setMainWindow(BrowserWindow* window);
47
48public Q_SLOTS:
49 void search(const QString &string);
50
51private Q_SLOTS:
52 void bookmarkActivated(BookmarkItem* item);
53 void bookmarkCtrlActivated(BookmarkItem* item);
54 void bookmarkShiftActivated(BookmarkItem* item);
55 void bookmarksSelected(const QList<BookmarkItem*> &items);
56 void createContextMenu(const QPoint &pos);
57
58 void openBookmark(BookmarkItem* item = nullptr);
59 void openBookmarkInNewTab(BookmarkItem* item = nullptr);
60 void openBookmarkInNewWindow(BookmarkItem* item = nullptr);
61 void openBookmarkInNewPrivateWindow(BookmarkItem* item = nullptr);
62
63 void addBookmark();
64 void addFolder();
65 void addSeparator();
66 void deleteBookmarks();
67
68 void bookmarkEdited();
69 void descriptionEdited();
70 void enableUpdates();
71
72private:
73 void updateEditBox(BookmarkItem* item);
74 bool bookmarkEditable(BookmarkItem* item) const;
75 void addBookmark(BookmarkItem* item);
76 BookmarkItem* parentForNewBookmark() const;
77 BrowserWindow* getWindow();
78
79 void showEvent(QShowEvent* event) override;
80 void keyPressEvent(QKeyEvent* event) override;
81
82 Ui::BookmarksManager* ui;
83 QPointer<BrowserWindow> m_window;
84
85 Bookmarks* m_bookmarks;
86 BookmarkItem* m_selectedBookmark;
87 bool m_blockDescriptionChangedSignal;
88 bool m_adjustHeaderSizesOnShow;
89
90};
91
92#endif // BOOKMARKSMANAGER_H
#define FALKON_EXPORT
Definition: qzcommon.h:28