Poppler Qt5  0.87.0
poppler-optcontent.h
1 /* poppler-optcontent.h: qt interface to poppler
2  *
3  * Copyright (C) 2007, Brad Hards <bradh@kde.org>
4  * Copyright (C) 2008, Pino Toscano <pino@kde.org>
5  * Copyright (C) 2013, Anthony Granger <grangeranthony@gmail.com>
6  * Copyright (C) 2016, Albert Astals Cid <aacid@kde.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef POPPLER_OPTCONTENT_H
24 #define POPPLER_OPTCONTENT_H
25 
26 #include <QtCore/QAbstractListModel>
27 
28 #include "poppler-export.h"
29 #include "poppler-link.h"
30 
31 class OCGs;
32 
33 namespace Poppler
34 {
35  class Document;
36  class OptContentModelPrivate;
37 
49  class POPPLER_QT5_EXPORT OptContentModel : public QAbstractItemModel
50  {
51  friend class Document;
52 
53  Q_OBJECT
54 
55  public:
56  ~OptContentModel() override;
57 
58  QModelIndex index(int row, int column, const QModelIndex &parent) const override;
59  QModelIndex parent(const QModelIndex &child) const override;
60 
61  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
62  int columnCount(const QModelIndex &parent) const override;
63 
64  QVariant data(const QModelIndex &index, int role) const override;
65  bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) override;
66 
67  Qt::ItemFlags flags ( const QModelIndex & index ) const override;
68 
69  QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
70 
75  void applyLink( LinkOCGState *link );
76 
77  private:
78  OptContentModel( OCGs *optContent, QObject *parent = nullptr);
79 
80  friend class OptContentModelPrivate;
81  OptContentModelPrivate *d;
82  };
83 }
84 
85 #endif
Poppler::Document
PDF document.
Definition: poppler-qt5.h:1118
Poppler::LinkOCGState
OCGState: an optional content group state change.
Definition: poppler-link.h:624
Poppler::OptContentModel
Model for optional content.
Definition: poppler-optcontent.h:49
Poppler
The Poppler Qt5 binding.
Definition: poppler-annotation.h:45