| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/accessible/qaccessibleobject.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | class QAccessibleObjectPrivate | - | ||||||||||||
| 9 | { | - | ||||||||||||
| 10 | public: | - | ||||||||||||
| 11 | QPointer<QObject> object; | - | ||||||||||||
| 12 | }; | - | ||||||||||||
| 13 | QAccessibleObject::QAccessibleObject(QObject *object) | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | d = new QAccessibleObjectPrivate; | - | ||||||||||||
| 16 | d->object = object; | - | ||||||||||||
| 17 | } never executed: end of block | 0 | ||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | - | |||||||||||||
| 24 | - | |||||||||||||
| 25 | QAccessibleObject::~QAccessibleObject() | - | ||||||||||||
| 26 | { | - | ||||||||||||
| 27 | delete d; | - | ||||||||||||
| 28 | } never executed: end of block | 0 | ||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | - | |||||||||||||
| 33 | QObject *QAccessibleObject::object() const | - | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | return never executed: d->object;return d->object;never executed: return d->object; | 0 | ||||||||||||
| 36 | } | - | ||||||||||||
| 37 | - | |||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | - | |||||||||||||
| 41 | bool QAccessibleObject::isValid() const | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | return never executed: !d->object.isNull();return !d->object.isNull();never executed: return !d->object.isNull(); | 0 | ||||||||||||
| 44 | } | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | - | |||||||||||||
| 47 | QRect QAccessibleObject::rect() const | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||
| 50 | } | - | ||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| 53 | void QAccessibleObject::setText(QAccessible::Text, const QString &) | - | ||||||||||||
| 54 | { | - | ||||||||||||
| 55 | } | - | ||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const | - | ||||||||||||
| 59 | { | - | ||||||||||||
| 60 | for (int i = 0; i < childCount()
| 0 | ||||||||||||
| 61 | QAccessibleInterface *childIface = child(i); | - | ||||||||||||
| 62 | ((!(childIface)) ? qt_assert("childIface",__FILE__,127) : qt_noop()); | - | ||||||||||||
| 63 | if (childIface->rect().contains(x,y)
| 0 | ||||||||||||
| 64 | return never executed: childIface;return childIface;never executed: return childIface; | 0 | ||||||||||||
| 65 | } never executed: end of block | 0 | ||||||||||||
| 66 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 67 | } | - | ||||||||||||
| 68 | QAccessibleApplication::QAccessibleApplication() | - | ||||||||||||
| 69 | : QAccessibleObject((static_cast<QGuiApplication *>(QCoreApplication::instance()))) | - | ||||||||||||
| 70 | { | - | ||||||||||||
| 71 | } never executed: end of block | 0 | ||||||||||||
| 72 | - | |||||||||||||
| 73 | QWindow *QAccessibleApplication::window() const | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | - | |||||||||||||
| 76 | - | |||||||||||||
| 77 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 78 | } | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | - | |||||||||||||
| 81 | static QObjectList topLevelObjects() | - | ||||||||||||
| 82 | { | - | ||||||||||||
| 83 | QObjectList list; | - | ||||||||||||
| 84 | const QWindowList tlw(QGuiApplication::topLevelWindows()); | - | ||||||||||||
| 85 | for (int i = 0; i < tlw.count()
| 0 | ||||||||||||
| 86 | QWindow *w = tlw.at(i); | - | ||||||||||||
| 87 | if (w->type() != Qt::Popup
| 0 | ||||||||||||
| 88 | if (QAccessibleInterface *root = w->accessibleRoot()
| 0 | ||||||||||||
| 89 | if (root->object()
| 0 | ||||||||||||
| 90 | list.append(root->object()); never executed: list.append(root->object()); | 0 | ||||||||||||
| 91 | } never executed: end of block | 0 | ||||||||||||
| 92 | } never executed: end of block | 0 | ||||||||||||
| 93 | } never executed: end of block | 0 | ||||||||||||
| 94 | - | |||||||||||||
| 95 | return never executed: list;return list;never executed: return list; | 0 | ||||||||||||
| 96 | } | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | - | |||||||||||||
| 99 | int QAccessibleApplication::childCount() const | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | return never executed: topLevelObjects().count();return topLevelObjects().count();never executed: return topLevelObjects().count(); | 0 | ||||||||||||
| 102 | } | - | ||||||||||||
| 103 | - | |||||||||||||
| 104 | - | |||||||||||||
| 105 | int QAccessibleApplication::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||
| 106 | { | - | ||||||||||||
| 107 | if (!child
| 0 | ||||||||||||
| 108 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||
| 109 | const QObjectList tlw(topLevelObjects()); | - | ||||||||||||
| 110 | return never executed: tlw.indexOf(child->object());return tlw.indexOf(child->object());never executed: return tlw.indexOf(child->object()); | 0 | ||||||||||||
| 111 | } | - | ||||||||||||
| 112 | - | |||||||||||||
| 113 | QAccessibleInterface *QAccessibleApplication::parent() const | - | ||||||||||||
| 114 | { | - | ||||||||||||
| 115 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 116 | } | - | ||||||||||||
| 117 | - | |||||||||||||
| 118 | QAccessibleInterface *QAccessibleApplication::child(int index) const | - | ||||||||||||
| 119 | { | - | ||||||||||||
| 120 | const QObjectList tlo(topLevelObjects()); | - | ||||||||||||
| 121 | if (index >= 0
| 0 | ||||||||||||
| 122 | return never executed: QAccessible::queryAccessibleInterface(tlo.at(index));return QAccessible::queryAccessibleInterface(tlo.at(index));never executed: return QAccessible::queryAccessibleInterface(tlo.at(index)); | 0 | ||||||||||||
| 123 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 124 | } | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | QAccessibleInterface *QAccessibleApplication::focusChild() const | - | ||||||||||||
| 129 | { | - | ||||||||||||
| 130 | if (QWindow *window = QGuiApplication::focusWindow()
| 0 | ||||||||||||
| 131 | return never executed: window->accessibleRoot();return window->accessibleRoot();never executed: return window->accessibleRoot(); | 0 | ||||||||||||
| 132 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 133 | } | - | ||||||||||||
| 134 | - | |||||||||||||
| 135 | - | |||||||||||||
| 136 | QString QAccessibleApplication::text(QAccessible::Text t) const | - | ||||||||||||
| 137 | { | - | ||||||||||||
| 138 | switch (t) { | - | ||||||||||||
| 139 | case never executed: QAccessible::Name:case QAccessible::Name:never executed: case QAccessible::Name: | 0 | ||||||||||||
| 140 | return never executed: QGuiApplication::applicationName();return QGuiApplication::applicationName();never executed: return QGuiApplication::applicationName(); | 0 | ||||||||||||
| 141 | case never executed: QAccessible::Description:case QAccessible::Description:never executed: case QAccessible::Description: | 0 | ||||||||||||
| 142 | return never executed: QGuiApplication::applicationFilePath();return QGuiApplication::applicationFilePath();never executed: return QGuiApplication::applicationFilePath(); | 0 | ||||||||||||
| 143 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 144 | break; never executed: break; | 0 | ||||||||||||
| 145 | } | - | ||||||||||||
| 146 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | - | |||||||||||||
| 150 | QAccessible::Role QAccessibleApplication::role() const | - | ||||||||||||
| 151 | { | - | ||||||||||||
| 152 | return never executed: QAccessible::Application;return QAccessible::Application;never executed: return QAccessible::Application; | 0 | ||||||||||||
| 153 | } | - | ||||||||||||
| 154 | - | |||||||||||||
| 155 | - | |||||||||||||
| 156 | QAccessible::State QAccessibleApplication::state() const | - | ||||||||||||
| 157 | { | - | ||||||||||||
| 158 | return never executed: QAccessible::State();return QAccessible::State();never executed: return QAccessible::State(); | 0 | ||||||||||||
| 159 | } | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | - | |||||||||||||
| 162 | - | |||||||||||||
| Switch to Source code | Preprocessed file |