Add accessible roles for web document, paragraph and section

These roles seem wide-spread enough that it makes sense to add them.
QtWebEngine will use them.

Change-Id: I9c2d6ab23ada0607078bcd407a72ecae9f87eeea
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
This commit is contained in:
Frederik Gladhorn 2014-07-14 15:33:59 +02:00
parent 5ef0ad07c1
commit 27dcba8760
6 changed files with 19 additions and 0 deletions

View File

@ -344,6 +344,7 @@ QT_BEGIN_NAMESPACE
\value NoRole The object has no role. This usually indicates an invalid object.
\value PageTab A page tab that the user can select to switch to a different page in a dialog.
\value PageTabList A list of page tabs.
\value Paragraph A paragraph of text (usually found in documents).
\value Pane A generic container.
\value PopupMenu A menu which lists options that the user can select to perform an action.
\value ProgressBar The object displays the progress of an operation in progress.
@ -353,6 +354,7 @@ QT_BEGIN_NAMESPACE
\value Row A row of cells, usually within a table.
\value RowHeader A header for a row of data.
\value ScrollBar A scroll bar, which allows the user to scroll the visible area.
\value Section A section (in a document).
\value Separator A separator that divides space into logical areas.
\value Slider A slider that allows the user to select a value within a given range.
\value Sound An object that represents a sound.
@ -368,6 +370,7 @@ QT_BEGIN_NAMESPACE
\value Tree A list of items in a tree structure.
\value TreeItem An item in a tree structure.
\value UserRole The first value to be used for user defined roles.
\value WebDocument HTML document, usually in a browser.
\value Whitespace Blank space between other objects.
\value Window A top level window.
*/

View File

@ -296,6 +296,9 @@ public:
LayeredPane = 0x00000080,
Terminal = 0x00000081,
Desktop = 0x00000082,
Paragraph = 0x00000083,
WebDocument = 0x00000084,
Section = 0x00000085,
UserRole = 0x0000ffff
};

View File

@ -244,6 +244,12 @@ static RoleMapping map[] = {
//: Role of an accessible object
{ QAccessible::LayeredPane, ATSPI_ROLE_LAYERED_PANE, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "layered pane") },
//: Role of an accessible object
{ QAccessible::WebDocument, ATSPI_ROLE_DOCUMENT_WEB, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "web document") },
//: Role of an accessible object
{ QAccessible::Paragraph, ATSPI_ROLE_PARAGRAPH, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "paragraph") },
//: Role of an accessible object
{ QAccessible::Section, ATSPI_ROLE_SECTION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "section") },
//: Role of an accessible object
{ QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") }
};

View File

@ -149,6 +149,9 @@ static void populateRoleMap()
roleMap[QAccessible::ListItem] = NSAccessibilityStaticTextRole;
roleMap[QAccessible::Cell] = NSAccessibilityStaticTextRole;
roleMap[QAccessible::Client] = NSAccessibilityGroupRole;
roleMap[QAccessible::Paragraph] = NSAccessibilityGroupRole;
roleMap[QAccessible::Section] = NSAccessibilityGroupRole;
roleMap[QAccessible::WebDocument] = NSAccessibilityGroupRole;
}
/*

View File

@ -358,6 +358,8 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::role(long *ia2role)
case QAccessible::LayeredPane: r = IA2_ROLE_LAYERED_PANE; break;
case QAccessible::Terminal: r = IA2_ROLE_TERMINAL; break;
case QAccessible::Desktop: r = IA2_ROLE_DESKTOP_PANE; break;
case QAccessible::Paragraph: r = IA2_ROLE_PARAGRAPH; break;
case QAccessible::Section: r = IA2_ROLE_SECTION; break;
default: break;
}

View File

@ -935,6 +935,8 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accRole(VARIANT varID, VAR
// does not support IAccessible2, since it should prefer IA2::role() then.
if (role == QAccessible::LayeredPane)
role = QAccessible::Pane;
else if (role == QAccessible::WebDocument)
role = QAccessible::Document;
else
role = QAccessible::Client;
}