source: trunk/src/plugins/accessible/widgets/rangecontrols.h@ 64

Last change on this file since 64 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

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