compile
[kdegraphics.git] / okular / ui / bookmarklist.h
blob00421eeb9cb08bcd2bbe8ca955005c5833083bdd
1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef BOOKMARKLIST_H
11 #define BOOKMARKLIST_H
13 #include <qwidget.h>
15 #include "core/observer.h"
17 class QAction;
18 class QTreeWidget;
19 class QTreeWidgetItem;
20 class KTreeWidgetSearchLine;
21 class KUrl;
22 class BookmarkItem;
24 namespace Okular {
25 class Document;
28 class BookmarkList : public QWidget, public Okular::DocumentObserver
30 Q_OBJECT
32 public:
33 explicit BookmarkList( Okular::Document *document, QWidget *parent = 0 );
34 ~BookmarkList();
36 // inherited from DocumentObserver
37 uint observerId() const;
38 void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags );
40 private slots:
41 void slotFilterBookmarks( bool );
42 void slotExecuted( QTreeWidgetItem * item );
43 void slotChanged( QTreeWidgetItem * item );
44 void slotContextMenu( const QPoint& p );
45 void slotBookmarksChanged( const KUrl& url );
47 private:
48 void rebuildTree( bool filter );
49 void goTo( BookmarkItem * item );
50 void selectiveUrlUpdate( const KUrl& url, QTreeWidgetItem*& item );
51 QTreeWidgetItem* itemForUrl( const KUrl& url ) const;
53 Okular::Document * m_document;
54 QTreeWidget * m_tree;
55 KTreeWidgetSearchLine * m_searchLine;
56 QAction * m_showBoomarkOnlyAction;
57 QTreeWidgetItem * m_currentDocumentItem;
60 #endif