/usr/include/qaccessibilityclient/accessibleobject.h is in libqaccessibilityclient-dev 0+git20140203-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | /*
Copyright 2012 Frederik Gladhorn <gladhorn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QACCESSIBILITYCLIENT_ACCESSIBLEOBJECT_H
#define QACCESSIBILITYCLIENT_ACCESSIBLEOBJECT_H
#include <QtGlobal>
namespace QAccessibleClient {
class AccessibleObject;
}
uint qHash(const QAccessibleClient::AccessibleObject& object);
#include <qlist.h>
#include <QSharedPointer>
#include <qaction.h>
#include "qaccessibilityclient_export.h"
namespace QAccessibleClient {
class AccessibleObjectPrivate;
class RegistryPrivate;
/**
This class represents an accessible object.
An accessible object equals usually a visible widget or some kind
of other element the user can interact with but can also present
a not visible object that offers certain functionality like for
example actions which can be triggered.
It is implicitly shared and only created by the library.
*/
class QACCESSIBILITYCLIENT_EXPORT AccessibleObject
{
public:
/**
This enum describes the different interfaces that an
AccessibleObject can implement.
Each AccessibleObject must implement the AccessibleInterface, otherwise
it is invalid. All other interfaces are optional.
If the ActionInterface is implement the object
will have a list of actions that can be invoked.
*/
enum Interface {
NoInterface = 0x0,
AccessibleInterface = 0x1,
CacheInterface = 0x2,
ActionInterface = 0x4,
ApplicationInterface = 0x8,
CollectionInterface = 0x10,
ComponentInterface = 0x20,
DocumentInterface = 0x40,
EditableTextInterface = 0x80,
EventKeyboardInterface = 0x100,
EventMouseInterface = 0x200,
EventObjectInterface = 0x400,
HyperlinkInterface = 0x800,
HypertextInterface = 0x1000,
ImageInterface = 0x2000,
SelectionInterface = 0x4000,
TableInterface = 0x8000,
TextInterface = 0x10000,
ValueInterface = 0x20000,
SocketInterface = 0x40000,
EventWindowInterface = 0x80000,
EventFocusInterface = 0x100000
};
Q_DECLARE_FLAGS(Interfaces, Interface)
/**
The role indicates the type of UI element that an AccessibleObject
represents.
*/
enum Role {
NoRole, /*!< The object is invalid and has no role set. This is generally a bug. */
CheckBox,
CheckableMenuItem,
ColumnHeader,
ComboBox,
DesktopFrame,
Dial,
Dialog,
Filler,
Frame,
Icon,
Label,
ListView,
ListItem,
Menu,
MenuBar,
MenuItem,
Tab,
TabContainer,
PasswordText,
PopupMenu,
ProgressBar,
Button,
RadioButton,
RadioMenuItem,
RowHeader,
ScrollBar,
ScrollArea,
Separator,
Slider,
SpinButton,
StatusBar,
TableView,
TableCell,
TableColumnHeader,
TableColumn,
TableRowHeader,
TableRow,
Terminal,
Text,
ToggleButton,
ToolBar,
ToolTip,
TreeView,
Window,
TreeItem
// Roles in Qt, I don't think we want those
// TitleBar = 0x00000001,
// Grip = 0x00000004,
// Sound = 0x00000005,
// Cursor = 0x00000006,
// Caret = 0x00000007,
// AlertMessage = 0x00000008,
// Client = 0x0000000A,
// Application = 0x0000000E,
// Document = 0x0000000F,
// Pane = 0x00000010,
// Chart = 0x00000011,
// Border = 0x00000013,
// Grouping = 0x00000014,
// Cell = 0x0000001D,
// Link = 0x0000001E,
// HelpBalloon = 0x0000001F,
// Assistant = 0x00000020,
// PageTab = 0x00000025,
// PropertyPage = 0x00000026,
// Indicator = 0x00000027,
// Graphic = 0x00000028,
// StaticText = 0x00000029,
// EditableText = 0x0000002A, // Editable, selectable, etc.
// HotkeyField = 0x00000032,
// SpinBox = 0x00000034,
// Canvas = 0x00000035,
// Animation = 0x00000036,
// Equation = 0x00000037,
// ButtonDropDown = 0x00000038,
// ButtonMenu = 0x00000039,
// ButtonDropGrid = 0x0000003A,
// Whitespace = 0x0000003B,
// PageTabList = 0x0000003C,
// Clock = 0x0000003D,
// Splitter = 0x0000003E,
// LayeredPane = 0x00000080,
};
/**
\brief Construct an invalid AccessibleObject.
*/
AccessibleObject();
/**
\brief Copy constructor.
*/
AccessibleObject(const AccessibleObject &other);
/**
Destroys the AccessibleObject
*/
~AccessibleObject();
/**
Assignment operator
*/
AccessibleObject &operator=(const AccessibleObject &other);
/**
Comparison operator
*/
bool operator==(const AccessibleObject &other) const;
/**
Inequality operator
*/
inline bool operator!=(const AccessibleObject &other) const {
return !operator==(other);
}
/**
\brief Returns a unique identifier for the object.
*/
QString id() const;
/**
\brief Returns a QUrl that references the AccessibleObject.
This can be used to serialize/unserialize an AccessibleObject
to pass it around as string and restore the AccessibleObject
by using Registry::accessibleFromUrl later on.
The returned QUrl returns a scheme of "accessibleobject", the
dbus path as url path and the dbus service as url fragment.
*/
QUrl url() const;
/**
\brief Returns true if this object is valid.
Invalid objects are for example returned when asking for the
parent of the top most item, or for a child that is out of range.
*/
bool isValid() const;
/**
\brief Returns this object's parent.
\return The parent AccessibleObject
*/
AccessibleObject parent() const;
/**
\brief Returns this accessible's index in it's parent's list of children.
\return index
*/
int indexInParent() const;
/**
\brief Returns this accessible's children in a list.
\return children
*/
QList<AccessibleObject> children() const;
/**
\brief Returns this accessible's children according to there roles.
\param roles The list of roles to query.
\return A vector that contains the children of this object according
to there roles. The number of vector-items equals to the number and
sorting of the roles items. Example code demonstrating usage:
\code
QList<Role> roles;
roles << Label << CheckBox;
QVector< QList<AccessibleObject> > c = children(roles);
Q_ASSERT(c.count() == roles.count());
Q_ASSERT(c[0].isEmpty() || c[0].first().role() == Label);
Q_ASSERT(c[1].isEmpty() || c[1].first().role() == CheckBox);
\endcode
*/
QVector< QList<AccessibleObject> > children(const QList<Role> &roles) const;
/**
\brief Returns the number of children for this accessible.
\return number of children
*/
int childCount() const;
/**
\brief Returns a specific child at position \a index.
The list of children is 0-based.
\return number of children
*/
AccessibleObject child(int index) const;
/**
\brief Returns the name of this accessible.
The name is a short descriptive one or two words.
It is localized.
*/
QString name() const;
/**
\brief Returns the description for this accessible.
The description is more of an explanation than the name.
This can be a sentence. The string is localized.
*/
QString description() const;
/**
\brief Returns the role as integer value of this accessible.
*/
Role role() const;
/**
\brief Returns the name of the role of this accessible.
This name is not localized to allow tools to work with the english string.
*/
QString roleName() const;
/**
\brief Returns the name of the role of this accessible.
This name is localized and can be presented to the user.
*/
QString localizedRoleName() const;
/**
\brief The ComponentLayer in which this object resides.
*/
int layer() const;
/**
\brief Obtain the relative stacking order (i.e. 'Z' order) of an object.
Larger values indicate that an object is on "top" of the stack, therefore
objects with smaller MDIZOrder may be obscured by objects with a larger
MDIZOrder, but not vice-versa.
*/
int mdiZOrder() const;
/**
\brief Obtain the alpha value of the component.
An alpha value of 1.0 or greater indicates that the object is fully opaque,
and an alpha value of 0.0 indicates that the object is fully transparent.
Negative alpha values have no defined meaning at this time.
Alpha values are used in conjunction with Z-order calculations to determine
whether an object wholly or partially obscures another object's visual
intersection, in the event that their bounds intersect.
*/
double alpha() const;
/**
\brief Returns a bounding rectangle for the accessible.
It returns a QRect that bounds the accessible. This can be used to get the focus coordinates.
\return QRect that bounds the accessible.
*/
QRect boundingRect() const;
/**
\brief Returns a bounding rectangle for the character at position \a offset.
This function is only supported for accessibles that implement the text interface.
It will return an empty rectangle for invalid offsets or accessibles.
\return QRect that bounds the character.
*/
QRect characterRect(int offset) const;
/**
\brief Returns List of interfaces supported by the accessible.
This function provides a list of accessibile interfaces that are implemented
by an accessible object. This can be used to avoid calling functions that
are not supported by the accessible.
\return QStringList that contains list of supported interfaces
*/
Interfaces supportedInterfaces() const;
/**
\brief Returns the offset of the caret from the beginning of the text.
This function provides the current offset of the caret from the beginning of
the text in an accessible that implements org.a11y.atspi.Text.
\return Caret Offset as an integer
*/
int caretOffset() const;
/**
\brief Returns the number of characters.
\return Number of characters.
*/
int characterCount() const;
/**
\brief Returns a list of selections the text has.
Code to demonstrate usage:
\code
QList< QPair<int,int> > sel = acc.textSelections();
int startOffset = sel[0].first;
int endOffset = sel[0].second;
QString allText = acc.text();
QString selText = allText.mid(startOffset, endOffset - startOffset);
\endcode
\return The list of selections where every item in that list
is a pair of integers representing startOffset and endOffset
of the selection.
*/
QList< QPair<int,int> > textSelections() const;
/**
Set text \a selections, usually only one selection will be set,
use a list containing one QPair with the start and end offsets for that.
*/
void setTextSelections(const QList< QPair<int,int> > &selections);
/**
\brief Returns the text of the TextInterface.
This function provides the current text as displayed by the
org.a11y.atspi.Text TextInterface component.
\param startOffset The start caret offset to return the text from.
\param endOffset The end caret offset to return the text from. If -1
then the endOffset is the end of the string what means all characters
are included.
\return The text as displayed by the TextInterface.
*/
QString text(int startOffset = 0, int endOffset = -1) const;
/**
\brief Set the text of the EditableTextInterface.
\param text The text to set.
\return true on success and false on error.
*/
bool setText(const QString &text);
/**
\brief Insert the text into the EditableTextInterface.
\param text The text to insert.
\param position The caret position at which to insert the text.
\param length The length of the text to insert.
\return true on success and false on error.
*/
bool insertText(const QString &text, int position = 0, int length = -1);
/**
\brief Copy the text from the EditableTextInterface into the clipboard.
\param startPos The caret position from which to start to copy the text from.
\param endPos The caret position from which to end to copy the text from.
\return true on success and false on error.
*/
bool copyText(int startPos, int endPos);
/**
\brief Cut the text from the EditableTextInterface into the clipboard.
\param startPos The caret position from which to start to cut the text from.
\param endPos The caret position from which to end to cut the text from.
\return true on success and false on error.
*/
bool cutText(int startPos, int endPos);
/**
\brief Delete the text from the EditableTextInterface.
\param startPos The caret position from which to start to delete the text.
\param endPos The caret position from which to end to delete the text.
\return true on success and false on error.
*/
bool deleteText(int startPos, int endPos);
/**
\brief Paste the text from the clipboard into the EditableTextInterface.
\param position The caret position at which to insert the text into.
\return true on success and false on error.
*/
bool pasteText(int position);
/**
\brief Returns focus-point of the object
\return The Focus Point of the object
*/
QPoint focusPoint() const;
/**
\brief Returns the application object.
\return The top-level application object that expose an
org.a11y.atspi.Application accessibility interface.
*/
AccessibleObject application() const;
/**
\brief Returns the toolkit name.
\return The tookit name. This can be for example "Qt"
or "gtk".
*/
QString appToolkitName() const;
/**
\brief Returns the toolkit version.
\return The tookit version. This can be for example "4.8.3"
for Qt 4.8.3.
*/
QString appVersion() const;
/**
\brief Returns the unique application identifier.
\return The app id. The identifier will not last over session
and everytime the app quits and restarts it gets another
identifier that persists as long as the application is running.
*/
int appId() const;
/**
The type of locale
*/
enum LocaleType {
LocaleTypeMessages,
LocaleTypeCollate,
LocaleTypeCType,
LocaleTypeMonetary,
LocaleTypeNumeric,
LocaleTypeTime
};
/**
\brief The application locale.
\param lctype The \a LocaleType for which the locale is queried.
\return A string compliant with the POSIX standard for locale description.
*/
QString appLocale(LocaleType lctype = LocaleTypeMessages) const;
/**
\brief The application dbus address.
*/
QString appBusAddress() const;
/**
\brief The minimum value allowed by this valuator.
If both, the \a minimumValue and \a maximumValue, are zero then
there is no minimum or maximum values. The \a currentValue has
no range restrictions.
*/
double minimumValue() const;
/**
\brief The maximum value allowed by this valuator.
If both, the \a minimumValue and \a maximumValue, are zero then
there is no minimum or maximum values. The \a currentValue has
no range restrictions.
*/
double maximumValue() const;
/**
\brief The smallest incremental change which this valuator allows.
This is a helper value to know in what steps the \a currentValue
is incremented or decremented.
If 0, the incremental changes to the valuator are limited only by
the precision of a double precision value on the platform.
*/
double minimumValueIncrement() const;
/**
\brief The current value of the valuator.
This is the value the org.a11y.atspi.Value accessibility interface has.
*/
double currentValue() const;
/**
\brief Returns the selection of accessible objects.
*/
QList<AccessibleObject> selection() const;
/**
\brief A description text of the image.
It is recommended that imageDescription be the shorter of the available image
descriptions, for instance "alt text" in HTML images, and a longer description
be provided in Accessible::accessible-description, if available. A short, one
or two word label for the image should be provided in Accessible::accessible-name.
\return A UTF-8 string providing a textual description of what is visually
depicted in the image.
*/
QString imageDescription() const;
/**
\brief The locale of the image.
\return A string corresponding to the POSIX LC_MESSAGES locale used by the
imageDescription.
*/
QString imageLocale() const;
/**
\brief The image boundaries.
Obtain a bounding box which entirely contains the image contents, as
displayed on screen.
The bounds returned do not account for any viewport clipping or the fact that
the image may be partially or wholly obscured by other onscreen content.
This method returns the bounds of the current onscreen view, and not the
nominal size of the source data in the event that the original image has
been rescaled.\
\return A BoundingBox enclosing the image's onscreen representation.
*/
QRect imageRect() const;
/**
\brief Returns a list of actions supported by this accessible.
Just trigger() the action to execute the underlying method at the accessible.
*/
QVector< QSharedPointer<QAction> > actions() const;
// states
/// Returns if the AccessibleObject is currently active
bool isActive() const;
/// Returns if the AccessibleObject is checkable (often indicates a check action)
bool isCheckable() const;
/// Returns if the AccessibleObject is currently checked
bool isChecked() const;
/// Returns if the AccessibleObject is defunct - that means it does not properly respont to requests
/// and should be ignored for accessibility purposes
bool isDefunct() const;
/// Returns if the AccessibleObject is an editable text
bool isEditable() const;
/// Returns if the AccessibleObject is currently enabled
bool isEnabled() const;
/// Returns if the AccessibleObject can be expanded to show more information
bool isExpandable() const;
/// Returns if the AccessibleObject is currently expanded
bool isExpanded() const;
/// Returns if the AccessibleObject is focusable
bool isFocusable() const;
/// Returns if the AccessibleObject is currently focused
bool isFocused() const;
/// Returns if the AccessibleObject is a multi line text edit
bool isMultiLine() const;
/// Returns if the AccessibleObject is selectable
bool isSelectable() const;
/// Returns if the AccessibleObject is currently selected
bool isSelected() const;
/// Returns if the AccessibleObject reacts to input events
bool isSensitive() const;
/// Returns if the AccessibleObject is a single line text edit
bool isSingleLine() const;
/*
* \internal
* \brief isTransient marks an object as being unreliable in that it can quickly disappear or change
*
* This is mostly a hint that the object should not be cached.
* \return true if the object is transient
*/
// bool isTransient() const;
/// Returns if the AccessibleObject is currently visible (it can still be off the screen,
/// but there is nothing preventing the user from seeing it in general)
bool isVisible() const;
/*
* \internal
* \brief managesDescendants marks an object as being responsible for its children
*
* This is to notify that this object handles signals for it's children.
* The property is typically used for tables and lists or other collection objects.
* \return true if the object is transient
*/
// bool managesDescendants() const;
// bool isRequired() const;
// bool isAnimated() const;
// bool isInvalidEntry() const;
/// Returns if the AccessibleObject is the default widget (e.g. a button in a dialog)
bool isDefault() const;
// bool isVisited() const;
/// Returns if the AccessibleObject allows text selections
bool hasSelectableText() const;
/// Returns if the AccessibleObject has a tool tip
bool hasToolTip() const;
/// Returns if the AccessibleObject supports automatic text completion
bool supportsAutocompletion() const;
private:
AccessibleObject(RegistryPrivate *reg, const QString &service, const QString &path);
AccessibleObject(const QSharedPointer<AccessibleObjectPrivate> &dd);
QSharedPointer<AccessibleObjectPrivate> d;
friend class Registry;
friend class RegistryPrivate;
friend class CacheWeakStrategy;
friend class CacheStrongStrategy;
friend QDebug QAccessibleClient::operator<<(QDebug, const AccessibleObject &);
friend uint ::qHash(const AccessibleObject& object);
};
#ifndef QT_NO_DEBUG_STREAM
QACCESSIBILITYCLIENT_EXPORT QDebug operator<<(QDebug, const AccessibleObject &);
#endif
}
Q_DECLARE_METATYPE(QAccessibleClient::AccessibleObject)
#endif
|