1 /* ==========================================================================
2  * ====                   FRACTAL GRAPHICS GENERATOR                     ====
3  * ==========================================================================
4  *
5  * Copyright (C) 2003-2021 by Thomas Dreibholz
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Contact: dreibh@iem.uni-due.de
21  */
22 
23 #ifndef FRACTALGENERATOR_H
24 #define FRACTALGENERATOR_H
25 
26 
27 #include <QtWidgets/QApplication>
28 #include <QtWidgets/QMainWindow>
29 #include <QtPrintSupport/QPrinter>
30 #ifdef WITH_KDE
31 #include <KXmlGui/KXmlGuiWindow>
32 #endif
33 
34 class FractalGeneratorDoc;
35 class FractalGeneratorView;
36 
37 class FractalGeneratorApp
38 #ifndef WITH_KDE
39    : public QMainWindow
40 #else
41    : public KXmlGuiWindow
42 #endif
43 {
44    Q_OBJECT
45 
46    friend class FractalGeneratorView;
47 
48    public:
49    FractalGeneratorApp(QWidget* parent, const QString& fileName = QString());
50    ~FractalGeneratorApp();
51 
52    protected:
53    void initActions();
54    void initStatusBar();
55    void initDocument();
56    void initView();
57 
58    public Q_SLOTS:
59    void slotFileOpen();
60    void slotFileSave();
61    void slotFileExportImage();
62    void slotFileSaveAs();
63    void slotFileClose();
64    void slotFilePrint();
65    void slotFileQuit();
66    void slotHelpAbout();
67 
68    void slotViewSetImageSize();
69    void slotViewConfigureAlgorithm();
70    void slotViewSetFractalAlgorithm(QAction* action);
71    void slotViewSetColorScheme(QAction* action);
72 
73    void slotUpdateFileName(const QString& fileName);
74    void slotUpdateFractalAlgorithm();
75    void slotUpdateColorScheme();
76    void slotUpdateZoomBackPossible();
77    void slotUpdateZoomInPossible();
78 
79    private:
80    FractalGeneratorView* View;
81    FractalGeneratorDoc*  Document;
82    QAction*              ViewZoomIn;
83    QAction*              ViewZoomBack;
84    QList<QAction*>       FractalAlgorithmActionList;
85    QList<QAction*>       ColorSchemeActionList;
86    QPrinter              Printer;
87 };
88 
89 #endif // FRACTALGENERATOR_H
90