-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathvariableeditor.h
More file actions
163 lines (123 loc) · 3.01 KB
/
variableeditor.h
File metadata and controls
163 lines (123 loc) · 3.01 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
SPDX-FileCopyrightText: 2011-2018 Dominik Haumann <dhaumann@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef VARIABLE_EDITOR_H
#define VARIABLE_EDITOR_H
#include <QWidget>
class KateHelpButton;
class VariableBoolItem;
class VariableColorItem;
class VariableFontItem;
class VariableItem;
class VariableStringListItem;
class VariableIntItem;
class VariableStringItem;
class VariableSpellCheckItem;
class VariableRemoveSpacesItem;
class KColorCombo;
class QFontComboBox;
class QCheckBox;
class QComboBox;
class QLabel;
class QLineEdit;
class QSpinBox;
namespace Sonnet
{
class DictionaryComboBox;
}
class VariableEditor : public QWidget
{
Q_OBJECT
public:
explicit VariableEditor(VariableItem *item, QWidget *parent = nullptr);
VariableItem *item() const;
Q_SIGNALS:
void valueChanged();
protected Q_SLOTS:
void itemEnabled(bool enabled);
void activateItem();
protected:
void paintEvent(QPaintEvent *event) override;
void enterEvent(QEnterEvent *event) override;
void leaveEvent(QEvent *event) override;
private:
VariableItem *m_item;
QCheckBox *m_checkBox;
QLabel *m_variable;
QLabel *m_helpText;
KateHelpButton *m_btnHelp;
};
class VariableIntEditor : public VariableEditor
{
public:
VariableIntEditor(VariableIntItem *item, QWidget *parent);
protected:
void setItemValue(int newValue);
private:
QSpinBox *m_spinBox;
};
class VariableBoolEditor : public VariableEditor
{
public:
VariableBoolEditor(VariableBoolItem *item, QWidget *parent);
protected:
void setItemValue(int enabled);
private:
QComboBox *m_comboBox;
};
class VariableStringListEditor : public VariableEditor
{
public:
VariableStringListEditor(VariableStringListItem *item, QWidget *parent);
protected:
void setItemValue(const QString &newValue);
private:
QComboBox *m_comboBox;
};
class VariableColorEditor : public VariableEditor
{
public:
VariableColorEditor(VariableColorItem *item, QWidget *parent);
protected:
void setItemValue(const QColor &newValue);
private:
KColorCombo *m_comboBox;
};
class VariableFontEditor : public VariableEditor
{
public:
VariableFontEditor(VariableFontItem *item, QWidget *parent);
protected:
void setItemValue(const QFont &newValue);
private:
QFontComboBox *m_comboBox;
};
class VariableStringEditor : public VariableEditor
{
public:
VariableStringEditor(VariableStringItem *item, QWidget *parent);
protected:
void setItemValue(const QString &newValue);
private:
QLineEdit *m_lineEdit;
};
class VariableSpellCheckEditor : public VariableEditor
{
public:
VariableSpellCheckEditor(VariableSpellCheckItem *item, QWidget *parent);
protected:
void setItemValue(const QString &newValue);
private:
Sonnet::DictionaryComboBox *m_dictionaryCombo;
};
class VariableRemoveSpacesEditor : public VariableEditor
{
public:
VariableRemoveSpacesEditor(VariableRemoveSpacesItem *item, QWidget *parent);
protected:
void setItemValue(int enabled);
private:
QComboBox *m_comboBox;
};
#endif