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

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 6.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 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** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
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** 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 have questions regarding the use of this file, please contact
37** Nokia at qt-info@nokia.com.
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{
63 Q_ACCESSIBLE_OBJECT
64public:
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 &params);
83
84 QVariant invokeMethodEx(Method method, int child, const QVariantList &params);
85
86 // QAccessibleValueInterface
87 QVariant currentValue();
88 void setCurrentValue(const QVariant &value);
89 QVariant maximumValue();
90 QVariant minimumValue();
91
92protected:
93 QAbstractSpinBox *abstractSpinBox() const;
94};
95
96class QAccessibleSpinBox : public QAccessibleAbstractSpinBox
97{
98public:
99 explicit QAccessibleSpinBox(QWidget *w);
100
101 State state(int child) const;
102
103 bool doAction(int action, int child, const QVariantList &params);
104
105protected:
106 QSpinBox *spinBox() const;
107};
108
109class QAccessibleDoubleSpinBox : public QAccessibleWidgetEx
110{
111public:
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 &params);
125 QString text(Text t, int child) const;
126 Role role(int child) const;
127 State state(int child) const;
128
129protected:
130 QDoubleSpinBox *doubleSpinBox() const;
131};
132#endif // QT_NO_SPINBOX
133
134class QAccessibleAbstractSlider: public QAccessibleWidgetEx, public QAccessibleValueInterface
135{
136 Q_ACCESSIBLE_OBJECT
137public:
138 explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
139
140 QVariant invokeMethodEx(Method method, int child, const QVariantList &params);
141
142 // QAccessibleValueInterface
143 QVariant currentValue();
144 void setCurrentValue(const QVariant &value);
145 QVariant maximumValue();
146 QVariant minimumValue();
147
148protected:
149 QAbstractSlider *abstractSlider() const;
150};
151
152#ifndef QT_NO_SCROLLBAR
153class QAccessibleScrollBar : public QAccessibleAbstractSlider
154{
155public:
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
174protected:
175 QScrollBar *scrollBar() const;
176};
177#endif // QT_NO_SCROLLBAR
178
179#ifndef QT_NO_SLIDER
180class QAccessibleSlider : public QAccessibleAbstractSlider
181{
182public:
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
202protected:
203 QSlider *slider() const;
204};
205#endif // QT_NO_SLIDER
206
207#ifndef QT_NO_DIAL
208class QAccessibleDial : public QAccessibleWidgetEx
209{
210public:
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 &params);
225
226protected:
227 QDial *dial() const;
228};
229#endif // QT_NO_DIAL
230
231#endif // QT_NO_ACCESSIBILITY
232
233QT_END_NAMESPACE
234
235#endif // RANGECONTROLS_H
Note: See TracBrowser for help on using the repository browser.