1 // -*- C++ -*-
2 // --------------------------------------------------------------------
3 // IpePresenter for Qt
4 // --------------------------------------------------------------------
5 /*
6 
7     This file is part of the extensible drawing editor Ipe.
8     Copyright (c) 1993-2020 Otfried Cheong
9 
10     Ipe is free software; you can redistribute it and/or modify it
11     under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 3 of the License, or
13     (at your option) any later version.
14 
15     As a special exception, you have permission to link Ipe with the
16     CGAL library and distribute executables, as long as you follow the
17     requirements of the Gnu General Public License in regard to all of
18     the software in the executable aside from CGAL.
19 
20     Ipe is distributed in the hope that it will be useful, but WITHOUT
21     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22     or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
23     License for more details.
24 
25     You should have received a copy of the GNU General Public License
26     along with Ipe; if not, you can find it at
27     "http://www.gnu.org/copyleft/gpl.html", or write to the Free
28     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 
30 */
31 
32 #ifndef IPEPRESENTER_QT_H
33 #define IPEPRESENTER_QT_H
34 
35 #include "ipeselector_qt.h"
36 #include "ipepdfview_qt.h"
37 #include "timelabel_qt.h"
38 #include "ipepresenter.h"
39 
40 #include <QMainWindow>
41 #include <QPlainTextEdit>
42 #include <QAction>
43 #include <QTimer>
44 #include <QTime>
45 
46 // --------------------------------------------------------------------
47 
48 class MainWindow;
49 
50 class IpeAction: public QAction
51 {
52   Q_OBJECT
53 public:
54   IpeAction(int cmd, const QString &text,
55 	    const char *shortcut, MainWindow *parent);
56 private:
57   int iCommand;
58 };
59 
60 // --------------------------------------------------------------------
61 
62 class BeamerView: public QMainWindow
63 {
64   Q_OBJECT
65 public:
66   BeamerView(Qt::WindowFlags f = nullptr);
pdfView()67   PdfView *pdfView() { return iView; }
68 private:
69   PdfView *iView;
70 };
71 
72 // --------------------------------------------------------------------
73 
74 class MainWindow: public QMainWindow, public Presenter
75 {
76   Q_OBJECT
77 public:
78   MainWindow(BeamerView* bv, Qt::WindowFlags f = nullptr);
79   bool load(const char* fn);
80   void cmd(int c);
81   void aboutIpePresenter();
82 
83 private:
84   void closeEvent(QCloseEvent *event);
85   void setPdf();
86   void setView();
87   void jumpTo();
88   void selectPage();
89   void showType3Warning(const char *s);
90   void browseLaunch(bool launch, String dest);
91 
92 private:
93   QMenu *iViewMenu;
94   QMenu *iTimeMenu;
95   QMenu *iMoveMenu;
96   QMenu *iHelpMenu;
97   IpeAction *iShowPresentationAction;
98   IpeAction *iFullScreenAction;
99   IpeAction *iBlackoutAction;
100   PdfView *iCurrent;
101   PdfView *iNext;
102   BeamerView *iScreen;
103   QPlainTextEdit *iNotes;
104   TimeLabel *iClock;
105 
106   std::vector<QPixmap> iPageIcons;
107 };
108 
109 // --------------------------------------------------------------------
110 #endif
111