forked from Raffarti/Touchegg-gce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editdialog.h
132 lines (118 loc) · 3.38 KB
/
editdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef EDITDIALOG_H
#define EDITDIALOG_H
#include <QDialog>
#include <QComboBox>
#include <QSpinBox>
#include "button.h"
#include "general.h"
#include <QCheckBox>
#include "sendkeys.h"
namespace Ui {
class EditDialog;
}
/**
* @brief The EditDialog class
*This class is an interface to edit
*existing gestures or create new ones.
*/
class EditDialog : public QDialog
{
Q_OBJECT
signals:
/**
* @brief done
*send a signal with the reference of the new gesture.
*If an existing gesture was edited instead, gesture will be NULL.
* @param gesture
*/
void done(Gesture *gesture = 0);
/**
* @brief done
*send a signal with the reference of the new gesture.
*If an existing gesture was edited instead, gesture will be NULL.
* @param gesture
*/
void deleteGesture(Gesture *gesture);
public:
/**
* @brief b
*reference to the calling button interface to
*load the values of an existing gesture.
*This is NULL if is a new gesture instead.
*/
button *b;
/**
* @brief actionList
*Allow the user to select the action for the gesture.
*/
QComboBox *actionList;
/**
* @brief EditDialog
*costructors for edit a gesture or edit an existing one.
* @param gesture if existing.
* @param parent
*/
explicit EditDialog(Gesture *gesture, QWidget *parent = 0);
explicit EditDialog(QWidget *parent = 0);
Gesture* getGesture();
void setGesture(Gesture * gesture);
~EditDialog();
/**
* @brief setUp
*initialize the starting values of the dialog components,
*it loads the old ones for existing gestures.
* @param fullEditable true is the gesture is a new one, to allow
*the editing of gestures specific values (fingers, type and direction)
*Action values are allways editable.
*/
void setUp(bool fullEditable);
private slots:
/**
* @brief on_actionList_currentIndexChanged
*Allow the selection of the gest action type.
* @param arg1 the action type name.
*/
void on_actionList_currentIndexChanged(const QString &arg1);
/**
* @brief on_buttonBox_rejected
*Simply exit without any change to memory.
*/
void on_buttonBox_rejected();
/**
* @brief on_buttonBox_accepted
*Apply the changes to memory.
*/
void on_buttonBox_accepted();
/**
* @brief on_gesture_currentIndexChanged
*When gesture type is changed, directions have to be refreshed.
* @param arg1 the name of the new gesture type.
*/
void on_gesture_currentIndexChanged(const QString &arg1);
private:
/**
* @brief gesture
*reference in memory.
*/
Gesture *gesture;
/**
* @brief cleanLayout
*Used to clean action layout
* @param l
*/
void cleanLayout(QLayout* l);
/**
* @brief fingSpin ref to the spinner used to select the number of finges of the gesture.
*/
QSpinBox *fingSpin;
/**
* @brief gesType ref to the combo box used to select the type of the gesture.
*/
QComboBox *gesType;
/**
* @brief gesDirection ref to the combo box used to select the direction of the gesture.
*/
QComboBox *gesDirection;
Ui::EditDialog *ui;
};
#endif // EDITDIALOG_H