IntelliPhoto  0.5
IntelliPhotoGui.h
Go to the documentation of this file.
1 #ifndef IntelliPhotoGui_H
2 #define IntelliPhotoGui_H
3 
4 #include <QtWidgets>
5 #include <QPixmap>
6 #include <QList>
7 #include <QMainWindow>
8 #include <QGridLayout>
9 #include <QPushButton>
10 #include <QTextEdit>
11 #include <QLabel>
12 #include <QLineEdit>
13 
14 #include "IntelliInputDialog.h"
15 
16 
17 // PaintingArea used to paint the image
18 class PaintingArea;
19 
20 class IntelliTool;
21 
22 class IntelliColorPicker;
23 
27 class IntelliPhotoGui : public QMainWindow {
28 Q_OBJECT
29 public:
34 
35 void UpdateGui();
36 
37 void setToolWidth(int value);
38 
39 protected:
43 void closeEvent(QCloseEvent*event) override;
44 
45 private slots:
46 void slotOpen();
47 void slotSave();
48 
49 // layer slots here
50 void slotCreateNewRasterLayer();
51 void slotCreateNewShapedLayer();
52 void slotDeleteLayer();
53 void slotSetActiveLayer();
54 void slotSetActiveAlpha();
55 void slotSetPolygon();
56 void slotPositionMoveUp();
57 void slotPositionMoveDown();
58 void slotPositionMoveLeft();
59 void slotPositionMoveRight();
60 void slotMoveLayerUp();
61 void slotMoveLayerDown();
62 
63 void slotUpdateRenderSettingsOn();
64 void slotUpdateRenderSettingsOff();
65 
66 void slotSetFirstColor();
67 void slotSetSecondColor();
68 void slotSwapColor();
69 
70 void slotCreatePenTool();
71 void slotCreatePlainTool();
72 void slotCreateLineTool();
73 void slotCreateRectangleTool();
74 void slotCreateCircleTool();
75 void slotCreatePolygonTool();
76 void slotCreateFloodFillTool();
77 
78 void slotAboutDialog();
79 
80 void slotEnterPressed();
81 
82 void slotSetWidth();
83 void slotSetInnerAlpha();
84 
85 void slotResetTools();
86 
87 private:
88 void createActions();
89 void createMenus();
90 void createGui();
91 // Set the style of the GUI
92 void setIntelliStyle();
93 
94 // Will check if changes have occurred since last save
95 bool maybeSave();
96 // Opens the Save dialog and saves
97 bool saveFile(const QByteArray &fileFormat);
98 
99 void setDefaultToolValue();
100 
101 // What we'll draw on
102 PaintingArea* paintingArea;
103 
104 const QSize Buttonsize = QSize(35,35);
105 QPixmap preview;
106 QPushButton* CircleButton;
107 QPushButton* FloodFillButton;
108 QPushButton* LineButton;
109 QPushButton* PenButton;
110 QPushButton* PlainButton;
111 QPushButton* PolygonButton;
112 QPushButton* RectangleButton;
113 QLabel* WidthLine;
114 QLabel* innerAlphaLine;
115 QLineEdit* EditLineWidth;
116 QLineEdit* EditLineInnerAlpha;
117 QIntValidator* ValidatorLineWidth;
118 QIntValidator* ValidatorInnerAlpha;
119 
120 QPushButton* FirstColorButton;
121 QPushButton* SecondColorButton;
122 QPushButton* SwitchColorButton;
123 
124 QLabel* ActiveLayerLine;
125 QLabel* ActiveLayerImageLabel;
126 
127 // The menu widgets
128 QMenu*saveAsMenu;
129 QMenu*fileMenu;
130 QMenu*renderMenu;
131 QMenu*optionMenu;
132 QMenu*layerCreationMenu;
133 QMenu*layerMenu;
134 QMenu*colorMenu;
135 QMenu*toolCreationMenu;
136 QMenu*toolSettingsMenu;
137 QMenu*toolMenu;
138 QMenu*helpMenu;
139 
140 // All the actions that can occur
141 // meta image actions (need further modularisation)
142 QAction*actionOpen;
143 QAction*actionExit;
144 
145 //Rendersetting actions
146 QAction*actionUpdateRenderSettingsOn;
147 QAction*actionUpdateRenderSettingsOff;
148 
149 // color Picker actions
150 QAction*actionColorPickerFirstColor;
151 QAction*actionColorPickerSecondColor;
152 QAction*actionColorSwap;
153 
154 // tool actions
155 QAction*actionCreatePenTool;
156 QAction*actionCreatePlainTool;
157 QAction*actionCreateLineTool;
158 QAction*actionCreateRectangleTool;
159 QAction*actionCreateCircleTool;
160 QAction*actionCreatePolygonTool;
161 QAction*actionCreateFloodFillTool;
162 
163 // dialog actions
164 QAction*actionAboutDialog;
165 QAction*actionAboutQtDialog;
166 
167 // layer change actions
168 QAction* actionCreateNewRasterLayer;
169 QAction* actionCreateNewShapedLayer;
170 QAction* actionDeleteLayer;
171 QAction* actionSetActiveLayer;
172 QAction* actionSetActiveAlpha;
173 QAction* actionSetPolygon;
174 QAction* actionMovePositionUp;
175 QAction* actionMovePositionDown;
176 QAction* actionMovePositionLeft;
177 QAction* actionMovePositionRight;
178 QAction* actionMoveLayerUp;
179 QAction* actionMoveLayerDown;
180 
181 // Actions tied to specific file formats
182 QList<QAction*> actionSaveAs;
183 
184 QAction* actionSetWidth;
185 QAction* actionSetInnerAlpha;
186 
187 // main GUI elements
188 QWidget* centralGuiWidget;
189 QGridLayout* mainLayout;
190 };
191 
192 #endif
IntelliInputDialog.h
IntelliPhotoGui
The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
Definition: IntelliPhotoGui.h:27
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:7
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:37
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:14
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:23
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:790
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:11
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:799