Changeset View
Changeset View
Standalone View
Standalone View
krusader/BookMan/krbookmarkhandler.h
Show All 26 Lines | |||||
27 | #include <QPointer> | 27 | #include <QPointer> | ||
28 | #include <QEvent> | 28 | #include <QEvent> | ||
29 | #include <QMap> | 29 | #include <QMap> | ||
30 | #include <QUrl> | 30 | #include <QUrl> | ||
31 | // QtXml | 31 | // QtXml | ||
32 | #include <QDomEntity> | 32 | #include <QDomEntity> | ||
33 | // QtWidgets | 33 | // QtWidgets | ||
34 | #include <QMenu> | 34 | #include <QMenu> | ||
35 | #include <QWidgetAction> | ||||
36 | #include <QLineEdit> | ||||
35 | 37 | | |||
36 | #include "krbookmark.h" | 38 | #include "krbookmark.h" | ||
37 | 39 | | |||
38 | class KActionCollection; | 40 | class KActionCollection; | ||
39 | class KBookmarkManager; | 41 | class KBookmarkManager; | ||
40 | class KrMainWindow; | 42 | class KrMainWindow; | ||
41 | 43 | | |||
42 | class KrBookmarkHandler: public QObject | 44 | class KrBookmarkHandler: public QObject | ||
Show All 12 Lines | 56 | protected: | |||
55 | void deleteBookmark(KrBookmark *bm); | 57 | void deleteBookmark(KrBookmark *bm); | ||
56 | void importFromFile(); | 58 | void importFromFile(); | ||
57 | bool importFromFileBookmark(QDomElement &e, KrBookmark *parent, QString path, QString *errorMsg); | 59 | bool importFromFileBookmark(QDomElement &e, KrBookmark *parent, QString path, QString *errorMsg); | ||
58 | bool importFromFileFolder(QDomNode &first, KrBookmark *parent, QString path, QString *errorMsg); | 60 | bool importFromFileFolder(QDomNode &first, KrBookmark *parent, QString path, QString *errorMsg); | ||
59 | void exportToFile(); | 61 | void exportToFile(); | ||
60 | void exportToFileFolder(QDomDocument &doc, QDomElement &parent, KrBookmark *folder); | 62 | void exportToFileFolder(QDomDocument &doc, QDomElement &parent, KrBookmark *folder); | ||
61 | void exportToFileBookmark(QDomDocument &doc, QDomElement &where, KrBookmark *bm); | 63 | void exportToFileBookmark(QDomDocument &doc, QDomElement &where, KrBookmark *bm); | ||
62 | void clearBookmarks(KrBookmark *root); | 64 | void clearBookmarks(KrBookmark *root); | ||
63 | void buildMenu(KrBookmark *parent, QMenu *menu); | 65 | void buildMenu(KrBookmark *parent, QMenu *menu, int depth = 0); | ||
64 | 66 | | |||
65 | bool eventFilter(QObject *obj, QEvent *ev); | 67 | bool eventFilter(QObject *obj, QEvent *ev); | ||
66 | | ||||
67 | void rightClicked(QMenu *menu, KrBookmark *bm); | 68 | void rightClicked(QMenu *menu, KrBookmark *bm); | ||
68 | void rightClickOnSpecialBookmark(); | 69 | void rightClickOnSpecialBookmark(); | ||
69 | 70 | | |||
70 | void removeReferences(KrBookmark *root, KrBookmark *bmToRemove); | 71 | void removeReferences(KrBookmark *root, KrBookmark *bmToRemove); | ||
71 | 72 | | |||
72 | protected slots: | 73 | protected slots: | ||
73 | void bookmarksChanged(const QString&, const QString&); | 74 | void bookmarksChanged(const QString&, const QString&); | ||
74 | void slotActivated(const QUrl &url); | 75 | void slotActivated(const QUrl &url); | ||
75 | 76 | | |||
76 | private: | 77 | private: | ||
77 | KrMainWindow *_mainWindow; | 78 | KrMainWindow *_mainWindow; | ||
78 | KActionCollection *_collection, *_privateCollection; | 79 | KActionCollection *_collection, *_privateCollection; | ||
79 | KrBookmark *_root; | 80 | KrBookmark *_root; | ||
80 | // the whole KBookmarkManager is an ugly hack. use it until we have our own | 81 | // the whole KBookmarkManager is an ugly hack. use it until we have our own | ||
81 | KBookmarkManager *manager; | 82 | KBookmarkManager *manager; | ||
82 | bool _middleClick; // if true, the user clicked the middle button to open the bookmark | 83 | bool _middleClick; // if true, the user clicked the middle button to open the bookmark | ||
83 | 84 | | |||
84 | QPointer<QMenu> _mainBookmarkPopup; // main bookmark popup menu | 85 | QPointer<QMenu> _mainBookmarkPopup; // main bookmark popup menu | ||
85 | QList<QAction *> _specialBookmarks; // the action list of the special bookmarks | 86 | QList<QAction *> _specialBookmarks; // the action list of the special bookmarks | ||
87 | | ||||
88 | QWidgetAction *_quickSearchAction; ///< Search bar container action | ||||
89 | QLineEdit *_quickSearchBar; ///< Search bar containing current query | ||||
90 | QMenu *_quickSearchMenu; ///< The menu where the search is performed | ||||
91 | QHash<QAction *, QString> _quickSearchOriginalActionTitles; ///< Saved original action text values to restore after search | ||||
92 | | ||||
93 | void _setQuickSearchText(const QString &text); | ||||
94 | QString _quickSearchText() const; | ||||
95 | static void _highlightAction(QAction *action, bool isMatched = true); | ||||
96 | void _resetActionTextAndHighlighting(); | ||||
86 | }; | 97 | }; | ||
87 | 98 | | |||
88 | Q_DECLARE_METATYPE(KrBookmark *) | 99 | Q_DECLARE_METATYPE(KrBookmark *) | ||
89 | 100 | | |||
90 | #endif // KRBOOKMARK_HANDLER_H | 101 | #endif // KRBOOKMARK_HANDLER_H |