Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qaccessiblequickitem_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QACCESSIBLEQUICKITEM_H
6
#
define
QACCESSIBLEQUICKITEM_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtQuick
/
QQuickItem
>
20
#
include
<
QtQuick
/
QQuickView
>
21
#
include
<
QtGui
/
qaccessibleobject
.
h
>
22
#
include
<
QtQuick
/
private
/
qtquickglobal_p
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
#
if
QT_CONFIG
(
accessibility
)
27
28
class
QTextDocument
;
29
30
class
Q_QUICK_EXPORT
QAccessibleQuickItem
:
public
QAccessibleObject
,
31
public
QAccessibleActionInterface
,
32
public
QAccessibleValueInterface
,
33
public
QAccessibleTextInterface
,
34
public
QAccessibleAttributesInterface
35
{
36
#
ifdef
Q_OS_INTEGRITY
37
// force instantiation to avoid error #2045
38
struct
error2045
:
QList
<
QAccessible
::
Attribute
> {};
39
#
endif
40
public
:
41
QAccessibleQuickItem
(
QQuickItem
*
item
);
42
43
bool
isValid
()
const
override
;
44
QWindow
*
window
()
const
override
;
45
46
QRect
rect
()
const
override
;
47
QRect
viewRect
()
const
;
48
49
bool
clipsChildren
()
const
;
50
QAccessibleInterface
*
childAt
(
int
x
,
int
y
)
const
override
;
51
52
QAccessibleInterface
*
parent
()
const
override
;
53
QAccessibleInterface
*
child
(
int
index
)
const
override
;
54
int
childCount
()
const
override
;
55
int
indexOfChild
(
const
QAccessibleInterface
*
iface
)
const
override
;
56
QList
<
QQuickItem
*>
childItems
()
const
;
57
58
QAccessible
::
State
state
()
const
override
;
59
QAccessible
::
Role
role
()
const
override
;
60
QString
text
(
QAccessible
::
Text
)
const
override
;
61
void
setText
(
QAccessible
::
Text
,
const
QString
&
text
)
override
;
62
63
bool
isAccessible
()
const
;
64
65
QList
<
std
::
pair
<
QAccessibleInterface
*,
QAccessible
::
Relation
>>
66
relations
(
QAccessible
::
Relation
match
=
QAccessible
::
AllRelations
)
const
override
;
67
68
// Action Interface
69
QStringList
actionNames
()
const
override
;
70
void
doAction
(
const
QString
&
actionName
)
override
;
71
QStringList
keyBindingsForAction
(
const
QString
&
actionName
)
const
override
;
72
73
// Value Interface
74
QVariant
currentValue
()
const
override
;
75
void
setCurrentValue
(
const
QVariant
&
value
)
override
;
76
QVariant
maximumValue
()
const
override
;
77
QVariant
minimumValue
()
const
override
;
78
QVariant
minimumStepSize
()
const
override
;
79
80
81
// Text Interface
82
void
selection
(
int
selectionIndex
,
int
*
startOffset
,
int
*
endOffset
)
const
override
;
83
int
selectionCount
()
const
override
;
84
void
addSelection
(
int
startOffset
,
int
endOffset
)
override
;
85
void
removeSelection
(
int
selectionIndex
)
override
;
86
void
setSelection
(
int
selectionIndex
,
int
startOffset
,
int
endOffset
)
override
;
87
88
// cursor
89
int
cursorPosition
()
const
override
;
90
void
setCursorPosition
(
int
position
)
override
;
91
92
// text
93
QString
text
(
int
startOffset
,
int
endOffset
)
const
override
;
94
QString
textBeforeOffset
(
int
offset
,
QAccessible
::
TextBoundaryType
boundaryType
,
95
int
*
startOffset
,
int
*
endOffset
)
const
override
;
96
QString
textAfterOffset
(
int
offset
,
QAccessible
::
TextBoundaryType
boundaryType
,
97
int
*
startOffset
,
int
*
endOffset
)
const
override
;
98
QString
textAtOffset
(
int
offset
,
QAccessible
::
TextBoundaryType
boundaryType
,
99
int
*
startOffset
,
int
*
endOffset
)
const
override
;
100
int
characterCount
()
const
override
;
101
102
// character <-> geometry
103
QRect
characterRect
(
int
/* offset */
)
const
override
{
return
QRect
(); }
104
int
offsetAtPoint
(
const
QPoint
&
/* point */
)
const
override
{
return
-1; }
105
106
void
scrollToSubstring
(
int
/* startIndex */
,
int
/* endIndex */
)
override
{}
107
QString
attributes
(
int
/* offset */
,
int
*
startOffset
,
int
*
endOffset
)
const
override
108
{ *
startOffset
= 0; *
endOffset
= 0;
return
QString
(); }
109
110
QTextDocument
*
textDocument
()
const
;
111
112
// QAccessibleAttributesInterface
113
QList
<
QAccessible
::
Attribute
>
attributeKeys
()
const
override
;
114
QVariant
attributeValue
(
QAccessible
::
Attribute
key
)
const
override
;
115
116
protected
:
117
QQuickItem
*
item
()
const
{
return
static_cast
<
QQuickItem
*>(
object
()); }
118
virtual
void
*
interface_cast
(
QAccessible
::
InterfaceType
t
)
override
;
119
120
private
:
121
// for Text nodes:
122
QTextDocument
*
m_doc
;
123
typedef
QHash
<
int
,
QAccessible
::
Id
>
ChildCache
;
124
mutable
ChildCache
m_childToId
;
125
126
};
127
128
QRect
itemScreenRect
(
QQuickItem
*
item
);
129
QList
<
QQuickItem
*>
accessibleUnignoredChildren
(
QQuickItem
*
item
,
bool
paintOrder
=
false
);
130
131
#
endif
// accessibility
132
133
QT_END_NAMESPACE
134
135
#
endif
// QACCESSIBLEQUICKITEM_H
QSqlRelationalDelegate
\inmodule QtSql
qtdeclarative
src
quick
accessible
qaccessiblequickitem_p.h
Generated on
for Qt by
1.16.1