annotate src/mainwindow.h @ 65:defd29b9f25a

Converter: Unescape IMG and Latex references
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Aug 2016 15:26:17 +0200
parents 36ee5dd46fd3
children
rev   line source
50
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2016 by ETH Zürich
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 *
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 * See LICENSE.txt for details.
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 /** @file The Main UI class.
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 *
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 * Parent class of all dialogs and graphical user interaction.
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13 */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
14 #include <QMainWindow>
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 #include <QSettings>
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 class QPushButton;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
18 class QLineEdit;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19 class QCheckBox;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20 class FileNameRequester;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
22 /**
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 * @class MainWindow
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 * @brief The mainwindow of the application.
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 * @details Holds the input fields and export options.
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27 class MainWindow : public QMainWindow
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 {
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 Q_OBJECT
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 public:
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32 MainWindow();
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 protected:
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 /** @brief UI setup */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 void setupGUI();
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 /** @brief Cleanup and save the current state */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 virtual void closeEvent(QCloseEvent *event);
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 /** @brief Restores the last window state */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 void readSettings();
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 public slots:
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45 /** @brief directly set an input file. */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 void setInputFile(const QString& file);
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 /** @brief Prefill title with @title. */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 void setTitle(const QString& title);
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
51 protected slots:
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
52 /** @brief Show an error dialog to the user. */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
53 void showErrorMessage(const QString& errMsg);
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
54
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
55 /** @brief check if all mandataory fields are set. */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
56 void checkCompleted();
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
57
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
58 /** @brief Do the actual conversion. */
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
59 void doConvert();
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
60
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
61 private:
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
62 QSettings mSettings;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
63
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
64 FileNameRequester* mInputRequester;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
65 FileNameRequester* mOutRequester;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
66 QLineEdit *mTitleEdit;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
67 QPushButton *mConvertBtn;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
68 QCheckBox *mPdfChk,
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
69 *mXlsxChk,
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
70 *mHtmlChk;
36ee5dd46fd3 Add GUI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
71 };
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)