1 /*
2     SPDX-FileCopyrightText: 2005 Enrico Ros <eros.kde@email.it>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_SIDE_REVIEWS_H_
8 #define _OKULAR_SIDE_REVIEWS_H_
9 
10 #include <QModelIndexList>
11 #include <QVector>
12 #include <QWidget>
13 
14 #include "core/observer.h"
15 
16 class QModelIndex;
17 
18 namespace Okular
19 {
20 class Annotation;
21 class Document;
22 }
23 
24 class AnnotationModel;
25 class AuthorGroupProxyModel;
26 class PageFilterProxyModel;
27 class PageGroupProxyModel;
28 class KTreeViewSearchLine;
29 class TreeView;
30 
31 /**
32  * @short ...
33  */
34 class Reviews : public QWidget, public Okular::DocumentObserver
35 {
36     Q_OBJECT
37 public:
38     Reviews(QWidget *parent, Okular::Document *document);
39     ~Reviews() override;
40 
41     // [INHERITED] from DocumentObserver
42     void notifyCurrentPageChanged(int previous, int current) override;
43 
44     void reparseConfig();
45 
46 public Q_SLOTS:
47     void slotPageEnabled(bool);
48     void slotAuthorEnabled(bool);
49     void slotCurrentPageOnly(bool);
50     void slotExpandAll();
51     void slotCollapseAll();
52 
53 Q_SIGNALS:
54     void openAnnotationWindow(Okular::Annotation *annotation, int pageNumber);
55 
56 private Q_SLOTS:
57     void activated(const QModelIndex &);
58     void contextMenuRequested(const QPoint);
59     void saveSearchOptions();
60 
61 private:
62     QModelIndexList retrieveAnnotations(const QModelIndex &idx) const;
63 
64     // data fields (GUI)
65     KTreeViewSearchLine *m_searchLine;
66     TreeView *m_view;
67     // internal storage
68     Okular::Document *m_document;
69     AnnotationModel *m_model;
70     AuthorGroupProxyModel *m_authorProxy;
71     PageFilterProxyModel *m_filterProxy;
72     PageGroupProxyModel *m_groupProxy;
73 };
74 
75 #endif
76