diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-10-09 17:30:03 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-10-13 21:17:05 +0200 |
commit | 25f7a9dc17f047715db0a06729151f8721513800 (patch) | |
tree | 87250bb9b16b15e44cd9f4ef7d55d945e339beb4 /src/bookmarks/bookmarkowner.h | |
parent | Enabling WebKit Page Cache feature: please, refers to (diff) | |
download | rekonq-25f7a9dc17f047715db0a06729151f8721513800.tar.xz |
- get rid of the selected bookmark in BookmarkOwner
we can now create actions as we want and not only in a context menu
- an important cleanup
- validOpenUrl() is now useless
Diffstat (limited to 'src/bookmarks/bookmarkowner.h')
-rw-r--r-- | src/bookmarks/bookmarkowner.h | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index febff3b0..573e4ee0 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -36,9 +36,8 @@ // KDE Includes #include <KBookmarkOwner> - -// Forward Declarations -class KAction; +#include <KIcon> +#include <KAction> /** @@ -69,9 +68,9 @@ public: }; /** - * @return the action or 0 if it doesn't exist. + * @return the action connected to the bookmark or 0 if it doesn't exist. */ - KAction* action(const BookmarkAction &bmAction); + KAction* action(const KBookmark &bookmark, const BookmarkAction &bmAction); /** * @return the current page's title. @@ -113,19 +112,16 @@ public: virtual void openFolderinTabs(const KBookmarkGroup &bookmark); public Q_SLOTS: - void setCurrentBookmark(const KBookmark &bookmark); - void unsetCurrentBookmark(); - - void openBookmark(const KBookmark &bookmark = KBookmark()); - void openBookmarkInNewTab(const KBookmark &bookmark = KBookmark()); - void openBookmarkInNewWindow(const KBookmark &bookmark = KBookmark()); - void openBookmarkFolder(const KBookmark &bookmark = KBookmark()); + void openBookmark(const KBookmark &bookmark); + void openBookmarkInNewTab(const KBookmark &bookmark); + void openBookmarkInNewWindow(const KBookmark &bookmark); + void openBookmarkFolder(const KBookmark &bookmark); KBookmark bookmarkCurrentPage(const KBookmark &bookmark = KBookmark()); KBookmarkGroup newBookmarkFolder(const KBookmark &bookmark = KBookmark()); KBookmark newSeparator(const KBookmark &bookmark = KBookmark()); - void copyLink(const KBookmark &bookmark = KBookmark()); - void editBookmark(KBookmark bookmark = KBookmark()); - bool deleteBookmark(KBookmark bookmark = KBookmark()); + void copyLink(const KBookmark &bookmark); + void editBookmark(KBookmark bookmark); + bool deleteBookmark(KBookmark bookmark); Q_SIGNALS: /** @@ -135,15 +131,34 @@ Q_SIGNALS: void openUrl(const KUrl &, const Rekonq::OpenType &); private: - void setupActions(); - void createAction(const BookmarkAction &action, - const QString &text, const QString &icon, - const QString &help, const char *slot); + KAction* createAction(const QString &text, const QString &icon, + const QString &help, const char *slot, + const KBookmark &bookmark); KBookmarkManager *m_manager; - QVector<KAction*> m_actions; - KBookmark m_currentBookmark; +}; + + +// ----------------------------------------------------------------------------------------------- + + +class CustomBookmarkAction : public KAction +{ + Q_OBJECT + +public: + CustomBookmarkAction(const KBookmark &bookmark, const KIcon &icon, const QString &text, QObject *parent); + ~CustomBookmarkAction(); + +Q_SIGNALS: + void triggered(const KBookmark &); + +private Q_SLOTS: + void onActionTriggered(); + +private: + KBookmark m_bookmark; }; #endif // BOOKMARKOWNER_H |