source: terepaima/terepaima-0.4.16/sources/presentationview.h

desarrollostretch
Last change on this file was 1f4adec, checked in by aosorio <aosorio@…>, 8 years ago

Agregado proyecto base, esto luego del dh_make -f

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2
3Copyright 2012-2013 Adam Reichold
4
5This file is part of qpdfview.
6
7qpdfview is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12qpdfview is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with qpdfview.  If not, see <http://www.gnu.org/licenses/>.
19
20*/
21
22#ifndef PRESENTATIONVIEW_H
23#define PRESENTATIONVIEW_H
24
25#include <QGraphicsView>
26
27#include "renderparam.h"
28
29namespace qpdfview
30{
31
32namespace Model
33{
34class Page;
35}
36
37class Settings;
38class PageItem;
39
40class PresentationView : public QGraphicsView
41{
42    Q_OBJECT
43
44public:
45    PresentationView(const QVector< Model::Page* >& pages, QWidget* parent = 0);
46    ~PresentationView();
47
48    int numberOfPages() const { return m_pages.count(); }
49    int currentPage() const { return m_currentPage; }
50
51    ScaleMode scaleMode() const { return m_scaleMode; }
52    void setScaleMode(ScaleMode scaleMode);
53
54    qreal scaleFactor() const { return m_scaleFactor; }
55    void setScaleFactor(qreal scaleFactor);
56
57    Rotation rotation() const { return m_rotation; }
58    void setRotation(Rotation rotation);
59
60    qpdfview::RenderFlags renderFlags() const { return m_renderFlags; }
61    void setRenderFlags(qpdfview::RenderFlags renderFlags);
62
63signals:
64    void currentPageChanged(int currentPage, bool trackChange = false);
65
66    void scaleModeChanged(ScaleMode scaleMode);
67    void scaleFactorChanged(qreal scaleFactor);
68    void rotationChanged(Rotation rotation);
69
70    void renderFlagsChanged(qpdfview::RenderFlags renderFlags);
71   
72public slots:
73    void show();
74
75    void previousPage();
76    void nextPage();
77    void firstPage();
78    void lastPage();
79
80    void jumpToPage(int page, bool trackChange = true);
81
82    void jumpBackward();
83    void jumpForward();
84
85    void zoomIn();
86    void zoomOut();
87    void originalSize();
88
89    void rotateLeft();
90    void rotateRight();
91
92protected slots:
93    void on_prefetch_timeout();
94
95    void on_pages_cropRectChanged();
96
97    void on_pages_linkClicked(bool newTab, int page, qreal left, qreal top);
98
99protected:
100    void resizeEvent(QResizeEvent* event);
101
102    void keyPressEvent(QKeyEvent* event);
103    void wheelEvent(QWheelEvent* event);
104
105private:
106    Q_DISABLE_COPY(PresentationView)
107
108    static Settings* s_settings;
109
110    QTimer* m_prefetchTimer;
111
112    QVector< Model::Page* > m_pages;
113
114    int m_currentPage;
115
116    QList< int > m_past;
117    QList< int > m_future;
118
119    ScaleMode m_scaleMode;
120    qreal m_scaleFactor;
121    Rotation m_rotation;
122
123    qpdfview::RenderFlags m_renderFlags;
124
125    QVector< PageItem* > m_pageItems;
126
127    void preparePages();
128    void prepareBackground();
129
130    void prepareScene();
131    void prepareView();
132   
133};
134
135} // qpdfview
136
137#endif // PRESENTATIONVIEW_H
Note: See TracBrowser for help on using the repository browser.