-
Notifications
You must be signed in to change notification settings - Fork 25
/
editdialog.h
150 lines (134 loc) · 4.23 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/**************************************************************************
* Copyright (c) 2012-2015 Raffaele Pertile <[email protected]>
* This file is part of touchegg-gce.
*
* touchegg-gce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* touchegg-gce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with touchegg-gce. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#ifndef EDITDIALOG_H
#define EDITDIALOG_H
#include <QDialog>
class Gesture;
class QComboBox;
class QSpinBox;
class QCheckBox;
class Button;
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 buttonBoxRejected
*Simply exit without any change to memory.
*/
void on_buttonBox_rejected();
/**
* @brief buttonBoxAccepted
*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