IntelliPhoto  0.5
IntelliPhotoGui.h
Go to the documentation of this file.
1 #ifndef IntelliPhotoGui_H
2 #define IntelliPhotoGui_H
3 
4 #include <QList>
5 #include <QMainWindow>
6 #include <QGridLayout>
7 #include <QPushButton>
8 #include <QTextEdit>
9 #include <QLabel>
10 #include <QLineEdit>
11 
12 // PaintingArea used to paint the image
13 class PaintingArea;
14 
15 class IntelliTool;
16 
17 class IntelliColorPicker;
18 
22 class IntelliPhotoGui : public QMainWindow {
23 // Declares our class as a QObject which is the base class
24 // for all Qt objects
25 // QObjects handle events
26 Q_OBJECT
27 public:
32 
33 protected:
34 // Function used to close an event
35 void closeEvent(QCloseEvent*event) override;
36 
37 private slots:
38 // meta slots here (need further )
39 void slotOpen();
40 void slotSave();
41 
42 // layer slots here
43 void slotCreateNewLayer();
44 void slotDeleteLayer();
45 void slotClearActiveLayer();
46 void slotSetActiveLayer();
47 void slotSetActiveAlpha();
48 void slotPositionMoveUp();
49 void slotPositionMoveDown();
50 void slotPositionMoveLeft();
51 void slotPositionMoveRight();
52 void slotMoveLayerUp();
53 void slotMoveLayerDown();
54 
55 // color Picker slots here
56 void slotSetFirstColor();
57 void slotSetSecondColor();
58 void slotSwitchColor();
59 
60 // tool slots here
61 void slotCreatePenTool();
62 void slotCreatePlainTool();
63 void slotCreateLineTool();
64 void slotCreateRectangleTool();
65 void slotCreateCircleTool();
66 void slotCreatePolygonTool();
67 void slotCreateFloodFillTool();
68 
69 // slots for dialogs
70 void slotAboutDialog();
71 
72 private:
73 // Will tie user actions to functions
74 void createActions();
75 void createMenus();
76 // setup GUI elements
77 void createGui();
78 // set style of the GUI
79 void setIntelliStyle();
80 
81 // Will check if changes have occurred since last save
82 bool maybeSave();
83 // Opens the Save dialog and saves
84 bool saveFile(const QByteArray &fileFormat);
85 
86 // What we'll draw on
87 PaintingArea* paintingArea;
88 
89 // The menu widgets
90 QMenu*saveAsMenu;
91 QMenu*fileMenu;
92 QMenu*optionMenu;
93 QMenu*layerMenu;
94 QMenu*colorMenu;
95 QMenu*toolMenu;
96 QMenu*helpMenu;
97 
98 // All the actions that can occur
99 // meta image actions (need further modularisation)
100 QAction*actionOpen;
101 QAction*actionExit;
102 
103 // color Picker actions
104 QAction*actionColorPickerFirstColor;
105 QAction*actionColorPickerSecondColor;
106 QAction*actionColorSwitch;
107 
108 // tool actions
109 QAction*actionCreatePenTool;
110 QAction*actionCreatePlainTool;
111 QAction*actionCreateLineTool;
112 QAction*actionCreateRectangleTool;
113 QAction*actionCreateCircleTool;
114 QAction*actionCreatePolygonTool;
115 QAction*actionCreateFloodFillTool;
116 
117 // dialog actions
118 QAction*actionAboutDialog;
119 QAction*actionAboutQtDialog;
120 
121 // layer change actions
122 QAction*actionCreateNewLayer;
123 QAction*actionDeleteLayer;
124 QAction* actionSetActiveLayer;
125 QAction* actionSetActiveAlpha;
126 QAction* actionMovePositionUp;
127 QAction* actionMovePositionDown;
128 QAction* actionMovePositionLeft;
129 QAction* actionMovePositionRight;
130 QAction* actionMoveLayerUp;
131 QAction* actionMoveLayerDown;
132 
133 // Actions tied to specific file formats
134 QList<QAction*> actionSaveAs;
135 
136 // main GUI elements
137 QWidget* centralGuiWidget;
138 QGridLayout*mainLayout;
139 };
140 
141 #endif
IntelliPhotoGui
The IntelliPhotoGui class handles the graphical user interface for the intelliPhoto program.
Definition: IntelliPhotoGui.h:22
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:10
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:36
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:13
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: IntelliPhotoGui.cpp:26
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:11