Qt 4.8
simplewidgets.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
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 
50 
51 #ifndef QT_NO_ACCESSIBILITY
52 
53 class QAbstractButton;
54 class QLineEdit;
55 class QToolButton;
56 class QGroupBox;
57 class QProgressBar;
58 
60 {
63 public:
65 
66  QString text(Text t, int child) const;
67  State state(int child) const;
68 
69  QString actionText(int action, Text text, int child) const;
70  bool doAction(int action, int child, const QVariantList &params);
71 
72  // QAccessibleActionInterface
73  int actionCount();
74  void doAction(int actionIndex);
75  QString description(int actionIndex);
76  QString name(int actionIndex);
77  QString localizedName(int actionIndex);
78  QStringList keyBindings(int actionIndex);
79 
80 protected:
81  QAbstractButton *button() const;
82 };
83 
84 #ifndef QT_NO_TOOLBUTTON
86 {
87 public:
89 
91  ToolButtonSelf = 0,
93  ButtonDropMenu
94  };
95 
96  Role role(int child) const;
97  State state(int child) const;
98 
99  int childCount() const;
100  QRect rect(int child) const;
101 
102  QString text(Text t, int child) const;
103 
104  int actionCount(int child) const;
105  QString actionText(int action, Text text, int child) const;
106  bool doAction(int action, int child, const QVariantList &params);
107 
108 protected:
109  QToolButton *toolButton() const;
110 
111  bool isSplitButton() const;
112 };
113 #endif // QT_NO_TOOLBUTTON
114 
116 {
118 public:
120 
121  QString text(Text t, int child) const;
122  Role role(int child) const;
123 
124  Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
125  int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
126 
127  // QAccessibleImageInterface
128  QString imageDescription();
129  QSize imageSize();
130  QRect imagePosition(QAccessible2::CoordinateType coordType);
131 };
132 
133 #ifndef QT_NO_GROUPBOX
136 {
138 public:
139  explicit QAccessibleGroupBox(QWidget *w);
140 
141  State state(int child) const;
142  Role role(int child) const;
143  QString text(Text t, int child) const;
144 
145  Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
146  int navigate(RelationFlag rel, int entry, QAccessibleInterface** target) const;
147 
148  //QAccessibleActionInterface
149  int actionCount();
150  QString description(int actionIndex);
151  void doAction(int actionIndex);
152  QString name(int actionIndex);
153  QString localizedName(int actionIndex);
154  QStringList keyBindings(int actionIndex);
155 
156 private:
157  QGroupBox *groupBox() const;
158 };
159 #endif
160 
161 #ifndef QT_NO_LINEEDIT
164 {
166 public:
167  explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
168 
169  QString text(Text t, int child) const;
170  void setText(Text t, int control, const QString &text);
171  State state(int child) const;
172  QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList &params);
173 
174  // QAccessibleTextInterface
175  void addSelection(int startOffset, int endOffset);
176  QString attributes(int offset, int *startOffset, int *endOffset);
177  int cursorPosition();
178  QRect characterRect(int offset, QAccessible2::CoordinateType coordType);
179  int selectionCount();
180  int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType);
181  void selection(int selectionIndex, int *startOffset, int *endOffset);
182  QString text(int startOffset, int endOffset);
183  QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
184  int *startOffset, int *endOffset);
185  QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
186  int *startOffset, int *endOffset);
187  QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
188  int *startOffset, int *endOffset);
189  void removeSelection(int selectionIndex);
190  void setCursorPosition(int position);
191  void setSelection(int selectionIndex, int startOffset, int endOffset);
192  int characterCount();
193  void scrollToSubstring(int startIndex, int endIndex);
194 
195 protected:
196  QLineEdit *lineEdit() const;
197 };
198 #endif // QT_NO_LINEEDIT
199 
200 #ifndef QT_NO_PROGRESSBAR
202 {
204 public:
205  explicit QAccessibleProgressBar(QWidget *o);
206 
207  // QAccessibleValueInterface
208  QVariant currentValue();
209  QVariant maximumValue();
210  QVariant minimumValue();
211  inline void setCurrentValue(const QVariant &) {}
212 
213 protected:
214  QProgressBar *progressBar() const;
215 };
216 #endif
217 
218 #endif // QT_NO_ACCESSIBILITY
219 
221 
222 #endif // SIMPLEWIDGETS_H
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
Role role(int child) const
Returns the role of the object, or of the object&#39;s child if child is not 0.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QAccessibleButton(QWidget *w, Role r)
Creates a QAccessibleButton object for w.
Role
This enum defines the role of an accessible object.
Definition: qaccessible.h:188
The QAccessibleLineEdit class implements the QAccessibleInterface for widgets with editable text...
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QProgressBar widget provides a horizontal or vertical progress bar.
Definition: qprogressbar.h:58
The QString class provides a Unicode character string.
Definition: qstring.h:83
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const
Returns the relationship between this object&#39;s \a child and the \a other object&#39;s \a otherChild...
QString text(Text t, int child) const
Reimplemented Function
QAbstractButton * button() const
Returns the button.
void setText(Text t, int child, const QString &text)
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.
State state(int child) const
Reimplemented Function
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QRect rect(int child) const
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
RelationFlag
This enum type defines bit flags that can be combined to indicate the relationship between two access...
Definition: qaccessible.h:268
Method
This enum describes the possible types of methods that can be invoked on an accessible object...
Definition: qaccessible.h:311
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QAccessibleDisplay class implements the QAccessibleInterface for widgets that display information...
#define Q_ACCESSIBLE_OBJECT
Definition: qaccessible2.h:108
The QGroupBox widget provides a group box frame with a title.
Definition: qgroupbox.h:57
The QAccessibleButton class implements the QAccessibleInterface for button type widgets.
Definition: simplewidgets.h:59
The State element defines configurations of objects and properties.
QStringList keyBindings(int actionIndex)
bool doAction(int action, int child, const QVariantList &params)
Reimplemented Function
int childCount() const
Returns the number of children that belong to this object.
The QAccessibleSimpleEditableTextInterface class is a convenience class for text-based widgets...
Definition: qaccessible2.h:176
The QAccessibleImageInterface class implements support for the IAccessibleImage interface.
Definition: qaccessible2.h:342
The QAccessibleToolButton class implements the QAccessibleInterface for tool buttons.
Definition: simplewidgets.h:85
QString name(int actionIndex)
QVariant invokeMethodEx(Method method, int child, const QVariantList &params)
The QAccessibleTextInterface class implements support for the IAccessibleText interface.
Definition: qaccessible2.h:132
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
The QAccessibleActionInterface class implements support for the IAccessibleAction interface...
Definition: qaccessible2.h:329
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QString localizedName(int actionIndex)
QString actionText(int action, Text text, int child) const
Reimplemented Function
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void setCurrentValue(const QVariant &)
The QLineEdit widget is a one-line text editor.
Definition: qlineedit.h:66
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QString description(int actionIndex)
The QAccessibleValueInterface class implements support for the IAccessibleValue interface.
Definition: qaccessible2.h:193
The QToolButton class provides a quick-access button to commands or options, usually used inside a QT...
Definition: qtoolbutton.h:59
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
ToolButtonElements
This enum identifies the components of the tool button.
Definition: simplewidgets.h:90
#define Q_DECLARE_TR_FUNCTIONS(context)
The Q_DECLARE_TR_FUNCTIONS() macro declares and implements two translation functions, tr() and trUtf8(), with these signatures:
The Text item allows you to add formatted text to a scene.