fix i18nc typo in last commit
[kdeaccessibility.git] / ksayit / src / ksayitbookmarkhandler.h
blob1c129cd9b1f19b46a8e2bac21bbb95d189223374
1 //
2 // C++ Interface: ksayitbookmarkhandler
3 //
4 // Description:
5 //
6 //
7 // Author: Robert Vogl <voglrobe@web.de>, (C) 2005
8 //
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef KSAYITBOOKMARKHANDLER_H
13 #define KSAYITBOOKMARKHANDLER_H
15 // Qt includes
18 // KDE includes
19 #include <kbookmarkmanager.h>
22 class KSayItApp;
24 /**
25 Each of the objects in the TreeView that can be bookmarked has an unique ID.
26 The "URL" is to be created as follows: \p ksayit://filename/ID.\n
27 The "Title" is either the content of column 0 of the TreeView or the 32nd leading
28 charcters of the text (e.g. if the item references to a paragraph).
29 @author Robert Vogl
31 class KSayItBookmarkHandler : public KBookmarkOwner
33 public:
34 KSayItBookmarkHandler(KBookmarkManager *bkManager=0, KSayItApp* parent=0);
35 virtual ~KSayItBookmarkHandler();
37 public:
38 /**
39 * Reimplemented from base class.\n
40 * Called when a bookmark in the menu was clicked.
41 * \param url The URL of the selected bookmark.
43 void openBookmarkURL(const QString &url);
45 /**
46 * Reimplemented from base class.\n
47 * Returns the Title when a new bookmark is about to be created.
48 * \returns The title of the bookmark.
50 QString currentTitle() const;
53 /**
54 * Reimplemented from base class.\n
55 * Returns the URL when a new bookmark is about to be created.
56 * \returns The URL of the bookmark.
58 QString currentUrl() const;
60 /**
61 * Sets ID and title of the current TreeView item.
62 * \param ID The unique ID of the item.
63 * \param title The bookmark title of the item.
65 void notifyBookmarkHandler(const QString &ID, const QString &title);
67 /**
68 * Deletes the bookmark designated by the given url.
69 * \param url The url of the bookmark.
71 void deleteBookmark(const QString &url, const QString &title);
73 /**
74 * Iterates recursively through all bookmarks below the
75 * given group.
76 * \param bkGroup The KBookmarkGroup to start.
78 void traverseBookmarks(KBookmarkGroup bkGroup);
80 private:
81 /**
82 * Searches the Bookmark designted by its URL.
83 * \param bookmark A reference that will contain the search result (bookmark).
84 * \param group A reference that will contain the search result
85 * (the group the found bookmark belongs to).
86 * \param bkGroup The root-bookmark from which the search will start
87 * (usually the topmost bookmark in the tree).
88 * \param url The URL of the bookmark to search for (including <tt>ksayit://</tt>).
89 * \returns \em true, if the bookmark was found, \em false, if not.
91 bool recursiveGetBkByURL(
92 KBookmark &bookmark,
93 KBookmarkGroup &group,
94 const KBookmarkGroup &bkGroup,
95 const QString &url);
97 /**
98 * Searches the Bookmark designted by its URL.
99 * \param bookmark A reference that will contain the search result (bookmark).
100 * \param group A reference that will contain the search result
101 * (the group the found bookmark belongs to).
102 * \param bkGroup The root-bookmark from which the search will start
103 * (usually the topmost bookmark in the tree).
104 * \param title The title of the bookmark to search for.
105 * \returns Number of bookmarks with the given title.
107 int recursiveGetBkByTitle(
108 KBookmark &bookmark,
109 KBookmarkGroup &group,
110 const KBookmarkGroup &bkGroup,
111 const QString &title);
112 private:
113 QString m_ID;
114 QString m_title;
115 KBookmarkManager *m_bkManager;
116 KSayItApp *m_parent;
120 #endif