From 1388bed0effca69e1fee0fb080eb035a3653f4c1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 24 Feb 2009 11:50:03 +0100 Subject: Documented API bookmarks && download classes. Fixed load on startup --- src/bookmarks.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 7 deletions(-) (limited to 'src/bookmarks.h') diff --git a/src/bookmarks.h b/src/bookmarks.h index aa18834c..825c0d3a 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -31,40 +31,112 @@ class MainWindow; -/* +/** + * Inherited from KBookmarkOwner, this class allows to manage + * bookmarks as actions * + * @author Andrea Diamantini + * @since 4.x */ class OwnBookMarks : public QObject , public KBookmarkOwner { Q_OBJECT + public: - OwnBookMarks(KMainWindow *); - virtual void openBookmark (const KBookmark & , Qt::MouseButtons , Qt::KeyboardModifiers ); + /** + * The class ctor. + * + * @param parent the pointer to the browser mainwindow. We need it + * to link bookmarks actions with the right window + * where load url in + */ + OwnBookMarks(KMainWindow *parent); + + /** + * This function is called when a bookmark is selected and belongs to + * the ancestor class. + * This method actually emits signal to load bookmark's url without + * considering mousebuttons or keyboard modifiers. + * + * @param b the bookmark to open + * @param mb the mouse buttons clicked to select the bookmark + * @param km the keyboard modifiers pushed when the bookmark was selected + */ + virtual void openBookmark (const KBookmark &b , Qt::MouseButtons mb, Qt::KeyboardModifiers km); - // KBookmarkOwner interface: + + /** + * this method, from KBookmarkOwner interface, allows to add the current page + * to the bookmark list, returning the URL page as QString. + * + * @return the current page's URL + */ virtual QString currentUrl() const; + + /** + * this method, from KBookmarkOwner interface, allows to add the current page + * to the bookmark list, returning the title's page as QString. + * + * @return the current page's title + */ virtual QString currentTitle() const; signals: + /** + * This signal is emitted when an url has to be loaded + * + * @param url the URL to load + * + */ void openUrl(const KUrl &); private: + // the MainWindow pointer MainWindow *m_parent; }; + // ------------------------------------------------------------------------------ -/* + +/** + * This class represent the interface to rekonq bookmarks system. + * All rekonq needs (Bookmarks Menu, Bookmarks Toolbar) is provided + * from this class. + * So it implements code to have each one + * + * @author Andrea Diamantini + * @since 4.x * */ class BookmarksProvider : public QObject { Q_OBJECT + public: - BookmarksProvider(KMainWindow*); + /** + * Class constructor. Connect BookmarksProvider with bookmarks source + * (actually konqueror's bookmarks) + * + * @param parent The MainWindow to provide bookmarks objects + * + */ + BookmarksProvider(KMainWindow* parent); + + /** + * Customize bookmarks toolbar + * + * @param toolbar the toolbar to customize + */ + void provideBmToolbar(KToolBar* toolbar); - void provideBmToolbar(KToolBar*); + /** + * Generate the Bookmarks Menu + * + * @return the Bookmarks Menu + * + */ KMenu *bookmarksMenu(); private: -- cgit v1.2.1