summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-06 15:50:18 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-13 09:07:15 +0200
commitd2c1a6cbb459a2271ae92ddcbca507f4ccd3a863 (patch)
tree3596f05397d51bb9e2090e474d6845d3c72ef3fe
parentfc36b834a6504b2c64c1a1a357edc5e84609389d (diff)
Add accessible roles
Change-Id: Ic5465687f51c441235ec23cb88045e14644f1d2a Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
-rw-r--r--src/gui/accessible/qaccessible.cpp6
-rw-r--r--src/gui/accessible/qaccessible.h51
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp12
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm6
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp7
5 files changed, 81 insertions, 1 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 1aca51741e..c01834a744 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -319,9 +319,11 @@ QT_BEGIN_NAMESPACE
\value CheckBox An object that represents an option that can be checked or unchecked. Some options provide a "mixed" state, e.g. neither checked nor unchecked.
\value Client The client area in a window.
\value Clock A clock displaying time.
+ \value ColorChooser A dialog that lets the user choose a color.
\value Column A column of cells, usually within a table.
\value ColumnHeader A header for a column of data.
\value ComboBox A list of choices that the user can select from.
+ \value ComplementaryContent A part of the document or web page that is complementary to the main content, usually a landmark (see WAI-ARIA).
\value Cursor An object that represents the mouse cursor.
\value Desktop The object represents the desktop or workspace.
\value Dial An object that represents a dial or knob.
@@ -329,9 +331,12 @@ QT_BEGIN_NAMESPACE
\value Document A document, for example in an office application.
\value EditableText Editable text such as a line or text edit.
\value Equation An object that represents a mathematical equation.
+ \value Footer A footer in a page (usually in documents).
+ \value Form A web form containing controls.
\value Graphic A graphic or picture, e.g. an icon.
\value Grip A grip that the user can drag to change the size of widgets.
\value Grouping An object that represents a logical grouping of other objects.
+ \value Heading A heading in a document.
\value HelpBalloon An object that displays help in a separate, short lived window.
\value HotkeyField A hotkey field that allows the user to enter a key sequence.
\value Indicator An indicator that represents a current value or item.
@@ -342,6 +347,7 @@ QT_BEGIN_NAMESPACE
\value MenuBar A menu bar from which menus are opened by the user.
\value MenuItem An item in a menu or menu bar.
\value NoRole The object has no role. This usually indicates an invalid object.
+ \value Note A section whose content is parenthetic or ancillary to the main content of the resource.
\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).
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index d940713a35..4fe43f982a 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -280,7 +280,7 @@ public:
HotkeyField = 0x00000032,
Slider = 0x00000033,
SpinBox = 0x00000034,
- Canvas = 0x00000035,
+ Canvas = 0x00000035, // Diagram for MSAA
Animation = 0x00000036,
Equation = 0x00000037,
ButtonDropDown = 0x00000038, // The object represents a button that expands a grid.
@@ -299,6 +299,55 @@ public:
Paragraph = 0x00000083,
WebDocument = 0x00000084,
Section = 0x00000085,
+
+ // IAccessible2 roles
+ // IA2_ROLE_CANVAS = 0x401, ### Qt 6 use this one instead of Canvas above
+ // IA2_ROLE_CAPTION = 0x402,
+ // IA2_ROLE_CHECK_MENU_ITEM = 0x403,
+ ColorChooser = 0x404,
+ // IA2_ROLE_DATE_EDITOR = 0x405,
+ // IA2_ROLE_DESKTOP_ICON = 0x406,
+ // IA2_ROLE_DESKTOP_PANE = 0x407,
+ // IA2_ROLE_DIRECTORY_PANE = 0x408,
+ // IA2_ROLE_EDITBAR = 0x409,
+ // IA2_ROLE_EMBEDDED_OBJECT = 0x40A,
+ // IA2_ROLE_ENDNOTE = 0x40B,
+ // IA2_ROLE_FILE_CHOOSER = 0x40C,
+ // IA2_ROLE_FONT_CHOOSER = 0x40D,
+ Footer = 0x40E,
+ // IA2_ROLE_FOOTNOTE = 0x40F,
+ Form = 0x410,
+ // some platforms (windows and at-spi) use Frame for regular windows
+ // because window was taken for tool/dock windows by MSAA
+ // Frame = 0x411,
+ // IA2_ROLE_GLASS_PANE = 0x412,
+ // IA2_ROLE_HEADER = 0x413,
+ Heading = 0x414,
+ // IA2_ROLE_ICON = 0x415,
+ // IA2_ROLE_IMAGE_MAP = 0x416,
+ // IA2_ROLE_INPUT_METHOD_WINDOW = 0x417,
+ // IA2_ROLE_INTERNAL_FRAME = 0x418,
+ // IA2_ROLE_LABEL = 0x419,
+ // IA2_ROLE_LAYERED_PANE = 0x41A,
+ Note = 0x41B,
+ // IA2_ROLE_OPTION_PANE = 0x41C,
+ // IA2_ROLE_PAGE = 0x41D,
+ // IA2_ROLE_PARAGRAPH = 0x42E,
+ // IA2_ROLE_RADIO_MENU_ITEM = 0x41F,
+ // IA2_ROLE_REDUNDANT_OBJECT = 0x420,
+ // IA2_ROLE_ROOT_PANE = 0x421,
+ // IA2_ROLE_RULER = 0x422,
+ // IA2_ROLE_SCROLL_PANE = 0x423,
+ // IA2_ROLE_SECTION = 0x424,
+ // IA2_ROLE_SHAPE = 0x425,
+ // IA2_ROLE_SPLIT_PANE = 0x426,
+ // IA2_ROLE_TEAR_OFF_MENU = 0x427,
+ // IA2_ROLE_TERMINAL = 0x428,
+ // IA2_ROLE_TEXT_FRAME = 0x429,
+ // IA2_ROLE_TOGGLE_BUTTON = 0x42A,
+ // IA2_ROLE_VIEW_PORT = 0x42B,
+ ComplementaryContent = 0x42C,
+
UserRole = 0x0000ffff
};
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index 3a1e3e0ce0..bfa92609a1 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -250,6 +250,18 @@ static RoleMapping map[] = {
//: Role of an accessible object
{ QAccessible::Section, ATSPI_ROLE_SECTION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "section") },
//: Role of an accessible object
+ { QAccessible::ColorChooser, ATSPI_ROLE_COLOR_CHOOSER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "color chooser") },
+ //: Role of an accessible object
+ { QAccessible::Footer, ATSPI_ROLE_FOOTER, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "footer") },
+ //: Role of an accessible object
+ { QAccessible::Form, ATSPI_ROLE_FORM, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "form") },
+ //: Role of an accessible object
+ { QAccessible::Heading, ATSPI_ROLE_HEADING, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "heading") },
+ //: Role of an accessible object
+ { QAccessible::Note, ATSPI_ROLE_COMMENT, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "note") },
+ //: Role of an accessible object
+ { QAccessible::ComplementaryContent, ATSPI_ROLE_SECTION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "complementary content") },
+ //: Role of an accessible object
{ QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") }
};
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 8f83b0fe30..204e0ed98b 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -152,6 +152,12 @@ static void populateRoleMap()
roleMap[QAccessible::Paragraph] = NSAccessibilityGroupRole;
roleMap[QAccessible::Section] = NSAccessibilityGroupRole;
roleMap[QAccessible::WebDocument] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::ColorChooser] = NSAccessibilityColorWellRole;
+ roleMap[QAccessible::Footer] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::Form] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::Heading] = @"AXHeading";
+ roleMap[QAccessible::Note] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::ComplementaryContent] = NSAccessibilityGroupRole;
}
/*
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
index 20658f9cad..dcb137c09e 100644
--- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp
+++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
@@ -1706,6 +1706,13 @@ QByteArray QWindowsIA2Accessible::IIDToString(REFIID id)
return strGuid;
}
+// Q_STATIC_ASSERT(IA2_ROLE_CANVAS == QAccessible::Canvas); // ### Qt 6: make them the same
+Q_STATIC_ASSERT(IA2_ROLE_COLOR_CHOOSER == QAccessible::ColorChooser);
+Q_STATIC_ASSERT(IA2_ROLE_FOOTER == QAccessible::Footer);
+Q_STATIC_ASSERT(IA2_ROLE_FORM == QAccessible::Form);
+Q_STATIC_ASSERT(IA2_ROLE_HEADING == QAccessible::Heading);
+Q_STATIC_ASSERT(IA2_ROLE_NOTE == QAccessible::Note);
+Q_STATIC_ASSERT(IA2_ROLE_COMPLEMENTARY_CONTENT == QAccessible::ComplementaryContent);
QT_END_NAMESPACE