okular
bookmarkmanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _OKULAR_BOOKMARK_MANAGER_H_
00011 #define _OKULAR_BOOKMARK_MANAGER_H_
00012
00013 #include <kbookmark.h>
00014
00015 #include "okular_export.h"
00016
00017 class QAction;
00018 class KUrl;
00019
00020 namespace Okular {
00021
00022 class Document;
00023 class DocumentPrivate;
00024 class DocumentViewport;
00025
00032 class OKULAR_EXPORT BookmarkManager : public QObject
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 virtual ~BookmarkManager();
00038
00042 KUrl::List files() const;
00046 KBookmark::List bookmarks( const KUrl& url ) const;
00047
00051 void save() const;
00052
00056 void addBookmark( int page );
00057
00064 bool addBookmark( const KUrl& referurl, const Okular::DocumentViewport& vp, const QString& title = QString() );
00065
00069 void removeBookmark( int page );
00070
00074 int removeBookmark( const KUrl& referurl, const KBookmark& bm );
00075
00079 bool isBookmarked( int page ) const;
00080
00087 QList< QAction* > actionsForUrl( const KUrl& url ) const;
00088
00089 Q_SIGNALS:
00093 void openUrl( const KUrl& url );
00094
00098 void saved();
00099
00100 private:
00101 class Private;
00102 Private * const d;
00103 friend class Private;
00104
00105
00106 friend class Document;
00107 friend class DocumentPrivate;
00108
00109 BookmarkManager( DocumentPrivate * document );
00110
00111 void setUrl( const KUrl& url );
00112 bool setPageBookmark( int page );
00113 bool removePageBookmark( int page );
00114
00115 Q_DISABLE_COPY( BookmarkManager )
00116 };
00117
00118 }
00119
00120 #endif