|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the plugins of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef RANGECONTROLS_H |
|
43 #define RANGECONTROLS_H |
|
44 |
|
45 #include <QtGui/qaccessiblewidget.h> |
|
46 #include <QtGui/qaccessible2.h> |
|
47 |
|
48 QT_BEGIN_NAMESPACE |
|
49 |
|
50 #ifndef QT_NO_ACCESSIBILITY |
|
51 |
|
52 class QAbstractSpinBox; |
|
53 class QAbstractSlider; |
|
54 class QScrollBar; |
|
55 class QSlider; |
|
56 class QSpinBox; |
|
57 class QDoubleSpinBox; |
|
58 class QDial; |
|
59 |
|
60 #ifndef QT_NO_SPINBOX |
|
61 class QAccessibleAbstractSpinBox: public QAccessibleWidgetEx, public QAccessibleValueInterface |
|
62 { |
|
63 Q_ACCESSIBLE_OBJECT |
|
64 public: |
|
65 explicit QAccessibleAbstractSpinBox(QWidget *w); |
|
66 |
|
67 enum SpinBoxElements { |
|
68 SpinBoxSelf = 0, |
|
69 Editor, |
|
70 ValueUp, |
|
71 ValueDown |
|
72 }; |
|
73 |
|
74 int childCount() const; |
|
75 QRect rect(int child) const; |
|
76 |
|
77 int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const; |
|
78 |
|
79 QString text(Text t, int child) const; |
|
80 Role role(int child) const; |
|
81 |
|
82 bool doAction(int action, int child, const QVariantList ¶ms); |
|
83 |
|
84 QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms); |
|
85 |
|
86 // QAccessibleValueInterface |
|
87 QVariant currentValue(); |
|
88 void setCurrentValue(const QVariant &value); |
|
89 QVariant maximumValue(); |
|
90 QVariant minimumValue(); |
|
91 |
|
92 protected: |
|
93 QAbstractSpinBox *abstractSpinBox() const; |
|
94 }; |
|
95 |
|
96 class QAccessibleSpinBox : public QAccessibleAbstractSpinBox |
|
97 { |
|
98 public: |
|
99 explicit QAccessibleSpinBox(QWidget *w); |
|
100 |
|
101 State state(int child) const; |
|
102 |
|
103 bool doAction(int action, int child, const QVariantList ¶ms); |
|
104 |
|
105 protected: |
|
106 QSpinBox *spinBox() const; |
|
107 }; |
|
108 |
|
109 class QAccessibleDoubleSpinBox : public QAccessibleWidgetEx |
|
110 { |
|
111 public: |
|
112 explicit QAccessibleDoubleSpinBox(QWidget *widget); |
|
113 |
|
114 enum DoubleSpinBoxElements { |
|
115 SpinBoxSelf = 0, |
|
116 Editor, |
|
117 ValueUp, |
|
118 ValueDown |
|
119 }; |
|
120 |
|
121 int childCount() const; |
|
122 QRect rect(int child) const; |
|
123 int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const; |
|
124 QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms); |
|
125 QString text(Text t, int child) const; |
|
126 Role role(int child) const; |
|
127 State state(int child) const; |
|
128 |
|
129 protected: |
|
130 QDoubleSpinBox *doubleSpinBox() const; |
|
131 }; |
|
132 #endif // QT_NO_SPINBOX |
|
133 |
|
134 class QAccessibleAbstractSlider: public QAccessibleWidgetEx, public QAccessibleValueInterface |
|
135 { |
|
136 Q_ACCESSIBLE_OBJECT |
|
137 public: |
|
138 explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider); |
|
139 |
|
140 QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms); |
|
141 |
|
142 // QAccessibleValueInterface |
|
143 QVariant currentValue(); |
|
144 void setCurrentValue(const QVariant &value); |
|
145 QVariant maximumValue(); |
|
146 QVariant minimumValue(); |
|
147 |
|
148 protected: |
|
149 QAbstractSlider *abstractSlider() const; |
|
150 }; |
|
151 |
|
152 #ifndef QT_NO_SCROLLBAR |
|
153 class QAccessibleScrollBar : public QAccessibleAbstractSlider |
|
154 { |
|
155 public: |
|
156 explicit QAccessibleScrollBar(QWidget *w); |
|
157 |
|
158 enum ScrollBarElements { |
|
159 ScrollBarSelf = 0, |
|
160 LineUp, |
|
161 PageUp, |
|
162 Position, |
|
163 PageDown, |
|
164 LineDown |
|
165 }; |
|
166 |
|
167 int childCount() const; |
|
168 |
|
169 QRect rect(int child) const; |
|
170 QString text(Text t, int child) const; |
|
171 Role role(int child) const; |
|
172 State state(int child) const; |
|
173 |
|
174 protected: |
|
175 QScrollBar *scrollBar() const; |
|
176 }; |
|
177 #endif // QT_NO_SCROLLBAR |
|
178 |
|
179 #ifndef QT_NO_SLIDER |
|
180 class QAccessibleSlider : public QAccessibleAbstractSlider |
|
181 { |
|
182 public: |
|
183 explicit QAccessibleSlider(QWidget *w); |
|
184 |
|
185 enum SliderElements { |
|
186 SliderSelf = 0, |
|
187 PageLeft, |
|
188 Position, |
|
189 PageRight |
|
190 }; |
|
191 |
|
192 int childCount() const; |
|
193 |
|
194 QRect rect(int child) const; |
|
195 QString text(Text t, int child) const; |
|
196 Role role(int child) const; |
|
197 State state(int child) const; |
|
198 |
|
199 int defaultAction(int child) const; |
|
200 QString actionText(int action, Text t, int child) const; |
|
201 |
|
202 protected: |
|
203 QSlider *slider() const; |
|
204 }; |
|
205 #endif // QT_NO_SLIDER |
|
206 |
|
207 #ifndef QT_NO_DIAL |
|
208 class QAccessibleDial : public QAccessibleWidgetEx |
|
209 { |
|
210 public: |
|
211 explicit QAccessibleDial(QWidget *w); |
|
212 |
|
213 enum DialElements { |
|
214 Self = 0, |
|
215 SpeedoMeter, |
|
216 SliderHandle |
|
217 }; |
|
218 |
|
219 int childCount() const; |
|
220 QRect rect(int child) const; |
|
221 QString text(Text textType, int child) const; |
|
222 Role role(int child) const; |
|
223 State state(int child) const; |
|
224 QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms); |
|
225 |
|
226 protected: |
|
227 QDial *dial() const; |
|
228 }; |
|
229 #endif // QT_NO_DIAL |
|
230 |
|
231 #endif // QT_NO_ACCESSIBILITY |
|
232 |
|
233 QT_END_NAMESPACE |
|
234 |
|
235 #endif // RANGECONTROLS_H |