Debian Codegraph @

qt6/demos/pageview.h

raw
1 /*
2 * Copyright (C) 2008-2009, Pino Toscano <[email protected]>
3 * Copyright (C) 2013, Fabio D'Urso <[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 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 void slotZoomChanged(qreal value);
43 void slotRotationChanged(int value);
44
45 private:
46 QLabel *m_imageLabel;
47 qreal m_zoom;
48 int m_rotation;
49 int m_dpiX;
50 int m_dpiY;
51 };
52
53 #endif