IntelliPhoto  0.4
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 
19 class IntelliPhotoGui : public QMainWindow{
20  // Declares our class as a QObject which is the base class
21  // for all Qt objects
22  // QObjects handle events
23  Q_OBJECT
24 public:
26 
27 protected:
28  // Function used to close an event
29  void closeEvent(QCloseEvent *event) override;
30 
31 private slots:
32  // meta slots here (need further )
33  void slotOpen();
34  void slotSave();
35 
36  // layer slots here
37  void slotCreateNewLayer();
38  void slotDeleteLayer();
39  void slotClearActiveLayer();
40  void slotSetActiveLayer();
41  void slotSetActiveAlpha();
42  void slotPositionMoveUp();
43  void slotPositionMoveDown();
44  void slotPositionMoveLeft();
45  void slotPositionMoveRight();
46  void slotMoveLayerUp();
47  void slotMoveLayerDown();
48 
49  // color Picker slots here
50  void slotSetFirstColor();
51  void slotSetSecondColor();
52  void slotSwitchColor();
53 
54  // tool slots here
55  void slotCreatePenTool();
56  void slotCreatePlainTool();
57  void slotCreateLineTool();
58 
59  // slots for dialogs
60  void slotAboutDialog();
61 
62 private:
63  // Will tie user actions to functions
64  void createActions();
65  void createMenus();
66  // setup GUI elements
67  void createGui();
68  // set style of the GUI
69  void setIntelliStyle();
70 
71  // Will check if changes have occurred since last save
72  bool maybeSave();
73  // Opens the Save dialog and saves
74  bool saveFile(const QByteArray &fileFormat);
75 
76  // What we'll draw on
77  PaintingArea* paintingArea;
78 
79  // The menu widgets
80  QMenu *saveAsMenu;
81  QMenu *fileMenu;
82  QMenu *optionMenu;
83  QMenu *layerMenu;
84  QMenu *colorMenu;
85  QMenu *toolMenu;
86  QMenu *helpMenu;
87 
88  // All the actions that can occur
89  // meta image actions (need further modularisation)
90  QAction *actionOpen;
91  QAction *actionExit;
92 
93  // color Picker actions
94  QAction *actionColorPickerFirstColor;
95  QAction *actionColorPickerSecondColor;
96  QAction *actionColorSwitch;
97 
98  // tool actions
99  QAction *actionCreatePenTool;
100  QAction *actionCreatePlainTool;
101  QAction *actionCreateLineTool;
102 
103  // dialog actions
104  QAction *actionAboutDialog;
105  QAction *actionAboutQtDialog;
106 
107  // layer change actions
108  QAction *actionCreateNewLayer;
109  QAction *actionDeleteLayer;
110  QAction* actionSetActiveLayer;
111  QAction* actionSetActiveAlpha;
112  QAction* actionMovePositionUp;
113  QAction* actionMovePositionDown;
114  QAction* actionMovePositionLeft;
115  QAction* actionMovePositionRight;
116  QAction* actionMoveLayerUp;
117  QAction* actionMoveLayerDown;
118 
119  // Actions tied to specific file formats
120  QList<QAction *> actionSaveAs;
121 
122  // main GUI elements
123  QWidget* centralGuiWidget;
124  QGridLayout *mainLayout;
125 };
126 
127 #endif
IntelliPhotoGui
Definition: IntelliPhotoGui.h:19
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
Definition: IntelliPhotoGui.cpp:10
PaintingArea
Definition: PaintingArea.h:25
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