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

Last change on this file since 104 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: