| 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 |
|
|---|
| 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 | public:
|
|---|
| 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 ¶ms);
|
|---|
| 82 |
|
|---|
| 83 | QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms);
|
|---|
| 84 |
|
|---|
| 85 | // QAccessibleValueInterface
|
|---|
| 86 | QVariant currentValue();
|
|---|
| 87 | void setCurrentValue(const QVariant &value);
|
|---|
| 88 | QVariant maximumValue();
|
|---|
| 89 | QVariant minimumValue();
|
|---|
| 90 |
|
|---|
| 91 | protected:
|
|---|
| 92 | QAbstractSpinBox *abstractSpinBox() const;
|
|---|
| 93 | };
|
|---|
| 94 |
|
|---|
| 95 | class QAccessibleSpinBox : public QAccessibleAbstractSpinBox
|
|---|
| 96 | {
|
|---|
| 97 | public:
|
|---|
| 98 | explicit QAccessibleSpinBox(QWidget *w);
|
|---|
| 99 |
|
|---|
| 100 | State state(int child) const;
|
|---|
| 101 |
|
|---|
| 102 | bool doAction(int action, int child, const QVariantList ¶ms);
|
|---|
| 103 |
|
|---|
| 104 | protected:
|
|---|
| 105 | QSpinBox *spinBox() const;
|
|---|
| 106 | };
|
|---|
| 107 |
|
|---|
| 108 | class QAccessibleDoubleSpinBox : public QAccessibleWidgetEx
|
|---|
| 109 | {
|
|---|
| 110 | public:
|
|---|
| 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 ¶ms);
|
|---|
| 124 | QString text(Text t, int child) const;
|
|---|
| 125 | Role role(int child) const;
|
|---|
| 126 | State state(int child) const;
|
|---|
| 127 |
|
|---|
| 128 | protected:
|
|---|
| 129 | QDoubleSpinBox *doubleSpinBox() const;
|
|---|
| 130 | };
|
|---|
| 131 | #endif // QT_NO_SPINBOX
|
|---|
| 132 |
|
|---|
| 133 | class QAccessibleAbstractSlider: public QAccessibleWidgetEx, public QAccessibleValueInterface
|
|---|
| 134 | {
|
|---|
| 135 | public:
|
|---|
| 136 | explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
|
|---|
| 137 |
|
|---|
| 138 | QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms);
|
|---|
| 139 |
|
|---|
| 140 | // QAccessibleValueInterface
|
|---|
| 141 | QVariant currentValue();
|
|---|
| 142 | void setCurrentValue(const QVariant &value);
|
|---|
| 143 | QVariant maximumValue();
|
|---|
| 144 | QVariant minimumValue();
|
|---|
| 145 |
|
|---|
| 146 | protected:
|
|---|
| 147 | QAbstractSlider *abstractSlider() const;
|
|---|
| 148 | };
|
|---|
| 149 |
|
|---|
| 150 | #ifndef QT_NO_SCROLLBAR
|
|---|
| 151 | class QAccessibleScrollBar : public QAccessibleAbstractSlider
|
|---|
| 152 | {
|
|---|
| 153 | public:
|
|---|
| 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 |
|
|---|
| 172 | protected:
|
|---|
| 173 | QScrollBar *scrollBar() const;
|
|---|
| 174 | };
|
|---|
| 175 | #endif // QT_NO_SCROLLBAR
|
|---|
| 176 |
|
|---|
| 177 | #ifndef QT_NO_SLIDER
|
|---|
| 178 | class QAccessibleSlider : public QAccessibleAbstractSlider
|
|---|
| 179 | {
|
|---|
| 180 | public:
|
|---|
| 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 |
|
|---|
| 200 | protected:
|
|---|
| 201 | QSlider *slider() const;
|
|---|
| 202 | };
|
|---|
| 203 | #endif // QT_NO_SLIDER
|
|---|
| 204 |
|
|---|
| 205 | #ifndef QT_NO_DIAL
|
|---|
| 206 | class QAccessibleDial : public QAccessibleWidgetEx
|
|---|
| 207 | {
|
|---|
| 208 | public:
|
|---|
| 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 ¶ms);
|
|---|
| 223 |
|
|---|
| 224 | protected:
|
|---|
| 225 | QDial *dial() const;
|
|---|
| 226 | };
|
|---|
| 227 | #endif // QT_NO_DIAL
|
|---|
| 228 |
|
|---|
| 229 | #endif // QT_NO_ACCESSIBILITY
|
|---|
| 230 |
|
|---|
| 231 | QT_END_NAMESPACE
|
|---|
| 232 |
|
|---|
| 233 | #endif // RANGECONTROLS_H
|
|---|