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 
72  // Will check if changes have occurred since last save
73  bool maybeSave();
74  // Opens the Save dialog and saves
75  bool saveFile(const QByteArray &fileFormat);
76 
77  // What we'll draw on
78  PaintingArea* paintingArea;
79 
80  // The menu widgets
81  QMenu *saveAsMenu;
82  QMenu *fileMenu;
83  QMenu *optionMenu;
84  QMenu *layerMenu;
85  QMenu *colorMenu;
86  QMenu *toolMenu;
87  QMenu *helpMenu;
88 
89  // All the actions that can occur
90 
91  //meta image actions (need further modularisation)
92  QAction *actionOpen;
93  QAction *actionExit;
94 
95  //color Picker actions
96  QAction *actionColorPickerFirstColor;
97  QAction *actionColorPickerSecondColor;
98  QAction *actionColorSwitch;
99 
100  //tool actions
101  QAction *actionCreatePenTool;
102  QAction *actionCreatePlainTool;
103  QAction *actionCreateLineTool;
104 
105  //dialog actions
106  QAction *actionAboutDialog;
107  QAction *actionAboutQtDialog;
108 
109  //layer change actions
110  QAction *actionCreateNewLayer;
111  QAction *actionDeleteLayer;
112  QAction* actionSetActiveLayer;
113  QAction* actionSetActiveAlpha;
114  QAction* actionMovePositionUp;
115  QAction* actionMovePositionDown;
116  QAction* actionMovePositionLeft;
117  QAction* actionMovePositionRight;
118  QAction* actionMoveLayerUp;
119  QAction* actionMoveLayerDown;
120 
121  // Actions tied to specific file formats
122  QList<QAction *> actionSaveAs;
123 
124  //main GUI elements
125  QWidget* centralGuiWidget;
126  QGridLayout *mainLayout;
127 
128 };
129 
130 #endif
IntelliPhotoGui
Definition: IntelliPhotoGui.h:19
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
Definition: IntelliPhotoGui.cpp:10
PaintingArea
Definition: PaintingArea.h:26
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:24
IntelliColorPicker
The IntelliColorPicker manages the selected colors for one whole project.
Definition: IntelliColorPicker.h:11