7
7
#include <QtGui/QMainWindow>
10
9
#include "pdf/Document.h"
12
10
#include "widgets/NotesViewportWidget.h"
13
11
#include "widgets/PresentationViewWidget.h"
14
12
#include "widgets/WaitingIndicator.h"
15
/** Main Window for Application
16
* This class handles the main part of the Presenter.
17
* It holds all Widgets and does user interaction by event() and keyReleaseEvent()
16
20
class nPresenter : public QMainWindow
24
/* singleton instance pointer */
21
25
static nPresenter * _nPresenterInstance;
25
NotesViewportWidget _notesViewport;
26
PresentationViewportWidget _presentationViewport;
28
30
QDockWidget _treeDock;
29
31
QDockWidget _previewCurrentDock;
30
32
QDockWidget _previewNextDock;
31
33
QDockWidget _clockDock;
32
34
QDockWidget _notesDock;
35
NotesViewportWidget _notesViewport;
36
PresentationViewportWidget _presentationViewport;
34
37
WaitingIndicator * _waitingIndicator;
40
QHash<int, Page*> _pages;
39
/* presentation properties */
46
41
QFutureWatcher<void> _futureWatcher;
47
42
QFuture<void> _renderFuture;
49
43
bool _blackoutEnabled;
50
44
bool _freezeEnabled;
54
/** @deprecated just a temp hack */
47
QStringList _layoutNames;
48
int _layoutNamesCurrent;
58
51
nPresenter(QWidget *parent = 0);
52
virtual ~nPresenter();
54
/** get the singleton instance of nPresenter */
63
55
static nPresenter & instance();
65
static Document * document();
67
static Page & currentPage();
68
static Page & nextPage();
71
static QSize notesViewportSize();
72
static QSize presentationViewportSize();
74
static QRectF notesViewport();
75
static QRectF presentationViewport();
57
/** PDF Abstraction Instance */
58
static Document & document();
60
/** current active Page */
61
static int currentPage();
65
/** gets geometry for viewport
66
* @returns the viewport geometry or an invalid QRectF if viewport is not defined
68
static QRectF viewport(Document::Viewports viewport);
78
71
void mouseReleaseEvent(QMouseEvent * event);
81
74
void hideEvent(QHideEvent * event);
82
75
bool event(QEvent *event);
79
/** setup widget and connect signals/slots */
84
/** the current page changed */
87
85
void currentPageChanged(int numPage);
87
/** work in progress */
88
88
void waitingOnPage();
89
void currentPageReady();
90
/** new document loaded */
91
91
void documentChanged();
93
/** blackout status changed */
93
94
void blackoutEnabled(bool enabled);
95
/** page freeze status changed */
94
96
void freezeEnabled(bool enabled);
100
void sizeChangeTimeout();
105
/** loads a PDF file */
98
106
bool loadDocument(QString path);
108
/** called from ViewportWidgets when resized
109
* Defer update of viewports for a while.
110
* This prevents constantly updating viewports while resizing ViewportWidget
112
void viewportSizesChanged();
115
/** request alls pages and viewports again
116
* clears Document's image cache and requests all pages.
117
* @deprecated : should be replaced by a more intelligent caching algorithm
119
void requestAllPages();
121
/** @name Page Navigation */
123
/** handles page changes */
102
124
void toPage(int pageNum);
103
129
void toNextPage();
131
/** go to previous page
104
134
void toPreviousPage();
108
138
#endif // NPRESENTER_H