0
|
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 SIMPLEWIDGETS_H
|
|
43 |
#define SIMPLEWIDGETS_H
|
|
44 |
|
|
45 |
#include <QtCore/qcoreapplication.h>
|
|
46 |
#include <QtGui/qaccessible2.h>
|
|
47 |
#include <QtGui/qaccessiblewidget.h>
|
|
48 |
|
|
49 |
QT_BEGIN_NAMESPACE
|
|
50 |
|
|
51 |
#ifndef QT_NO_ACCESSIBILITY
|
|
52 |
|
|
53 |
class QAbstractButton;
|
|
54 |
class QLineEdit;
|
|
55 |
class QToolButton;
|
|
56 |
class QProgressBar;
|
|
57 |
|
|
58 |
class QAccessibleButton : public QAccessibleWidgetEx, public QAccessibleActionInterface
|
|
59 |
{
|
|
60 |
Q_ACCESSIBLE_OBJECT
|
|
61 |
Q_DECLARE_TR_FUNCTIONS(QAccessibleButton)
|
|
62 |
public:
|
|
63 |
QAccessibleButton(QWidget *w, Role r);
|
|
64 |
|
|
65 |
QString text(Text t, int child) const;
|
|
66 |
State state(int child) const;
|
|
67 |
|
|
68 |
QString actionText(int action, Text text, int child) const;
|
|
69 |
bool doAction(int action, int child, const QVariantList ¶ms);
|
|
70 |
|
|
71 |
// QAccessibleActionInterface
|
|
72 |
int actionCount();
|
|
73 |
void doAction(int actionIndex);
|
|
74 |
QString description(int actionIndex);
|
|
75 |
QString name(int actionIndex);
|
|
76 |
QString localizedName(int actionIndex);
|
|
77 |
QStringList keyBindings(int actionIndex);
|
|
78 |
|
|
79 |
protected:
|
|
80 |
QAbstractButton *button() const;
|
|
81 |
};
|
|
82 |
|
|
83 |
#ifndef QT_NO_TOOLBUTTON
|
|
84 |
class QAccessibleToolButton : public QAccessibleButton
|
|
85 |
{
|
|
86 |
public:
|
|
87 |
QAccessibleToolButton(QWidget *w, Role role);
|
|
88 |
|
|
89 |
enum ToolButtonElements {
|
|
90 |
ToolButtonSelf = 0,
|
|
91 |
ButtonExecute,
|
|
92 |
ButtonDropMenu
|
|
93 |
};
|
|
94 |
|
|
95 |
Role role(int child) const;
|
|
96 |
State state(int child) const;
|
|
97 |
|
|
98 |
int childCount() const;
|
|
99 |
QRect rect(int child) const;
|
|
100 |
|
|
101 |
QString text(Text t, int child) const;
|
|
102 |
|
|
103 |
int actionCount(int child) const;
|
|
104 |
QString actionText(int action, Text text, int child) const;
|
|
105 |
bool doAction(int action, int child, const QVariantList ¶ms);
|
|
106 |
|
|
107 |
protected:
|
|
108 |
QToolButton *toolButton() const;
|
|
109 |
|
|
110 |
bool isSplitButton() const;
|
|
111 |
};
|
|
112 |
#endif // QT_NO_TOOLBUTTON
|
|
113 |
|
|
114 |
class QAccessibleDisplay : public QAccessibleWidgetEx
|
|
115 |
{
|
|
116 |
Q_ACCESSIBLE_OBJECT
|
|
117 |
public:
|
|
118 |
explicit QAccessibleDisplay(QWidget *w, Role role = StaticText);
|
|
119 |
|
|
120 |
QString text(Text t, int child) const;
|
|
121 |
Role role(int child) const;
|
|
122 |
|
|
123 |
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
|
|
124 |
int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
|
|
125 |
};
|
|
126 |
|
|
127 |
#ifndef QT_NO_LINEEDIT
|
|
128 |
class QAccessibleLineEdit : public QAccessibleWidgetEx, public QAccessibleTextInterface,
|
|
129 |
public QAccessibleSimpleEditableTextInterface
|
|
130 |
{
|
|
131 |
Q_ACCESSIBLE_OBJECT
|
|
132 |
public:
|
|
133 |
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
|
|
134 |
|
|
135 |
QString text(Text t, int child) const;
|
|
136 |
void setText(Text t, int control, const QString &text);
|
|
137 |
State state(int child) const;
|
|
138 |
QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
|
139 |
|
|
140 |
// QAccessibleTextInterface
|
|
141 |
void addSelection(int startOffset, int endOffset);
|
|
142 |
QString attributes(int offset, int *startOffset, int *endOffset);
|
|
143 |
int cursorPosition();
|
|
144 |
QRect characterRect(int offset, QAccessible2::CoordinateType coordType);
|
|
145 |
int selectionCount();
|
|
146 |
int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType);
|
|
147 |
void selection(int selectionIndex, int *startOffset, int *endOffset);
|
|
148 |
QString text(int startOffset, int endOffset);
|
|
149 |
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
|
150 |
int *startOffset, int *endOffset);
|
|
151 |
QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
|
152 |
int *startOffset, int *endOffset);
|
|
153 |
QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
|
154 |
int *startOffset, int *endOffset);
|
|
155 |
void removeSelection(int selectionIndex);
|
|
156 |
void setCursorPosition(int position);
|
|
157 |
void setSelection(int selectionIndex, int startOffset, int endOffset);
|
|
158 |
int characterCount();
|
|
159 |
void scrollToSubstring(int startIndex, int endIndex);
|
|
160 |
|
|
161 |
protected:
|
|
162 |
QLineEdit *lineEdit() const;
|
|
163 |
};
|
|
164 |
#endif // QT_NO_LINEEDIT
|
|
165 |
|
|
166 |
#ifndef QT_NO_PROGRESSBAR
|
|
167 |
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
|
|
168 |
{
|
|
169 |
Q_ACCESSIBLE_OBJECT
|
|
170 |
public:
|
|
171 |
explicit QAccessibleProgressBar(QWidget *o);
|
|
172 |
|
|
173 |
// QAccessibleValueInterface
|
|
174 |
QVariant currentValue();
|
|
175 |
QVariant maximumValue();
|
|
176 |
QVariant minimumValue();
|
|
177 |
inline void setCurrentValue(const QVariant &) {}
|
|
178 |
|
|
179 |
protected:
|
|
180 |
QProgressBar *progressBar() const;
|
|
181 |
};
|
|
182 |
#endif
|
|
183 |
|
|
184 |
#endif // QT_NO_ACCESSIBILITY
|
|
185 |
|
|
186 |
QT_END_NAMESPACE
|
|
187 |
|
|
188 |
#endif // SIMPLEWIDGETS_H
|