]> Shamusworld >> Repos - warehouse-man-deluxe/blob - src/editorwidget.h
Converted from Qt4 to Qt5.
[warehouse-man-deluxe] / src / editorwidget.h
1 #ifndef __EDITORWIDGET_H__
2 #define __EDITORWIDGET_H__
3
4 #include <QtWidgets>
5 #include <stdint.h>
6 #include "boards.h"
7
8 class EditorWidget: public QWidget
9 {
10         Q_OBJECT
11
12         public:
13                 EditorWidget(QWidget * parent = 0);
14                 ~EditorWidget();
15
16         protected:
17                 QSize sizeHint() const;
18                 void paintEvent(QPaintEvent * event);
19                 void mousePressEvent(QMouseEvent * event);
20                 void mouseMoveEvent(QMouseEvent * event);
21                 void mouseReleaseEvent(QMouseEvent * event);
22                 void mouseDoubleClickEvent(QMouseEvent * event);
23                 void keyPressEvent(QKeyEvent * event);
24                 void keyReleaseEvent(QKeyEvent * event);
25                 void resizeEvent(QResizeEvent * event);
26
27 //      signals:
28 //              void UpdateScore(int);
29 //              void GameWasWon(void);
30
31         public:
32                 void CreateBackground(void);
33                 void ClearLevel(void);
34                 bool Load(void);
35                 bool Save(void);
36                 void SetNameOnCurrentLevel(const char *);
37                 void AddNewLevelAtCurrentPosition(void);
38                 static void GetSizeAndCorner(Level *, Point &, Point &);
39         private:
40                 void CountBoxesAndSpots(int &, int &);
41                 void ShiftLevel(int, int);
42                 void ResizeGrid(void);
43                 void Pause(int);
44
45         public:
46                 uint32_t currentLevel;
47
48         private:
49 //              Level currentLevel;
50                 QSize clientArea;
51                 Point range;
52 };
53
54 #endif  // __EDITORWIDGET_H__
55