File indexing completed on 2024-04-28 15:51:58

0001 /*
0002     SPDX-FileCopyrightText: 2005 Enrico Ros <eros.kde@email.it>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _OKULAR_SIDE_REVIEWS_H_
0008 #define _OKULAR_SIDE_REVIEWS_H_
0009 
0010 #include <QModelIndexList>
0011 #include <QVector>
0012 #include <QWidget>
0013 
0014 #include "core/observer.h"
0015 
0016 class QModelIndex;
0017 
0018 namespace Okular
0019 {
0020 class Annotation;
0021 class Document;
0022 }
0023 
0024 class AnnotationModel;
0025 class AuthorGroupProxyModel;
0026 class PageFilterProxyModel;
0027 class PageGroupProxyModel;
0028 class KTreeViewSearchLine;
0029 class TreeView;
0030 
0031 /**
0032  * @short ...
0033  */
0034 class Reviews : public QWidget, public Okular::DocumentObserver
0035 {
0036     Q_OBJECT
0037 public:
0038     Reviews(QWidget *parent, Okular::Document *document);
0039     ~Reviews() override;
0040 
0041     // [INHERITED] from DocumentObserver
0042     void notifyCurrentPageChanged(int previous, int current) override;
0043 
0044     void reparseConfig();
0045 
0046 public Q_SLOTS:
0047     void slotPageEnabled(bool);
0048     void slotAuthorEnabled(bool);
0049     void slotCurrentPageOnly(bool);
0050     void slotExpandAll();
0051     void slotCollapseAll();
0052 
0053 Q_SIGNALS:
0054     void openAnnotationWindow(Okular::Annotation *annotation, int pageNumber);
0055 
0056 private Q_SLOTS:
0057     void activated(const QModelIndex &);
0058     void contextMenuRequested(const QPoint);
0059     void saveSearchOptions();
0060 
0061 private:
0062     QModelIndexList retrieveAnnotations(const QModelIndex &idx) const;
0063 
0064     // data fields (GUI)
0065     KTreeViewSearchLine *m_searchLine;
0066     TreeView *m_view;
0067     // internal storage
0068     Okular::Document *m_document;
0069     AnnotationModel *m_model;
0070     AuthorGroupProxyModel *m_authorProxy;
0071     PageFilterProxyModel *m_filterProxy;
0072     PageGroupProxyModel *m_groupProxy;
0073 };
0074 
0075 #endif