IntelliPhoto  1
IntelliPhotoGui.h
Go to the documentation of this file.
1 #ifndef IntelliPhotoGui_H
2 #define IntelliPhotoGui_H
3 
4 #include <QAction>
5 #include <QFileDialog>
6 #include <QMessageBox>
7 #include <QImageWriter>
8 #include <QMenu>
9 #include <QMenuBar>
10 #include <QList>
11 #include <QMainWindow>
12 #include <QGridLayout>
13 #include <QPushButton>
14 #include <QTextEdit>
15 #include <QLabel>
16 #include <QLineEdit>
17 #include <QScrollArea>
18 #include "IntelliInputDialog.h"
20 
21 //for unit testing
22 class UnitTest;
23 
24 // PaintingArea used to paint the image
25 class PaintingArea;
26 
27 class IntelliTool;
28 
29 class IntelliColorPicker;
30 
34 class IntelliPhotoGui : public QMainWindow {
35 friend UnitTest;
36 // Declares our class as a QObject which is the base class
37 // for all Qt objects
38 // QObjects handle events
39 Q_OBJECT
40 public:
45 
49 void UpdateGui();
50 
55 void setToolWidth(int value);
56 
57 protected:
61 void closeEvent(QCloseEvent*event) override;
62 
63 private slots:
64 
68 void slotOpen();
69 
73 void slotSave();
74 
78 void slotCreateNewRasterLayer();
79 
83 void slotCreateNewShapedLayer();
84 
88 void slotDeleteLayer();
89 
93 void slotSetActiveLayer();
94 
98 void slotSetActiveAlpha();
99 
103 void slotSetPolygon();
104 
108 void slotPositionMoveUp();
109 
113 void slotPositionMoveDown();
114 
118 void slotPositionMoveLeft();
119 
123 void slotPositionMoveRight();
124 
128 void slotMoveLayerUp();
129 
133 void slotMoveLayerDown();
134 
138 void slotUpdateFastRenderSettingsOn();
139 
143 void slotUpdateFastRenderSettingsOff();
144 
148 void slotSetFirstColor();
149 
153 void slotSetSecondColor();
154 
158 void slotSwapColor();
159 
163 void slotCreatePenTool();
164 
168 void slotCreatePlainTool();
169 
173 void slotCreateLineTool();
174 
178 void slotCreateRectangleTool();
179 
183 void slotCreateCircleTool();
184 
188 void slotCreatePolygonTool();
189 
193 void slotCreateFloodFillTool();
194 
198 void slotCreateGradientTool();
199 
203 void slotAboutDialog();
204 
208 void slotChangeDim();
209 
213 void slotEnterPressed();
214 
218 void slotSetWidth();
219 
223 void slotSetInnerAlpha();
224 
228 void slotResetToolButtons();
229 
233 void slotGoBack();
234 
238 void slotGoForward();
239 
240 private:
241 
245 void createActions();
246 
250 void createMenus();
251 
255 void createGui();
256 
260 void setIntelliStyle();
261 
266 bool maybeSave();
267 
273 bool saveFile(const QByteArray &fileFormat);
274 
278 void setDefaultValues();
279 
283 PaintingArea* paintingArea;
284 
288 QPixmap preview;
289 
293 QSize Buttonsize;
294 
298 QPushButton* CircleButton;
299 
303 QPushButton* FloodFillButton;
304 
308 QPushButton* GradientButton;
309 
313 QPushButton* LineButton;
314 
318 QPushButton* PenButton;
319 
323 QPushButton* PlainButton;
324 
328 QPushButton* PolygonButton;
329 
333 QPushButton* RectangleButton;
334 
338 QPushButton* FirstColorButton;
339 
343 QPushButton* SecondColorButton;
344 
348 QPushButton* SwitchColorButton;
349 
353 QPushButton* dimActive;
354 
358 QPushButton* dimCanvas;
359 
363 QLabel* WidthLine;
364 
368 QLabel* innerAlphaLine;
369 
373 QLabel* ActiveLayerLabel;
374 
378 QLabel* ActiveLayerImageLabel;
379 
383 QLabel* FastRendererLabel;
384 
388 QScrollArea* ScrollArea;
389 
393 QLineEdit* EditLineWidth;
394 
398 QLineEdit* EditLineInnerAlpha;
399 
403 QIntValidator* ValidatorLineWidth;
404 
408 QIntValidator* ValidatorInnerAlpha;
409 
410 
414 QMenu* saveAsMenu;
415 
419 QMenu* fileMenu;
420 
424 QMenu* renderMenu;
425 
429 QMenu* optionMenu;
430 
434 QMenu* layerCreationMenu;
435 
439 QMenu* layerMenu;
440 
444 QMenu* colorMenu;
445 
449 QMenu* toolCreationMenu;
450 
454 QMenu* toolSettingsMenu;
455 
459 QMenu* toolMenu;
460 
464 QMenu* helpMenu;
465 
469 QAction* actionOpen;
470 
474 QAction* actionExit;
475 
479 QAction* actionUpdateFastRenderSettingsOn;
480 
484 QAction* actionUpdateFastRenderSettingsOff;
485 
489 QAction* actionColorPickerFirstColor;
490 
494 QAction* actionColorPickerSecondColor;
495 
499 QAction* actionColorSwap;
500 
504 QAction* actionCreatePenTool;
505 
509 QAction* actionCreatePlainTool;
510 
514 QAction* actionCreateLineTool;
515 
519 QAction* actionCreateRectangleTool;
520 
524 QAction* actionCreateCircleTool;
525 
529 QAction* actionCreatePolygonTool;
530 
534 QAction* actionCreateFloodFillTool;
535 
539 QAction* actionCreateGradientTool;
540 
544 QAction* actionChangeDim;
545 
549 QAction* actionSetWidth;
550 
554 QAction* actionSetInnerAlpha;
555 
559 QAction* actionAboutDialog;
560 
564 QAction* actionAboutQtDialog;
565 
569 QAction* actionCreateNewRasterLayer;
570 
574 QAction* actionCreateNewShapedLayer;
575 
579 QAction* actionDeleteLayer;
580 
584 QAction* actionSetActiveLayer;
585 
589 QAction* actionSetActiveAlpha;
590 
594 QAction* actionSetPolygon;
595 
599 QAction* actionMovePositionUp;
600 
604 QAction* actionMovePositionDown;
605 
609 QAction* actionMovePositionLeft;
610 
614 QAction* actionMovePositionRight;
615 
619 QAction* actionMoveLayerUp;
620 
624 QAction* actionMoveLayerDown;
625 
629 QList<QAction*> actionSaveAs;
630 
634 QAction* actionGoBack;
635 
639 QAction* actionGoForward;
640 
644 QWidget* centralGuiWidget;
645 
649 QGridLayout* mainLayout;
650 };
651 
652 #endif
IntelliInputDialog.h
IntelliPhotoGui
The IntelliPhotoGui base class handles the graphical user interface and events for the intelliPhoto p...
Definition: IntelliPhotoGui.h:34
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:14
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:57
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:30
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
setToolWidth stes a width to the tool
Definition: IntelliPhotoGui.cpp:923
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:14
IntelliPhotoGui::UpdateGui
void UpdateGui()
UpdateGui a function to update all gui elements.
Definition: IntelliPhotoGui.cpp:932
UnitTest
Definition: mainUnitTest.cpp:8
IntelliDatamanager.h