-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
207 lines (200 loc) · 6.49 KB
/
mainwindow.h
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include <QColorDialog>
#include <QMessageBox>
#include "app.h"
#include <QtPrintSupport/QPrinter> // print the canvas
#include <QtPrintSupport/QPrintDialog> // print the canvas
#include "toolmenuwatcher.h"
namespace Ui {
/**
* @brief The MainWindow class
* @details The MainWIndow class is the root/container for all Widgets.
* It contains the UI.
* Additionally, it provides out-of-box window behaviours and design.
* @author Lars Teloeken
* @version 1.0
* @date 2019-01-27
*/
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
/**
* @brief MainWindow - the MainWindow
* @param parent - the parent for the MainWindow
*/
explicit MainWindow(QWidget *parent = 0);
/**
* @brief setApp - setter of the app
* @param app - the current app
*/
void setApp(app::App *app);
/**
* @brief getApp - getter of the app
* @return - returned the current app
*/
app::App *getApp();
/**
* @brief Destructor- destructor of the class
*/
~MainWindow();
signals:
/**
* @brief guiEnabledChanged - signal
* @details This signal is called in MainWindow
* it emit if the gui have to be enabled
*/
void guiEnabledChanged();
/**
* @brief colorChanged - signal
* @details This signal is called in MainWindow
* it emits in MainWindow::on_pushButton_toolPropertieColor_clicked
*/
void colorChanged(QColor);
/**
* @brief colorToolPropertieChanged - signal
* @details This signal is called in MainWindow
* it emits in MainWindow::on_pushButton_toolPropertieColor_clicked
*/
void colorToolPropertieChanged(QColor);
private slots:
/**
* @brief on_actionImport_triggered - slot
* @details This method is called in MainWindow::on_actionImport_triggered
* it is importing an image to the canvas
*/
void on_actionImport_triggered();
/**
* @brief resizeEvent - slot
* @details This method is called in MainWindow::resizeEvent
* it resize the canvas is the MainWindow is rezised
*/
void resizeEvent(QResizeEvent *);
/**
* @brief on_actionExport_as_triggered - slot
* @details This method is called in MainWindow::on_actionExport_as_triggered
* it is exporting the canvas to a image
*/
void on_actionExport_as_triggered();
/**
* @brief on_actionExit_triggered - slot
* @details This method is called in MainWindow::on_actionExit_triggered
* it is clos the application
*/
void on_actionExit_triggered();
/**
* @brief on_actionPrint_triggered - slot
* @details this methid is called in MainWindow::on_actionPrint_triggered
* it print the canvas as pdf or on a physical printer
*/
void on_actionPrint_triggered();
/**
* @brief on_actionSave_triggered - slot
* @details This method is called in MainWindow::on_actionSave_triggered
* it save the canvas to an project file
*/
void on_actionSave_triggered();
/**
* @brief on_actionAbout_triggered - slot
* @details This method is called in MainWindow::on_actionAbout_triggered
* it is open the about message box
*/
void on_actionAbout_triggered();
/**
* @brief on_actionNew_triggered - slot
* @details This methid is called in MainWindow::on_actionNew_triggered
* it creates a new canvas
*/
void on_actionNew_triggered();
/**
* @brief onGuiEnabledChanged - slot
* @details This method is called in MainWindow::onGuiEnabledChanged
* it enables all GUI Elements
*/
void onGuiEnabledChanged();
/**
* @brief on_actionOpen_triggered - slot
* @details This method is called in MainWindow::on_actionOpen_triggered
* it opens a project file
*/
void on_actionOpen_triggered();
/**
* @brief on_toolButtonLeftClicked - slot
* @param object - the current object
* @details This method is called in MainWindow::on_toolButtonLeftClicked
* it recognize if the user clicked on a tool button
*/
void on_toolButtonLeftClicked(QObject* object);
/**
* @brief onItemSelectedUpdate - slot
* @param color - the current color
* @param height - the current height
* @param text - the current text
* @param borderSize - the current borderSize
* @details This method is called in MainWindow::onItemSelectedUpdate
* it updates the GUI if an item change their properties
*/
void onItemSelectedUpdate(QColor color, qreal height, QString text, qreal borderSize);
/**
* @brief on_pushButton_toolPropertieColor_clicked - slot
* @details This method is called in MainWindow::on_pushButton_toolPropertieColor_clicked
* it opens a color picker and set the selected color
*/
void on_pushButton_toolPropertieColor_clicked();
private:
/**
* @brief ui - the curreent ui
*/
Ui::MainWindow *ui;
/**
* @brief m_app - member of the class
* @details the current app
*/
app::App *m_app;
/**
* @brief isCanvasActivated - member of the class
* @details the current status of the activation of the canvas
*/
bool isCanvasActivated;
/**
* @brief m_watcher - member of the class
* @details the current watcher of the menu tool buttons
*/
ToolMenuWatcher *m_watcher;
/**
* @brief initializeGuiElements - method
* @details This method is called in MainWindow::initializeGuiElements
* it initialize all gui elements
*/
void initializeGuiElements();
/**
* @brief initializeConnections - method
* @details This method is called in MainWindow::initializeConnections
* it initialize all connections
*/
void initializeConnections();
/**
* @brief setToolPropertiesInvisible - method
* @details This method is called in MainWindow::setToolPropertiesInvisible
* it set all tool propertie GUI elements invisible
*/
void setToolPropertiesInvisible();
/**
* @brief setTextToolsGuiVisible - method
* @details This method is called in MainWindow::setTextToolsGuiVisible
* it set alls text tool gui elements visible
*/
void setTextToolsGuiVisible();
/**
* @brief setToolsIconsUnselected - method
* @details This method is called in MainWindow::setToolsIconsUnselected
* it set all tool icons in the tool menu unselected (to grey)
*/
void setToolsIconsUnselected();
};
#endif // MAINWINDOW_H