1 | /* |
2 | * Copyright (C) 2008-2009, Pino Toscano <pino@kde.org> |
3 | * Copyright (C) 2013, Fabio D'Urso <fabiodurso@hotmail.it> |
4 | * Copyright (C) 2021, Albert Astals Cid <aacid@kde.org> |
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 PAGEVIEW_H |
22 | #define PAGEVIEW_H |
23 | |
24 | #include <QtWidgets/QScrollArea> |
25 | |
26 | #include "documentobserver.h" |
27 | |
28 | class QLabel; |
29 | |
30 | class PageView : public QScrollArea, public DocumentObserver |
31 | { |
32 | Q_OBJECT |
33 | |
34 | public: |
35 | explicit PageView(QWidget *parent = nullptr); |
36 | ~PageView() override; |
37 | |
38 | void documentLoaded() override; |
39 | void documentClosed() override; |
40 | void pageChanged(int page) override; |
41 | |
42 | public Q_SLOTS: |
43 | void slotZoomChanged(qreal value); |
44 | void slotRotationChanged(int value); |
45 | |
46 | private: |
47 | QLabel *m_imageLabel; |
48 | qreal m_zoom; |
49 | int m_rotation; |
50 | int m_dpiX; |
51 | int m_dpiY; |
52 | }; |
53 | |
54 | #endif |
55 | |