]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinbookmarkhandler.h
Add Dolphin icon as repository logo
[dolphin.git] / src / dolphinbookmarkhandler.h
1 /***************************************************************************
2 * Copyright (C) 2019 by David Hallas <david@davidhallas.dk> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #ifndef DOLPHINBOOKMARKHANDLER_H
21 #define DOLPHINBOOKMARKHANDLER_H
22
23 #include <KBookmarkManager>
24 #include <QObject>
25
26 class DolphinMainWindow;
27 class DolphinViewContainer;
28 class KActionCollection;
29 class KBookmarkManager;
30 class KBookmarkMenu;
31 class QMenu;
32
33 class DolphinBookmarkHandler : public QObject, public KBookmarkOwner
34 {
35 Q_OBJECT
36 public:
37 DolphinBookmarkHandler(DolphinMainWindow *mainWindow, KActionCollection *collection, QMenu *menu, QObject *parent);
38 ~DolphinBookmarkHandler() override;
39
40 private:
41 QString currentTitle() const override;
42 QUrl currentUrl() const override;
43 QString currentIcon() const override;
44 bool supportsTabs() const override;
45 QList<FutureBookmark> currentBookmarkList() const override;
46 bool enableOption(BookmarkOption option) const override;
47 void openBookmark(const KBookmark &bookmark, Qt::MouseButtons, Qt::KeyboardModifiers) override;
48 void openFolderinTabs(const KBookmarkGroup &bookmarkGroup) override;
49 void openInNewTab(const KBookmark &bookmark) override;
50 void openInNewWindow(const KBookmark &bookmark) override;
51 static QString title(DolphinViewContainer* viewContainer);
52 static QUrl url(DolphinViewContainer* viewContainer);
53 static QString icon(DolphinViewContainer* viewContainer);
54 private:
55 DolphinMainWindow* m_mainWindow;
56 KBookmarkManager *m_bookmarkManager;
57 QScopedPointer<KBookmarkMenu> m_bookmarkMenu;
58 };
59
60 #endif // DOLPHINBOOKMARKHANDLER_H