summaryrefslogtreecommitdiffstats
path: root/addon/doxywizard/doxywizard.h
blob: ccbd9b017bed2dbc68cfbb0db335e1c21c1102de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/******************************************************************************
 *
 * Copyright (C) 1997-2019 by Dimitri van Heesch.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby
 * granted. No representations are made about the suitability of this software
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 */

#ifndef DOXYWIZARD_H
#define DOXYWIZARD_H

#include <QMainWindow>
#include <QSettings>
#include <QStringList>

class Expert;
class Wizard;
class QLabel;
class QCheckBox;
class QLineEdit;
class QPushButton;
class QTextBrowser;
class QMenu;
class QProcess;
class QTimer;
class QTabWidget;

class MainWindow : public QMainWindow
{
    Q_OBJECT

  public:
    static MainWindow &instance();
    void loadConfigFromFile(const QString &fileName);
    void loadSettings();
    void saveSettings();
    void closeEvent(QCloseEvent *event);
    QString configFileName() const { return m_fileName; }
    void updateTitle();
    // access routines for outputLog pane
    void outputLogStart();
    void outputLogText(QString text);
    void outputLogFinish();

  public slots:
    void manual();
    void about();
    void openConfig();
    bool saveConfig();
    bool saveConfigAs();
    void makeDefaults();
    void resetToDefaults();
    void selectTab(int);
    void quit();

  private slots:
    void openRecent(QAction *action);
    void selectWorkingDir();
    void updateWorkingDir();
    void runDoxygen();
    void readStdout();
    void runComplete();
    void showHtmlOutput();
    void saveLog();
    void showSettings();
    void configChanged();
    void clearRecent();
    void selectRunTab();

  private:
    MainWindow();
    void saveConfig(const QString &fileName);
    void addRecentFile(const QString &fileName);
    void addRecentFileList(const QString &fileName);
    void updateRecentFile(void);
    void updateConfigFileName(const QString &fileName);
    void setWorkingDir(const QString &dirName);
    void updateLaunchButtonState();
    bool discardUnsavedChanges(bool saveOption=true);

    QLineEdit *m_workingDir;
    QLineEdit *m_runOptions;
    QPushButton *m_selWorkingDir;
    QPushButton *m_run;
    QPushButton *m_saveLog;
    QCheckBox   *m_showCondensedSettings;
    QPushButton *m_launchHtml;
    QPushButton *m_launchPdf;
    QTextBrowser *m_outputLog;
    QLabel *m_runStatus;
    Expert *m_expert;
    Wizard *m_wizard;
    QString m_fileName;
    QSettings m_settings;
    QMenu *m_recentMenu;
    QStringList m_recentFiles;
    QAction *m_resetDefault;
    QAction *m_clearRecent;
    QProcess *m_runProcess;
    QTimer *m_timer;
    QTabWidget *m_tabs;
    int m_outputLogTextCount = 0;
    bool m_running;
    bool m_modified;
};

/*! \brief This class serves as a namespace for global variables used by the doxygen wizard.
 *
 *  All fields in this class are public and static, so they can be used directly.
 */
class DoxygenWizard
{
  public:
    static bool debugFlag;
};
#endif