Debian Codegraph @

qt5/demos/viewer.h

raw
1 /*
2 * Copyright (C) 2008, Pino Toscano <[email protected]>
3 * Copyright (C) 2021, Mahmoud Khalil <[email protected]>
4 * Copyright (C) 2021, Albert Astals Cid <[email protected]>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef PDFVIEWER_H
22 #define PDFVIEWER_H
23
24 #include <QtWidgets/QMainWindow>
25
26 class QAction;
27 class QActionGroup;
28 class QLabel;
29 class DocumentObserver;
30 namespace Poppler {
31 class Document;
32 }
33
34 class PdfViewer : public QMainWindow
35 {
36 Q_OBJECT
37
38 friend class DocumentObserver;
39
40 public:
41 explicit PdfViewer(QWidget *parent = nullptr);
42 ~PdfViewer() override;
43
44 QSize sizeHint() const override;
45
46 void loadDocument(const QString &file);
47 void closeDocument();
48
49 private:
50 void slotOpenFile();
51 void slotSaveCopy();
52 void slotAbout();
53 void slotAboutQt();
54 void slotToggleTextAA(bool value);
55 void slotToggleGfxAA(bool value);
56 void slotRenderBackend(QAction *act);
57
58 void setPage(int page);
59 int page() const;
60 void xrefReconstructedHandler(Poppler::Document *doc);
61
62 int m_currentPage;
63 bool xrefReconstructed;
64
65 QAction *m_fileOpenAct;
66 QAction *m_fileSaveCopyAct;
67 QAction *m_settingsTextAAAct;
68 QAction *m_settingsGfxAAAct;
69 QActionGroup *m_settingsRenderBackendGrp;
70
71 QList<DocumentObserver *> m_observers;
72
73 Poppler::Document *m_doc;
74 };
75
76 #endif