diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /accessible/interfaces | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/interfaces')
41 files changed, 3882 insertions, 0 deletions
diff --git a/accessible/interfaces/ia2/IA2Typelib.idl b/accessible/interfaces/ia2/IA2Typelib.idl new file mode 100644 index 0000000000..71e759d4a2 --- /dev/null +++ b/accessible/interfaces/ia2/IA2Typelib.idl @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import "Accessible2.idl"; +import "Accessible2_2.idl"; +import "AccessibleAction.idl"; +import "AccessibleApplication.idl"; +import "AccessibleComponent.idl"; +import "AccessibleDocument.idl"; +import "AccessibleEditableText.idl"; +import "AccessibleEventId.idl"; +import "AccessibleHyperlink.idl"; +import "AccessibleHypertext.idl"; +import "AccessibleHypertext2.idl"; +import "AccessibleImage.idl"; +import "AccessibleRelation.idl"; +import "AccessibleRole.idl"; +import "AccessibleStates.idl"; +import "AccessibleTable.idl"; +import "AccessibleTable2.idl"; +import "AccessibleTableCell.idl"; +import "AccessibleText.idl"; +import "AccessibleText2.idl"; +import "AccessibleTextSelectionContainer.idl"; +import "AccessibleValue.idl"; +import "IA2CommonTypes.idl"; + +// We are explicitly using #include instead of import so that the imported +// IDL is treated as part of this IDL file. +#include "IA2TypeLibrary.idl" diff --git a/accessible/interfaces/ia2/moz.build b/accessible/interfaces/ia2/moz.build new file mode 100644 index 0000000000..9d39b2c1db --- /dev/null +++ b/accessible/interfaces/ia2/moz.build @@ -0,0 +1,92 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +midl_enums = [ + "AccessibleEventId", + "AccessibleRole", + "AccessibleStates", + "IA2CommonTypes", +] + +midl_interfaces = [ + "Accessible2", + "Accessible2_2", + "AccessibleAction", + "AccessibleApplication", + "AccessibleComponent", + "AccessibleDocument", + "AccessibleEditableText", + "AccessibleHyperlink", + "AccessibleHypertext", + "AccessibleHypertext2", + "AccessibleImage", + "AccessibleRelation", + "AccessibleTable", + "AccessibleTable2", + "AccessibleTableCell", + "AccessibleText", + "AccessibleText2", + "AccessibleTextSelectionContainer", + "AccessibleValue", +] + +for enum in midl_enums: + GeneratedFile( + enum + ".h", + inputs=["/other-licenses/ia2/" + enum + ".idl"], + script="/build/midl.py", + entry_point="midl", + flags=["-app_config", "-I", TOPSRCDIR + "/other-licenses/ia2"], + ) + + EXPORTS += ["!" + enum + ".h"] + +for iface in midl_interfaces: + GeneratedFile( + iface + ".h", + iface + "_p.c", + iface + "_i.c", + iface + "_dlldata.c", + inputs=["/other-licenses/ia2/" + iface + ".idl"], + script="/build/midl.py", + entry_point="midl", + flags=[ + "-app_config", + "-I", + TOPSRCDIR + "/other-licenses/ia2", + "-dlldata", + OBJDIR + "/" + iface + "_dlldata.c", + ], + ) + + EXPORTS += ["!" + iface + ".h", "!" + iface + "_i.c"] + + for p in [iface + "_p.c", iface + "_i.c"]: + SOURCES += ["!%s" % p] + + # Give some symbols a unique name in each translation unit, to avoid + # collisions caused by https://llvm.org/pr41817. + if CONFIG["CC_TYPE"] == "clang-cl": + SOURCES["!%s" % p].flags += [ + "-DObject_StubDesc=Object_StubDesc__%s" % p[:-2] + ] + SOURCES["!%s" % p].flags += [ + "-DUserMarshalRoutines=UserMarshalRoutines__%s" % p[:-2] + ] + +GeneratedFile( + "IA2Typelib.h", + "IA2Typelib_i.c", + "IA2Typelib.tlb", + inputs=["IA2Typelib.idl"], + script="/build/midl.py", + entry_point="midl", + flags=[ + "-app_config", + "-I", + TOPSRCDIR + "/other-licenses/ia2", + ], +) diff --git a/accessible/interfaces/moz.build b/accessible/interfaces/moz.build new file mode 100644 index 0000000000..cf568f1d18 --- /dev/null +++ b/accessible/interfaces/moz.build @@ -0,0 +1,45 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows" and CONFIG["COMPILE_ENVIRONMENT"]: + DIRS += ["msaa", "ia2"] + +if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": + XPIDL_SOURCES += ["nsIAccessibleMacInterface.idl"] + +XPIDL_SOURCES += [ + "nsIAccessibilityService.idl", + "nsIAccessible.idl", + "nsIAccessibleAnnouncementEvent.idl", + "nsIAccessibleApplication.idl", + "nsIAccessibleCaretMoveEvent.idl", + "nsIAccessibleDocument.idl", + "nsIAccessibleEditableText.idl", + "nsIAccessibleEvent.idl", + "nsIAccessibleHideEvent.idl", + "nsIAccessibleHyperLink.idl", + "nsIAccessibleHyperText.idl", + "nsIAccessibleImage.idl", + "nsIAccessibleObjectAttributeChangedEvent.idl", + "nsIAccessiblePivot.idl", + "nsIAccessibleRelation.idl", + "nsIAccessibleRole.idl", + "nsIAccessibleScrollingEvent.idl", + "nsIAccessibleSelectable.idl", + "nsIAccessibleStateChangeEvent.idl", + "nsIAccessibleStates.idl", + "nsIAccessibleTable.idl", + "nsIAccessibleTableChangeEvent.idl", + "nsIAccessibleText.idl", + "nsIAccessibleTextChangeEvent.idl", + "nsIAccessibleTextLeafRange.idl", + "nsIAccessibleTextRange.idl", + "nsIAccessibleTextSelectionChangeEvent.idl", + "nsIAccessibleTypes.idl", + "nsIAccessibleValue.idl", +] + +XPIDL_MODULE = "accessibility" diff --git a/accessible/interfaces/msaa/AccessibleMarshal.def b/accessible/interfaces/msaa/AccessibleMarshal.def new file mode 100644 index 0000000000..a4992db1d8 --- /dev/null +++ b/accessible/interfaces/msaa/AccessibleMarshal.def @@ -0,0 +1,11 @@ +;+# This Source Code Form is subject to the terms of the Mozilla Public +;+# License, v. 2.0. If a copy of the MPL was not distributed with this +;+# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +LIBRARY AccessibleMarshal.dll + +EXPORTS DllGetClassObject PRIVATE + DllCanUnloadNow PRIVATE + DllRegisterServer PRIVATE + DllUnregisterServer PRIVATE + diff --git a/accessible/interfaces/msaa/AccessibleMarshal.rc b/accessible/interfaces/msaa/AccessibleMarshal.rc new file mode 100644 index 0000000000..13db3a833f --- /dev/null +++ b/accessible/interfaces/msaa/AccessibleMarshal.rc @@ -0,0 +1,5 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +1 typelib ISimpleDOM.tlb diff --git a/accessible/interfaces/msaa/AccessibleMarshalThunk.c b/accessible/interfaces/msaa/AccessibleMarshalThunk.c new file mode 100644 index 0000000000..481223ed13 --- /dev/null +++ b/accessible/interfaces/msaa/AccessibleMarshalThunk.c @@ -0,0 +1,17 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "ISimpleDOM.h" + +HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Proxy( + ISimpleDOMNode* This, void** localInterface) { + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Stub( + ISimpleDOMNode* This, IUnknown** localInterface) { + return E_NOTIMPL; +} diff --git a/accessible/interfaces/msaa/ISimpleDOM.idl b/accessible/interfaces/msaa/ISimpleDOM.idl new file mode 100644 index 0000000000..4bd51b7f50 --- /dev/null +++ b/accessible/interfaces/msaa/ISimpleDOM.idl @@ -0,0 +1,22 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// We use #include instead of import here so that MIDL treats these files as +// part of the current file, thus forcing MIDL to generate proxy info for them. +#include "ISimpleDOMNode.idl" +#include "ISimpleDOMDocument.idl" +#include "ISimpleDOMText.idl" + +[ + uuid(a6245497-9c0b-4449-85a5-bd6ad07df8ea), + helpstring("ISimpleDOM Type Library") +] +library ISimpleDOM +{ + interface ISimpleDOMNode; + interface ISimpleDOMText; + interface ISimpleDOMDocument; +}; diff --git a/accessible/interfaces/msaa/ISimpleDOMDocument.idl b/accessible/interfaces/msaa/ISimpleDOMDocument.idl new file mode 100644 index 0000000000..3e9e007e73 --- /dev/null +++ b/accessible/interfaces/msaa/ISimpleDOMDocument.idl @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("//") +cpp_quote("// ISimpleDOMDocument") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("//") +cpp_quote("// get_URL(out] BSTR *url)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the internet URL associated with this document.") +cpp_quote("//") +cpp_quote("// get_title([out BSTR *title") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the document's title from the <TITLE> element") +cpp_quote("//") +cpp_quote("// get_mimeType([out BSTR *mimeType") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the registered mime type, such as text/html") +cpp_quote("//") +cpp_quote("// get_docType([out] BSTR *docType") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get doctype associated with the <!DOCTYPE ..> element") +cpp_quote("//") +cpp_quote("// get_nameSpaceURIForID([in] short nameSpaceID, [out] BSTR *nameSpaceURI)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Some of the methods for ISimpleDOMNode return a nameSpaceID (-1,0,1,2,3,....)") +cpp_quote("// This method returns the associated namespace URI for each ID.") +cpp_quote("//") +cpp_quote("// set_alternateViewMediaTypes([in] BSTR *commaSeparatedMediaType)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// For style property retrieval on nsISimpleDOMNode elements, ") +cpp_quote("// set the additional alternate media types that properties are available for.") +cpp_quote("// [in] BSTR *commaSeparatedMediaTypes is a comma separate list, for example \"aural, braille\".") +cpp_quote("// The alternate media properties are requested with nsISimpleDOMNode::get_computedStyle.") +cpp_quote("// Note: setting this value on a document will increase memory overhead, and may create a small delay.") +cpp_quote("//") +cpp_quote("// W3C media Types:") +cpp_quote("// * all: Suitable for all devices. ") +cpp_quote("// * aural: Intended for speech synthesizers. See the section on aural style sheets for details. ") +cpp_quote("// * braille: Intended for braille tactile feedback devices. ") +cpp_quote("// * embossed: Intended for paged braille printers. ") +cpp_quote("// * handheld: Intended for handheld devices - typically small screen, monochrome, limited bandwidth. ") +cpp_quote("// * print: Intended for paged, opaque material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media. ") +cpp_quote("// * projection: Intended for projected presentations, for example projectors or print to transparencies. Please consult the section on paged media for information about formatting issues that are specific to paged media. ") +cpp_quote("// * screen: Intended primarily for color computer screens. ") +cpp_quote("// * tty: intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the tty media type. ") +cpp_quote("// * tv: Intended for television-type devices - low resolution, color, limited-scrollability screens, sound") +cpp_quote("// * See latest W3C CSS specs for complete list of media types") +cpp_quote("//") +cpp_quote("//") +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("") +cpp_quote("") + +import "objidl.idl"; +import "oaidl.idl"; + +[object, uuid(0D68D6D0-D93D-4d08-A30D-F00DD1F45B24)] +interface ISimpleDOMDocument : IUnknown +{ + [propget] HRESULT URL( + [out, retval] BSTR * url + ); + [propget] HRESULT title( + [out, retval] BSTR * title + ); + [propget] HRESULT mimeType( + [out, retval] BSTR * mimeType + ); + [propget] HRESULT docType( + [out, retval] BSTR * docType + ); + [propget] HRESULT nameSpaceURIForID( + [in] short nameSpaceID, + [out, retval] BSTR * nameSpaceURI + ); + [propput] HRESULT alternateViewMediaTypes( + [in] BSTR * commaSeparatedMediaTypes + ); +} diff --git a/accessible/interfaces/msaa/ISimpleDOMNode.idl b/accessible/interfaces/msaa/ISimpleDOMNode.idl new file mode 100644 index 0000000000..860111e1ea --- /dev/null +++ b/accessible/interfaces/msaa/ISimpleDOMNode.idl @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("//") +cpp_quote("// ISimpleDOMNode") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// An interface that extends MSAA's IAccessible to provide readonly DOM node information via cross-process COM.") +cpp_quote("//") +cpp_quote("// get_nodeInfo(") +cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name") +cpp_quote("// /* [out] */ short *nameSpaceID,") +cpp_quote("// /* [out] */ BSTR *nodeValue, ") +cpp_quote("// /* [out] */ unsigned int *numChildren); ") +cpp_quote("// /* [out] */ unsigned int *uniqueID; // In Win32 accessible events we generate, the target's childID matches to this") +cpp_quote("// /* [out] */ unsigned short *nodeType,") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the basic information about a node.") +cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()") +cpp_quote("//") +cpp_quote("// get_attributes(") +cpp_quote("// /* [in] */ unsigned short maxAttribs,") +cpp_quote("// /* [out] */ unsigned short *numAttribs,") +cpp_quote("// /* [out] */ BSTR *attribNames,") +cpp_quote("// /* [out] */ short *nameSpaceID,") +cpp_quote("// /* [out] */ BSTR *attribValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each") +cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace") +cpp_quote("//") +cpp_quote("// get_attributesForNames(") +cpp_quote("// /* [in] */ unsigned short numAttribs,") +cpp_quote("// /* [in] */ BSTR *attribNames,") +cpp_quote("// /* [in] */ short *nameSpaceID,") +cpp_quote("// /* [out] */ BSTR *attribValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Takes 2 arrays - the attribute names and namespace IDs, and returns an array of corresponding values") +cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace") +cpp_quote("//") +cpp_quote("// computedStyle( ") +cpp_quote("// /* [in] */ unsigned short maxStyleProperties,") +cpp_quote("// /* [out] */ unsigned short *numStyleProperties, ") +cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes") +cpp_quote("// /* [out] */ BSTR *styleProperties, ") +cpp_quote("// /* [out] */ BSTR *styleValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns 2 arrays -- the style properties and their values") +cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") +cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") +cpp_quote("//") +cpp_quote("// computedStyleForProperties( ") +cpp_quote("// /* [in] */ unsigned short numStyleProperties, ") +cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes") +cpp_quote("// /* [in] */ BSTR *styleProperties, ") +cpp_quote("// /* [out] */ BSTR *styleValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Scroll the current view so that this dom node is visible.") +cpp_quote("// placeTopLeft=TRUE: scroll until the top left corner of the dom node is at the top left corner of the view.") +cpp_quote("// placeTopLeft=FALSE: scroll minimally to make the dom node visible. Don't scroll at all if already visible.") +cpp_quote("//") +cpp_quote("// scrollTo( ") +cpp_quote("// /* [in] */ boolean placeTopLeft); ") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns style property values for those properties in the styleProperties [in] array") +cpp_quote("// Returns 2 arrays -- the style properties and their values") +cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") +cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") +cpp_quote("//") +cpp_quote("// get_parentNode (/* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// get_firstChild (/* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// get_lastChild (/* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// get_previousSibling(/* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// get_nextSibling (/* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// get_childAt (/* [in] */ unsigned childIndex, /* [out] */ ISimpleDOMNode **newNodePtr);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// DOM navigation - get a different node.") +cpp_quote("//") +cpp_quote("// get_innerHTML(/* [out] */ BSTR *htmlText);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns HTML of this DOM node's subtree. Does not include the start and end tag for this node/element.") +cpp_quote("//") +cpp_quote("//") +cpp_quote("// get_localInterface(/* [out] */ void **localInterface);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Only available in Gecko's process") +cpp_quote("//") +cpp_quote("//") +cpp_quote("// get_language(/* [out] */ BSTR *htmlText);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns the computed language for this node, or empty string if unknown.") +cpp_quote("//") +cpp_quote("//") +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("") +cpp_quote("") + +import "objidl.idl"; +import "oaidl.idl"; + +[object, uuid(1814ceeb-49e2-407f-af99-fa755a7d2607)] +interface ISimpleDOMNode : IUnknown +{ + const unsigned short NODETYPE_ELEMENT = 1; + const unsigned short NODETYPE_ATTRIBUTE = 2; + const unsigned short NODETYPE_TEXT = 3; + const unsigned short NODETYPE_CDATA_SECTION = 4; + const unsigned short NODETYPE_ENTITY_REFERENCE = 5; + const unsigned short NODETYPE_ENTITY = 6; + const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7; + const unsigned short NODETYPE_COMMENT = 8; + const unsigned short NODETYPE_DOCUMENT = 9; + const unsigned short NODETYPE_DOCUMENT_TYPE = 10; + const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11; + const unsigned short NODETYPE_NOTATION = 12; + + [propget] HRESULT nodeInfo( + [out] BSTR *nodeName, // for performance returns NULL for text nodes (true nodeName would be "#text") + [out] short *nameSpaceID, + [out] BSTR *nodeValue, + [out] unsigned int *numChildren, + [out] unsigned int *uniqueID, // In Win32 accessible events we generate, the target's childID matches to this + [out, retval] unsigned short *nodeType + ); + + [propget] HRESULT attributes( + [in] unsigned short maxAttribs, + [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames, + [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID, + [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues, + [out, retval] unsigned short *numAttribs + ); + + [propget] HRESULT attributesForNames( + [in] unsigned short numAttribs, + [in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames, + [in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID, + [out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues + ); + + [propget] HRESULT computedStyle( + [in] unsigned short maxStyleProperties, + [in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes + [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties, + [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues, + [out, retval] unsigned short *numStyleProperties + ); + + [propget] HRESULT computedStyleForProperties( + [in] unsigned short numStyleProperties, + [in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes + [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties, + [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues + ); + + HRESULT scrollTo([in] boolean placeTopLeft); + + [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node); + [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node); + [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node); + [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node); + [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node); + [propget] HRESULT childAt([in] unsigned childIndex, + [out, retval] ISimpleDOMNode **node); + + [propget] HRESULT innerHTML([out, retval] BSTR *innerHTML); + + [propget, local] HRESULT localInterface([out][retval] void **localInterface); + + [propget, call_as(get_localInterface)] + HRESULT remoteLocalInterface([out][retval] IUnknown **localInterface); + + [propget] HRESULT language([out, retval] BSTR *language); +} diff --git a/accessible/interfaces/msaa/ISimpleDOMText.idl b/accessible/interfaces/msaa/ISimpleDOMText.idl new file mode 100644 index 0000000000..c203cf98c1 --- /dev/null +++ b/accessible/interfaces/msaa/ISimpleDOMText.idl @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import "objidl.idl"; +import "oaidl.idl"; + +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("//") +cpp_quote("// ISimpleDOMText") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// An interface that extends MSAA's IAccessible to provide important additional capabilities on text nodes") +cpp_quote("//") +cpp_quote("// [propget] domText(/* out,retval */ BSTR *domText") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Similar to IAccessible::get_accName, but does not strip out whitespace characters.") +cpp_quote("// Important for retrieving the correct start/end substring indices to use with other") +cpp_quote("// methods in ISimpleDOMText.") +cpp_quote("//") +cpp_quote("//") +cpp_quote("// get_[un]clippedSubstringBounds(") +cpp_quote("// /* [in] */ unsigned int startIndex,") +cpp_quote("// /* [in] */ unsigned int endIndex,") +cpp_quote("// /* [out] */ int *x,") +cpp_quote("// /* [out] */ int *y,") +cpp_quote("// /* [out] */ int *width,") +cpp_quote("// /* [out] */ int *height);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Both methods get_clippedSubstringBounds and get_unclippedSubstringBounds return the screen pixel") +cpp_quote("// coordinates of the given text substring. The in parameters for start and end indices refer") +cpp_quote("// to the string returned by ISimpleDOMText::get_domText().") +cpp_quote("//") +cpp_quote("//") +cpp_quote("// scrollToSubstring(") +cpp_quote("// /* [in] */ unsigned int startIndex,") +cpp_quote("// /* [in] */ unsigned int endIndex);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// In scrollable views, scrolls to ensure that the specified substring is visible onscreen.") +cpp_quote("// The in parameters for start and end indices refer to the string returned") +cpp_quote("// by ISimpleDOMText::get_domText().") +cpp_quote("//") +cpp_quote("//") +cpp_quote("// [propget] fontFamily(/* out,retval */ BSTR *fontFamily);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Return a single computed font family name, which is better than the comma delineated list") +cpp_quote("// that is returned by the ISimpleDOMNode computed style methods for font-family.") +cpp_quote("// In other words, return something like 'Arial' instead of 'Arial, Helvetica, Sans-serif'.") +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("") +cpp_quote("") + +[object, uuid(4e747be5-2052-4265-8af0-8ecad7aad1c0)] +interface ISimpleDOMText: IUnknown +{ + // Includes whitespace in DOM + [propget] HRESULT domText([out, retval] BSTR *domText); + + HRESULT get_clippedSubstringBounds([in] unsigned int startIndex, + [in] unsigned int endIndex, + [out] int *x, + [out] int *y, + [out] int *width, + [out] int *height); + + HRESULT get_unclippedSubstringBounds([in] unsigned int startIndex, + [in] unsigned int endIndex, + [out] int *x, + [out] int *y, + [out] int *width, + [out] int *height); + + HRESULT scrollToSubstring([in] unsigned int startIndex, + [in] unsigned int endIndex); + + [propget] HRESULT fontFamily([out, retval] BSTR *fontFamily); +}; diff --git a/accessible/interfaces/msaa/moz.build b/accessible/interfaces/msaa/moz.build new file mode 100644 index 0000000000..7a1053317a --- /dev/null +++ b/accessible/interfaces/msaa/moz.build @@ -0,0 +1,57 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +GeckoSharedLibrary("AccessibleMarshal", linkage=None) + +# Missing here, is the notion that changes to the idl files included by +# ISimpleDOM.idl (e.g. ISimpleDOMNode.idl) should rebuild the outputs. +GeneratedFile( + "ISimpleDOM.h", + "ISimpleDOM_p.c", + "ISimpleDOM_i.c", + "ISimpleDOM_dlldata.c", + "ISimpleDOM.tlb", + inputs=["ISimpleDOM.idl"], + script="/build/midl.py", + entry_point="midl", + flags=["-I", SRCDIR, "-robust", "-dlldata", OBJDIR + "/ISimpleDOM_dlldata.c"], +) + +SOURCES += [ + "!ISimpleDOM_dlldata.c", + "!ISimpleDOM_i.c", + "!ISimpleDOM_p.c", + "AccessibleMarshalThunk.c", +] + +EXPORTS += [ + "!ISimpleDOM.h", + "!ISimpleDOM_i.c", +] + +DEFINES["REGISTER_PROXY_DLL"] = True +# The following line is required to preserve compatibility with older versions +# of AccessibleMarshal.dll. +DEFINES["PROXY_CLSID"] = "IID_ISimpleDOMNode" + +DEFFILE = "AccessibleMarshal.def" + +OS_LIBS += [ + "kernel32", + "rpcrt4", + "oleaut32", +] + +RCINCLUDE = "AccessibleMarshal.rc" + +# Suppress warnings from the MIDL generated code. +if CONFIG["CC_TYPE"] == "clang-cl": + CFLAGS += [ + "-Wno-extern-initializer", + "-Wno-incompatible-pointer-types", + "-Wno-missing-braces", + "-Wno-unused-const-variable", + ] diff --git a/accessible/interfaces/nsIAccessibilityService.idl b/accessible/interfaces/nsIAccessibilityService.idl new file mode 100644 index 0000000000..ff145c877e --- /dev/null +++ b/accessible/interfaces/nsIAccessibilityService.idl @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessible; +interface nsIWeakReference; +interface nsIAccessiblePivot; +interface nsIAccessibleTextLeafPoint; + +webidl Node; + +/** + * An interface for in-process accessibility clients wishing to get an + * nsIAccessible for a given DOM node. More documentation at: + * http://www.mozilla.org/projects/ui/accessibility + */ +[scriptable, builtinclass, uuid(2188e3a0-c88e-11e7-8f1a-0800200c9a66)] +interface nsIAccessibilityService : nsISupports +{ + /** + * Return application accessible. + */ + nsIAccessible getApplicationAccessible(); + + /** + * Return an nsIAccessible for a DOM node in pres shell 0. + * Create a new accessible of the appropriate type if necessary, + * or use one from the accessibility cache if it already exists. + * @param aNode The DOM node to get an accessible for. + * @return The nsIAccessible for the given DOM node. + */ + nsIAccessible getAccessibleFor(in Node aNode); + + nsIAccessible getAccessibleDescendantFor(in Node aNode); + + /** + * Returns accessible role as a string. + * + * @param aRole - the accessible role constants. + */ + AString getStringRole(in unsigned long aRole); + + /** + * Returns list which contains accessible states as a strings. + * + * @param aStates - accessible states. + * @param aExtraStates - accessible extra states. + */ + nsISupports getStringStates(in unsigned long aStates, + in unsigned long aExtraStates); + + /** + * Get the type of accessible event as a string. + * + * @param aEventType - the accessible event type constant + * @return - accessible event type presented as human readable string + */ + AString getStringEventType(in unsigned long aEventType); + + /** + * Get the type of accessible relation as a string. + * + * @param aRelationType - the accessible relation type constant + * @return - accessible relation type presented as human readable string + */ + AString getStringRelationType(in unsigned long aRelationType); + + /** + * Return an accessible for the given DOM node from the cache. + * @note the method is intended for testing purposes + * + * @param aNode [in] the DOM node to get an accessible for + * + * @return cached accessible for the given DOM node if any + */ + nsIAccessible getAccessibleFromCache(in Node aNode); + + /** + * Create a new pivot for tracking a position and traversing a subtree. + * + * @param aRoot [in] the accessible root for the pivot + * @return a new pivot + */ + nsIAccessiblePivot createAccessiblePivot(in nsIAccessible aRoot); + + /** + * Create a new nsIAccessibleTextLeafPoint. + * + * @param aAccessible [in] the accessible for the point + * @param aOffset [in] the offset of the point + * @return a new point + */ + nsIAccessibleTextLeafPoint createTextLeafPoint(in nsIAccessible aAccessible, + in long aOffset); + + /** + * Enable logging for the given modules, all other modules aren't logged. + * + * @param aModules [in] list of modules, format is comma separated list + * like 'docload,doccreate'. + * @note Works on debug build only. + * @see Logging.cpp for list of possible values. + */ + void setLogging(in ACString aModules); + + /** + * Return true if the given module is logged. + */ + boolean isLogged(in AString aModule); + + /** + * Get the current accessibility service consumers. + * @returns a JSON string representing the accessibility service consumers. + */ + AString getConsumers(); +}; diff --git a/accessible/interfaces/nsIAccessible.idl b/accessible/interfaces/nsIAccessible.idl new file mode 100644 index 0000000000..e7bdb7d434 --- /dev/null +++ b/accessible/interfaces/nsIAccessible.idl @@ -0,0 +1,351 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIArray.idl" + +interface nsIPersistentProperties; +interface nsIAccessibleDocument; +interface nsIAccessibleRelation; + +webidl Node; + +%{C++ +#define NS_ACCESSIBLE_CACHE_TOPIC "accessible-cache" +namespace mozilla { +namespace a11y { +class Accessible; +class LocalAccessible; +} +} +%} + +[ptr] native InternalAccessible(mozilla::a11y::Accessible); +[ptr] native InternalLocalAccessible(mozilla::a11y::LocalAccessible); + +/** + * A cross-platform interface that supports platform-specific + * accessibility APIs like MSAA and ATK. Contains the sum of what's needed + * to support IAccessible as well as ATK's generic accessibility objects. + * Can also be used by in-process accessibility clients to get information + * about objects in the accessible tree. The accessible tree is a subset of + * nodes in the DOM tree -- such as documents, focusable elements and text. + * Mozilla creates the implementations of nsIAccessible on demand. + * See http://www.mozilla.org/projects/ui/accessibility for more information. + */ +[scriptable, builtinclass, uuid(de2869d9-563c-4943-996b-31a4daa4d097)] +interface nsIAccessible : nsISupports +{ + /** + * Parent node in accessible tree. + */ + readonly attribute nsIAccessible parent; + + /** + * Next sibling in accessible tree + */ + readonly attribute nsIAccessible nextSibling; + + /** + * Previous sibling in accessible tree + */ + readonly attribute nsIAccessible previousSibling; + + /** + * First child in accessible tree + */ + readonly attribute nsIAccessible firstChild; + + /** + * Last child in accessible tree + */ + readonly attribute nsIAccessible lastChild; + + /** + * Array of all this element's children. + */ + readonly attribute nsIArray children; + + /** + * Number of accessible children + */ + readonly attribute long childCount; + + /** + * The 0-based index of this accessible in its parent's list of children, + * or -1 if this accessible does not have a parent. + */ + readonly attribute long indexInParent; + + /** + * The unique identifier of the accessible. ID is only guaranteed to be unique + * per document (Windows IDs are unique even across documents, but that is + * Windows specific and not exposed to core). + */ + readonly attribute long long uniqueID; + + /** + * The DOM node this nsIAccessible is associated with. + */ + readonly attribute Node DOMNode; + + /** + * For remote accessibles the id of the related DOM node. + */ + readonly attribute AString id; + + /** + * The document accessible that this access node resides in. + */ + readonly attribute nsIAccessibleDocument document; + + /** + * The root document accessible that this access node resides in. + */ + readonly attribute nsIAccessibleDocument rootDocument; + + /** + * The language for the current DOM node, e.g. en, de, etc. + */ + readonly attribute AString language; + + /** + * Accessible name -- the main text equivalent for this node. The name is + * specified by ARIA or by native markup. Example of ARIA markup is + * aria-labelledby attribute placed on element of this accessible. Example + * of native markup is HTML label linked with HTML element of this accessible. + * + * Value can be string or null. A null value indicates that AT may attempt to + * compute the name. Any string value, including the empty string, should be + * considered author-intentional, and respected. + */ + readonly attribute AString name; + + /** + * Accessible value -- a number or a secondary text equivalent for this node + * Widgets that use role attribute can force a value using the valuenow attribute + */ + readonly attribute AString value; + + /** + * Accessible description -- long text associated with this node + */ + readonly attribute AString description; + + /** + * Provides localized string of accesskey name, such as Alt+D. + * The modifier may be affected by user and platform preferences. + * Usually alt+letter, or just the letter alone for menu items. + */ + readonly attribute AString accessKey; + + /** + * Provides localized string of global keyboard accelerator for default + * action, such as Ctrl+O for Open file + */ + readonly attribute AString keyboardShortcut; + + /** + * Enumerated accessible role (see the constants defined in nsIAccessibleRole). + * + * @note The values might depend on platform because of variations. Widgets + * can use ARIA role attribute to force the final role. + */ + readonly attribute unsigned long role; + + /** + * Accessible states -- bit fields which describe boolean properties of node. + * Many states are only valid given a certain role attribute that supports + * them. + * + * @param aState - the first bit field (see nsIAccessibleStates::STATE_* + * constants) + * @param aExtraState - the second bit field + * (see nsIAccessibleStates::EXT_STATE_* constants) + */ + void getState(out unsigned long aState, out unsigned long aExtraState); + + /** + * Focused accessible child of node + */ + readonly attribute nsIAccessible focusedChild; + + /** + * Attributes of accessible + */ + readonly attribute nsIPersistentProperties attributes; + + /** + * Cached fields from a remote accessible + */ + readonly attribute nsIPersistentProperties cache; + + /** + * Platform specific interface for accessible + */ + readonly attribute nsISupports nativeInterface; + + /** + * Returns grouping information. Used for tree items, list items, tab panel + * labels, radio buttons, etc. Also used for collectons of non-text objects. + * + * @param groupLevel - 1-based, similar to ARIA 'level' property + * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property, + * inclusive of the current item + * @param positionInGroup - 1-based, similar to ARIA 'posinset' property + */ + void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup, + out long aPositionInGroup); + + /** + * Accessible child which contains the coordinate at (x, y) in screen pixels. + * If the point is in the current accessible but not in a child, the + * current accessible will be returned. + * If the point is in neither the current accessible or a child, then + * null will be returned. + * + * @param x screen's x coordinate + * @param y screen's y coordinate + * @return the direct accessible child containing the given point + */ + nsIAccessible getChildAtPoint(in long x, in long y); + + /** + * Deepest accessible child which contains the coordinate at (x, y) in screen + * pixels. If the point is in the current accessible but not in a child, the + * current accessible will be returned. If the point is in neither the current + * accessible or a child, then null will be returned. + * + * @param x screen's x coordinate + * @param y screen's y coordinate + * @return the deepest accessible child containing the given point + */ + nsIAccessible getDeepestChildAtPoint(in long x, in long y); + +/** + * Like GetDeepestChildAtPoint, but restricted to the current process. + * If the point is within a remote document, the accessible for the browser + * element containing that document will be returned; i.e. this will not + * descend into the document. If called on an accessible inside a remote + * document, this will fail. + * + * @param x screen's x coordinate + * @param y screen's y coordinate + * @return the deepest accessible child in this process containing the given + * point + */ + nsIAccessible getDeepestChildAtPointInProcess(in long x, in long y); + + /** + * Nth accessible child using zero-based index or last child if index less than zero + */ + nsIAccessible getChildAt(in long aChildIndex); + + /** + * Return accessible relation by the given relation type (see. + * constants defined in nsIAccessibleRelation). + */ + nsIAccessibleRelation getRelationByType(in unsigned long aRelationType); + + /** + * Returns multiple accessible relations for this object. + */ + nsIArray getRelations(); + + /** + * Return accessible's x and y coordinates relative to the screen and + * accessible's width and height in Dev pixels. + */ + void getBounds(out long x, out long y, out long width, out long height); + + /** + * Return accessible's x and y coordinates relative to the screen and + * accessible's width and height in CSS pixels. + */ + void getBoundsInCSSPixels(out long aX, out long aY, out long aWidth, out long aHeight); + + /** + * Add or remove this accessible to the current selection + */ + void setSelected(in boolean isSelected); + + /** + * Select this accessible node only + */ + void takeSelection(); + + /** + * Focus this accessible node, + * The state STATE_FOCUSABLE indicates whether this node is normally focusable. + * It is the callers responsibility to determine whether this node is focusable. + * accTakeFocus on a node that is not normally focusable (such as a table), + * will still set focus on that node, although normally that will not be visually + * indicated in most style sheets. + */ + void takeFocus(); + + /** + * The number of accessible actions associated with this accessible + */ + readonly attribute uint8_t actionCount; + + /** + * The name of the accessible action at the given zero-based index + */ + AString getActionName(in uint8_t index); + + /** + * The description of the accessible action at the given zero-based index + */ + AString getActionDescription(in uint8_t aIndex); + + /** + * Perform the accessible action at the given zero-based index + * Action number 0 is the default action + */ + void doAction(in uint8_t index); + + /** + * Makes an object visible on screen. + * + * @param scrollType - defines where the object should be placed on + * the screen (see nsIAccessibleScrollType for + * available constants). + */ + [can_run_script] + void scrollTo(in unsigned long aScrollType); + + /** + * Moves the top left of an object to a specified location. + * + * @param coordinateType [in] - specifies whether the coordinates are relative to + * the screen or the parent object (for available + * constants refer to nsIAccessibleCoordinateType) + * @param x [in] - defines the x coordinate + * @param y [in] - defines the y coordinate + */ + void scrollToPoint(in unsigned long coordinateType, in long x, in long y); + + /** + * Dispatches an ANNOUNCEMENT event with this accessible as target. + * + * @param announcement [in] - string to use in announcement. + * @param priority [in] - priority for announcement, could be + * nsIAccessibleAnnouncementEvent.POLITE or + * nsIAccessibleAnnouncementEvent.ASSERTIVE. + */ + void announce(in AString announcement, in unsigned short priority); + + /** + * Get the role of this Accessible as an ARIA role token. This might have been + * set explicitly (e.g. role="button") or it might be implicit in native + * markup (e.g. <button> returns "button"). + */ + readonly attribute AString computedARIARole; + + [notxpcom, nostdcall] InternalLocalAccessible toInternalAccessible(); + [notxpcom, nostdcall] InternalAccessible toInternalGeneric(); + +}; diff --git a/accessible/interfaces/nsIAccessibleAnnouncementEvent.idl b/accessible/interfaces/nsIAccessibleAnnouncementEvent.idl new file mode 100644 index 0000000000..c64e95d583 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleAnnouncementEvent.idl @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when announce() is called on the target accessible. + */ +[scriptable, builtinclass, uuid(8818e49c-1286-4fe6-ae82-4d1b795ec88d)] +interface nsIAccessibleAnnouncementEvent : nsIAccessibleEvent +{ + const unsigned short POLITE = 0; + const unsigned short ASSERTIVE = 1; + + // String of actual announcement + readonly attribute AString announcement; + + // Priority for announcement, could be POLITE or ASSERTIVE, ATs + // will decide how to appropriately present it. + readonly attribute unsigned short priority; +}; diff --git a/accessible/interfaces/nsIAccessibleApplication.idl b/accessible/interfaces/nsIAccessibleApplication.idl new file mode 100644 index 0000000000..6facf13375 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleApplication.idl @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +/** + * This interface is implemented by top level accessible object in hierarchy and + * provides information about application. + */ +[scriptable, builtinclass, uuid(79251626-387c-4531-89f3-680d31d6cf05)] +interface nsIAccessibleApplication : nsISupports +{ + /** + * Returns the application name. + */ + readonly attribute AString appName; + + /** + * Returns the application version. + */ + readonly attribute AString appVersion; + + /** + * Returns the platform name. + */ + readonly attribute AString platformName; + + /** + * Returns the platform version. + */ + readonly attribute AString platformVersion; +}; diff --git a/accessible/interfaces/nsIAccessibleCaretMoveEvent.idl b/accessible/interfaces/nsIAccessibleCaretMoveEvent.idl new file mode 100644 index 0000000000..4cdece16cc --- /dev/null +++ b/accessible/interfaces/nsIAccessibleCaretMoveEvent.idl @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when the caret changes position in text. + */ +[scriptable, builtinclass, uuid(ed1982e4-57d7-41a8-8cd8-9023f809383e)] +interface nsIAccessibleCaretMoveEvent: nsIAccessibleEvent +{ + /** + * Return caret offset. + */ + readonly attribute long caretOffset; + + /** + * Return true if there is no selection. + */ + readonly attribute bool isSelectionCollapsed; + + /** + * Return true if the caret is at the end of a line. + */ + readonly attribute bool isAtEndOfLine; + + /** + * Return caret move granularity. + */ + readonly attribute long granularity; +}; diff --git a/accessible/interfaces/nsIAccessibleDocument.idl b/accessible/interfaces/nsIAccessibleDocument.idl new file mode 100644 index 0000000000..1886621c37 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleDocument.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessiblePivot; +interface mozIDOMWindowProxy; + +webidl Document; + +/** + * An interface for in-process accessibility clients + * that wish to retrieve information about a document. + * When accessibility is turned on in Gecko, + * there is an nsIAccessibleDocument for each document + * whether it is XUL, HTML or whatever. + * You can QueryInterface to nsIAccessibleDocument from the nsIAccessible for + * the root node of a document or you can get one from + * nsIAccessible::GetDocument(). + */ +[scriptable, builtinclass, uuid(5cad5f91-fcce-40e7-913e-4671701d19b4)] +interface nsIAccessibleDocument : nsISupports +{ + /** + * The URL of the document + */ + readonly attribute AString URL; + + /** + * The title of the document, as specified in the document. + */ + readonly attribute AString title; + + /** + * The mime type of the document + */ + readonly attribute AString mimeType; + + /** + * The doc type of the document, as specified in the document. + */ + readonly attribute AString docType; + + /** + * The Document interface associated with this document. + */ + readonly attribute Document DOMDocument; + + /** + * The nsIDOMWindow that the document resides in. + */ + readonly attribute mozIDOMWindowProxy window; + + /** + * Return the parent document accessible. + */ + readonly attribute nsIAccessibleDocument parentDocument; + + /** + * Return the count of child document accessibles. + */ + readonly attribute unsigned long childDocumentCount; + + /** + * Return the child document accessible at the given index. + */ + nsIAccessibleDocument getChildDocumentAt(in unsigned long index); +}; diff --git a/accessible/interfaces/nsIAccessibleEditableText.idl b/accessible/interfaces/nsIAccessibleEditableText.idl new file mode 100644 index 0000000000..5fce44032c --- /dev/null +++ b/accessible/interfaces/nsIAccessibleEditableText.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, builtinclass, uuid(28915cca-3366-4034-ba1d-b7afb9b37639)] +interface nsIAccessibleEditableText : nsISupports +{ + /** + * Replaces the text represented by this object by the given text. + */ + void setTextContents (in AString text); + + /** + * Inserts text at the specified position. + * + * @param text - text that is inserted. + * @param position - index at which to insert the text. + */ + void insertText(in AString text, in long position); + + /** + * Copies the text range into the clipboard. + * + * @param startPos - start index of the text to moved into the clipboard. + * @param endPos - end index of the text to moved into the clipboard. + */ + void copyText(in long startPos, in long endPos); + + /** + * Deletes a range of text and copies it to the clipboard. + * + * @param startPos - start index of the text to be deleted. + * @param endOffset - end index of the text to be deleted. + */ + void cutText(in long startPos, in long endPos); + + /** + * Deletes a range of text. + * + * @param startPos - start index of the text to be deleted. + * @param endPos - end index of the text to be deleted. + */ + void deleteText(in long startPos, in long endPos); + + /** + * Pastes text from the clipboard. + * + * @param position - index at which to insert the text from the system + * clipboard into the text represented by this object. + */ + [can_run_script] + void pasteText(in long position); +}; diff --git a/accessible/interfaces/nsIAccessibleEvent.idl b/accessible/interfaces/nsIAccessibleEvent.idl new file mode 100644 index 0000000000..233f516cb8 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleEvent.idl @@ -0,0 +1,251 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessible; +interface nsIAccessibleDocument; + +webidl Node; + +%{C++ +#define NS_ACCESSIBLE_EVENT_TOPIC "accessible-event" +%} + +/** + * An interface for accessibility events listened to + * by in-process accessibility clients, which can be used + * to find out how to get accessibility and DOM interfaces for + * the event and its target. To listen to in-process accessibility invents, + * make your object an nsIObserver, and listen for accessible-event by + * using code something like this: + * nsCOMPtr<nsIObserverService> observerService = + * do_GetService("@mozilla.org/observer-service;1", &rv); + * if (NS_SUCCEEDED(rv)) + * rv = observerService->AddObserver(this, "accessible-event", PR_TRUE); + */ +[scriptable, builtinclass, uuid(20c69a40-6c2c-42a3-a578-6f4473aab9dd)] +interface nsIAccessibleEvent : nsISupports +{ + /** + * An object has been created. + */ + const unsigned long EVENT_SHOW = 0x0001; + + /** + * An object has been destroyed. + */ + const unsigned long EVENT_HIDE = 0x0002; + + /** + * An object's children have changed + */ + const unsigned long EVENT_REORDER = 0x0003; + + /** + * An object has received the keyboard focus. + */ + const unsigned long EVENT_FOCUS = 0x0004; + + /** + * An object's state has changed. + */ + const unsigned long EVENT_STATE_CHANGE = 0x0005; + + /** + * An object's Name property has changed. + */ + const unsigned long EVENT_NAME_CHANGE = 0x0006; + + /** + * An object's Description property has changed. + */ + const unsigned long EVENT_DESCRIPTION_CHANGE = 0x0007; + + /** + * An object's numeric Value has changed. + */ + const unsigned long EVENT_VALUE_CHANGE = 0x0008; + + /** + * The selection within a container object has changed. + */ + const unsigned long EVENT_SELECTION = 0x0009; + + /** + * An item within a container object has been added to the selection. + */ + const unsigned long EVENT_SELECTION_ADD = 0x000A; + + /** + * An item within a container object has been removed from the selection. + */ + const unsigned long EVENT_SELECTION_REMOVE = 0x000B; + + /** + * Numerous selection changes have occurred within a container object. + */ + const unsigned long EVENT_SELECTION_WITHIN = 0x000C; + + /** + * An alert has been generated. Server applications send this event when a + * user needs to know that a user interface element has changed. + */ + const unsigned long EVENT_ALERT = 0x000D; + + /** + * A menu item on the menu bar has been selected. + */ + const unsigned long EVENT_MENU_START = 0x000E; + + /** + * A menu from the menu bar has been closed. + */ + const unsigned long EVENT_MENU_END = 0x000F; + + /** + * A pop-up menu has been displayed. + */ + const unsigned long EVENT_MENUPOPUP_START = 0x0010; + + /** + * A pop-up menu has been closed. + */ + const unsigned long EVENT_MENUPOPUP_END = 0x0011; + + /** + * An application is about to enter drag-and-drop mode + */ + const unsigned long EVENT_DRAGDROP_START = 0x0012; + + /** + * Scrolling has started on a scroll bar + */ + const unsigned long EVENT_SCROLLING_START = 0x0013; + + /** + * Scrolling has ended on a scroll bar + */ + const unsigned long EVENT_SCROLLING_END = 0x0014; + + /** + * The loading of the document has completed. + */ + const unsigned long EVENT_DOCUMENT_LOAD_COMPLETE = 0x0015; + + /** + * The document contents are being reloaded. + */ + const unsigned long EVENT_DOCUMENT_RELOAD = 0x0016; + + /** + * The loading of the document was interrupted. + */ + const unsigned long EVENT_DOCUMENT_LOAD_STOPPED = 0x0017; + + /** + * A text object's attributes changed. + * Also see EVENT_OBJECT_ATTRIBUTE_CHANGED. + */ + const unsigned long EVENT_TEXT_ATTRIBUTE_CHANGED = 0x0018; + + /** + * The caret has moved to a new position. + */ + const unsigned long EVENT_TEXT_CARET_MOVED = 0x0019; + + /** + * Text was inserted. + */ + const unsigned long EVENT_TEXT_INSERTED = 0x001A; + + /** + * Text was removed. + */ + const unsigned long EVENT_TEXT_REMOVED = 0x001B; + + /** + * The text selection changed. + */ + const unsigned long EVENT_TEXT_SELECTION_CHANGED = 0x001C; + + const unsigned long EVENT_WINDOW_ACTIVATE = 0x001D; + const unsigned long EVENT_WINDOW_DEACTIVATE = 0x001E; + const unsigned long EVENT_WINDOW_MAXIMIZE = 0x001F; + const unsigned long EVENT_WINDOW_MINIMIZE = 0x0020; + const unsigned long EVENT_WINDOW_RESTORE = 0x0021; + + /** + * An object's attributes changed. Also see EVENT_TEXT_ATTRIBUTE_CHANGED. + */ + const unsigned long EVENT_OBJECT_ATTRIBUTE_CHANGED = 0x0022; + + /** + * An object's text Value has changed. + */ + const unsigned long EVENT_TEXT_VALUE_CHANGE = 0x0023; + + /** + * An accessible's viewport is scrolling. + */ + const unsigned long EVENT_SCROLLING = 0x0024; + + /** + * An accessible is making an explicit announcement. + */ + const unsigned long EVENT_ANNOUNCEMENT = 0x0025; + + /** + * A live region has been introduced. Mac only. + */ + const unsigned long EVENT_LIVE_REGION_ADDED = 0x0026; + + /** + * A live region has been removed (aria-live attribute changed). Mac Only. + */ + const unsigned long EVENT_LIVE_REGION_REMOVED = 0x0027; + + /** + * A reorder event that has been coalesced into a mutation + * of an ancestor's subtree. + */ + const unsigned long EVENT_INNER_REORDER = 0x0028; + + /** + * Help make sure event map does not get out-of-line. + */ + const unsigned long EVENT_LAST_ENTRY = 0x0029; + + /** + * The type of event, based on the enumerated event values + * defined in this interface. + */ + readonly attribute unsigned long eventType; + + /** + * The nsIAccessible associated with the event. + * May return null if no accessible is available + */ + readonly attribute nsIAccessible accessible; + + /** + * The nsIAccessibleDocument that the event target nsIAccessible + * resides in. This can be used to get the DOM window, + * the DOM document and the window handler, among other things. + */ + readonly attribute nsIAccessibleDocument accessibleDocument; + + /** + * The Node associated with the event + * May return null if accessible for event has been shut down + */ + readonly attribute Node DOMNode; + + /** + * Returns true if the event was caused by explicit user input, + * as opposed to purely originating from a timer or mouse movement + */ + readonly attribute boolean isFromUserInput; +}; diff --git a/accessible/interfaces/nsIAccessibleHideEvent.idl b/accessible/interfaces/nsIAccessibleHideEvent.idl new file mode 100644 index 0000000000..820b8914c9 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleHideEvent.idl @@ -0,0 +1,28 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when a accessible and its subtree are removed from the tree. + */ +[scriptable, builtinclass, uuid(2051709a-4e0d-4be5-873d-b49d1dee35fa)] +interface nsIAccessibleHideEvent: nsIAccessibleEvent +{ + /** + * Return an accessible that was a parent of the target. + */ + readonly attribute nsIAccessible targetParent; + + /** + * Return an accessible that was a next sibling of the target + */ + readonly attribute nsIAccessible targetNextSibling; + + /** + * Return an accessible that was a parent of the target + */ + readonly attribute nsIAccessible targetPrevSibling; +}; diff --git a/accessible/interfaces/nsIAccessibleHyperLink.idl b/accessible/interfaces/nsIAccessibleHyperLink.idl new file mode 100644 index 0000000000..e2926d4f0f --- /dev/null +++ b/accessible/interfaces/nsIAccessibleHyperLink.idl @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIURI; +interface nsIAccessible; + +/** + * A cross-platform interface that supports hyperlink-specific properties and + * methods. Anchors, image maps, xul:labels with class="text-link" implement this interface. + */ +[scriptable, builtinclass, uuid(883643d4-93a5-4f32-922c-6f06e01363c1)] +interface nsIAccessibleHyperLink : nsISupports +{ + /** + * Returns the offset of the link within the parent accessible. + */ + readonly attribute long startIndex; + + /** + * Returns the end index of the link within the parent accessible. + * + * @note The link itself is represented by one embedded character within the + * parent text, so the endIndex should be startIndex + 1. + */ + readonly attribute long endIndex; + + /** + * Determines whether the link is valid (e. g. points to a valid URL). + * + * @note XXX Currently only used with ARIA links, and the author has to + * specify that the link is invalid via the aria-invalid="true" attribute. + * In all other cases, TRUE is returned. + */ + readonly attribute boolean valid; + + /** + * The numbber of anchors within this Hyperlink. Is normally 1 for anchors. + * This anchor is, for example, the visible output of the html:a tag. + * With an Image Map, reflects the actual areas within the map. + */ + readonly attribute long anchorCount; + + /** + * Returns the URI at the given index. + * + * @note ARIA hyperlinks do not have an URI to point to, since clicks are + * processed via JavaScript. Therefore this property does not work on ARIA + * links. + * + * @param index The 0-based index of the URI to be returned. + * + * @return the nsIURI object containing the specifications for the URI. + */ + nsIURI getURI (in long index); + + /** + * Returns a reference to the object at the given index. + * + * @param index The 0-based index whose object is to be returned. + * + * @return the nsIAccessible object at the desired index. + */ + nsIAccessible getAnchor (in long index); +}; + +/* + Assumptions: + + The object associated with object or anchor index + is an nsIAccessible. + A URI can be represented by the nsIURI interface + (or nsIURL interface). + + Note that an object which supports nsIAccessibleHyperlink + does *not* generally implement nsIAccessible, unlike the + case of the other nsiAccessible* interfaces in this directory. + + Aaron: would the nsISupports return from + getObject be queryable for nsIURI and nsIURL directly? + +*/ diff --git a/accessible/interfaces/nsIAccessibleHyperText.idl b/accessible/interfaces/nsIAccessibleHyperText.idl new file mode 100644 index 0000000000..6e34f2a909 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleHyperText.idl @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIAccessibleHyperLink.idl" + +/** + * A cross-platform interface that deals with text which contains hyperlinks. + * Each link is an embedded object representing exactly 1 character within + * the hypertext. + * + * Current implementation assumes every embedded object is a link. + */ + +[scriptable, builtinclass, uuid(b33684e2-090c-4e1d-a3d9-f4b46f4237b9)] +interface nsIAccessibleHyperText : nsISupports +{ + /** + * Return the number of links contained within this hypertext object. + */ + readonly attribute long linkCount; + + /** + * Return link accessible at the given index. + * + * @param index [in] 0-based index of the link that is to be retrieved + * + * @return link accessible or null if there is no link at that index + */ + nsIAccessibleHyperLink getLinkAt(in long index); + + /** + * Return index of the given link. + * + * @param link [in] link accessible the index is requested for + * + * @return index of the given link or null if there's no link within + * hypertext accessible + */ + long getLinkIndex(in nsIAccessibleHyperLink link); + + /* + * Return link index at the given offset within hypertext accessible. + * + * @param offset [in] the 0-based character index + * + * @return 0-based link's index or -1 if no link is present at that + * offset + */ + long getLinkIndexAtOffset(in long offset); +}; diff --git a/accessible/interfaces/nsIAccessibleImage.idl b/accessible/interfaces/nsIAccessibleImage.idl new file mode 100644 index 0000000000..296216e70d --- /dev/null +++ b/accessible/interfaces/nsIAccessibleImage.idl @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, builtinclass, uuid(09086623-0f09-4310-ac56-c2cda7c29648)] +interface nsIAccessibleImage : nsISupports +{ + /** + * Returns the coordinates of the image. + * + * @param coordType specifies coordinates origin (for available constants + * refer to nsIAccessibleCoordinateType) + * @param x the x coordinate + * @param y the y coordinate + */ + void getImagePosition(in unsigned long coordType, + out long x, + out long y); + + /** + * Returns the size of the image. + * + * @param width the heigth + * @param height the width + */ + void getImageSize(out long width, out long height); +}; diff --git a/accessible/interfaces/nsIAccessibleMacInterface.idl b/accessible/interfaces/nsIAccessibleMacInterface.idl new file mode 100644 index 0000000000..384d09d5f0 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleMacInterface.idl @@ -0,0 +1,87 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +%{C++ +#include <objc/objc.h> + +#define NS_ACCESSIBLE_MAC_EVENT_TOPIC "accessible-mac-event" +%} + +native NativeObjectId(id); + +/** + * A generic NSISupports wrapper for native NSObjects. + */ +[scriptable, builtinclass, uuid(4582bb77-de03-4ed1-a9b4-d482d97c0129)] +interface nsIAccessibleMacNSObjectWrapper : nsISupports +{ + [noscript, notxpcom, nostdcall] NativeObjectId GetNativeObject(); +}; + +[scriptable, builtinclass, uuid(9d27cf21-66fc-47dc-8a07-98edb18707b1)] +interface nsIAccessibleMacInterface : nsISupports +{ + /** + * List of available attribute names for the object. + * Emulates `AXUIElementCopyAttributeNames`. + */ + readonly attribute Array<AString> attributeNames; + + /** + * List of available parameterized attribute names for the object. + * Emulates `AXUIElementCopyParameterizedAttributeNames`. + */ + readonly attribute Array<AString> parameterizedAttributeNames; + + /** + * List of available action names for tthe object. + * Emulates `AXUIElementCopyActionNames`. + */ + readonly attribute Array<AString> actionNames; + + /** + * Returns the value of an attribute. + * Emulates `AXUIElementCopyAttributeValue`. + */ + [implicit_jscontext] + jsval getAttributeValue(in AString attributeName); + + /** + * Returns the value of an attribute given a name and a parameter. + * Emulates `AXUIElementCopyParameterizedAttributeValue`. + **/ + [implicit_jscontext] + jsval getParameterizedAttributeValue(in AString attributeName, in jsval parameter); + + /** + * Requests that the accessibility object perform the specified action. + * Emulatets `AXUIElementPerformAction`. + */ + void performAction(in AString actionName); + + /** + * Returns true if the given attribute is settable on the object. + * Emulates `AXUIElementIsAttributeSettable`. + **/ + bool isAttributeSettable(in AString attributeName); + + /** + * Sets the given attribute with the given value on the object. + * Emulates `AXUIElementSetAttributeValue`. + **/ + [implicit_jscontext] + void setAttributeValue(in AString attributeName, in jsval attributeValue); +}; + +[scriptable, builtinclass, uuid(6153f07b-2260-495b-9899-9699d9fe323e)] +interface nsIAccessibleMacEvent : nsISupports +{ + readonly attribute nsIAccessibleMacInterface macIface; + + [implicit_jscontext] + readonly attribute jsval data; +}; diff --git a/accessible/interfaces/nsIAccessibleObjectAttributeChangedEvent.idl b/accessible/interfaces/nsIAccessibleObjectAttributeChangedEvent.idl new file mode 100644 index 0000000000..28597491a1 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleObjectAttributeChangedEvent.idl @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when an attribute of an accessible changes. + */ +[scriptable, builtinclass, uuid(ce41add2-096e-4606-b1ca-7408c6d5b4c3)] +interface nsIAccessibleObjectAttributeChangedEvent : nsIAccessibleEvent +{ + /** + * Return the accessible attribute that changed. + */ + readonly attribute AString changedAttribute; +}; diff --git a/accessible/interfaces/nsIAccessiblePivot.idl b/accessible/interfaces/nsIAccessiblePivot.idl new file mode 100644 index 0000000000..f48dc149c6 --- /dev/null +++ b/accessible/interfaces/nsIAccessiblePivot.idl @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +typedef short PivotMoveReason; + +interface nsIAccessible; +interface nsIAccessibleTraversalRule; + +/** + * The pivot interface encapsulates a reference to a single place in an accessible + * subtree. The pivot is a point or a range in the accessible tree. This interface + * provides traversal methods to move the pivot to next/prev state that complies + * to a given rule. + */ +[scriptable, uuid(81fe5144-059b-42db-bd3a-f6ce3158d5e9)] +interface nsIAccessiblePivot : nsISupports +{ + /** + * Move pivot to next object, from current position or given anchor, + * complying to given traversal rule. + * + * @param aRule [in] traversal rule to use. + * @param aAnchor [in] accessible to start search from, if not provided, + * current position will be used. + * @param aIncludeStart [in] include anchor accessible in search. + * @return next accessible node that matches rule in preorder. + */ + [optional_argc] nsIAccessible next(in nsIAccessible aAnchor, + in nsIAccessibleTraversalRule aRule, + [optional] in boolean aIncludeStart); + + /** + * Move pivot to previous object, from current position or given anchor, + * complying to given traversal rule. + * + * @param aRule [in] traversal rule to use. + * @param aAnchor [in] accessible to start search from, if not provided, + * current position will be used. + * @param aIncludeStart [in] include anchor accessible in search. + * @return previous accessible node that matches rule in preorder. + */ + [optional_argc] nsIAccessible prev(in nsIAccessible aAnchor, + in nsIAccessibleTraversalRule aRule, + [optional] in boolean aIncludeStart); + + /** + * Move pivot to first object in subtree complying to given traversal rule. + * + * @param aRule [in] traversal rule to use. + * @return first accessible node in subtree that matches rule in preorder. + */ + nsIAccessible first(in nsIAccessibleTraversalRule aRule); + + /** + * Move pivot to last object in subtree complying to given traversal rule. + * + * @param aRule [in] traversal rule to use. + * @return last accessible node in subtree that matches rule in preorder. + */ + nsIAccessible last(in nsIAccessibleTraversalRule aRule); + + /** + * Move pivot to given coordinate in screen pixels. + * + * @param aX [in] screen's x coordinate + * @param aY [in] screen's y coordinate + * @param aRule [in] raversal rule to use. + * @return highest accessible in subtree that matches rule at given point. + */ + nsIAccessible atPoint(in long aX, in long aY, + in nsIAccessibleTraversalRule aRule); +}; + +[scriptable, uuid(e197460d-1eff-4247-b4bb-a43be1840dae)] +interface nsIAccessibleTraversalRule : nsISupports +{ + /* Ignore this accessible object */ + const unsigned short FILTER_IGNORE = 0x0; + /* Accept this accessible object */ + const unsigned short FILTER_MATCH = 0x1; + /* Don't traverse accessibles children */ + const unsigned short FILTER_IGNORE_SUBTREE = 0x2; + + /** + * Determines if a given accessible is to be accepted in our traversal rule + * + * @param aAccessible [in] accessible to examine. + * @return a bitfield of FILTER_MATCH and FILTER_IGNORE_SUBTREE. + */ + unsigned short match(in nsIAccessible aAccessible); +}; diff --git a/accessible/interfaces/nsIAccessibleRelation.idl b/accessible/interfaces/nsIAccessibleRelation.idl new file mode 100644 index 0000000000..00575804cd --- /dev/null +++ b/accessible/interfaces/nsIAccessibleRelation.idl @@ -0,0 +1,183 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIArray.idl" + +interface nsIAccessible; + +/** + * This interface gives access to an accessible's set of relations. + */ +[scriptable, builtinclass, uuid(55b308c4-2ae4-46bc-b4cd-4d4370e0a660)] +interface nsIAccessibleRelation : nsISupports +{ + /** + * This object is labelled by a target object. + */ + const unsigned long RELATION_LABELLED_BY = 0x00; + + /** + * This object is label for a target object. + */ + const unsigned long RELATION_LABEL_FOR = 0x01; + + /** + * This object is described by the target object. + */ + const unsigned long RELATION_DESCRIBED_BY = 0x02; + + /** + * This object is describes the target object. + */ + const unsigned long RELATION_DESCRIPTION_FOR = 0x3; + + /** + * This object is a child of a target object. + */ + const unsigned long RELATION_NODE_CHILD_OF = 0x4; + + /** + * This object is a parent of a target object. A dual relation to + * RELATION_NODE_CHILD_OF + */ + const unsigned long RELATION_NODE_PARENT_OF = 0x5; + + /** + * Some attribute of this object is affected by a target object. + */ + const unsigned long RELATION_CONTROLLED_BY = 0x06; + + /** + * This object is interactive and controls some attribute of a target object. + */ + const unsigned long RELATION_CONTROLLER_FOR = 0x07; + + /** + * Content flows from this object to a target object, i.e. has content that + * flows logically to another object in a sequential way, e.g. text flow. + */ + const unsigned long RELATION_FLOWS_TO = 0x08; + + /** + * Content flows to this object from a target object, i.e. has content that + * flows logically from another object in a sequential way, e.g. text flow. + */ + const unsigned long RELATION_FLOWS_FROM = 0x09; + + /** + * This object is a member of a group of one or more objects. When there is + * more than one object in the group each member may have one and the same + * target, e.g. a grouping object. It is also possible that each member has + * multiple additional targets, e.g. one for every other member in the group. + */ + const unsigned long RELATION_MEMBER_OF = 0x0a; + + /** + * This object is a sub window of a target object. + */ + const unsigned long RELATION_SUBWINDOW_OF = 0x0b; + + /** + * This object embeds a target object. This relation can be used on the + * OBJID_CLIENT accessible for a top level window to show where the content + * areas are. + */ + const unsigned long RELATION_EMBEDS = 0x0c; + + /** + * This object is embedded by a target object. + */ + const unsigned long RELATION_EMBEDDED_BY = 0x0d; + + /** + * This object is a transient component related to the target object. When + * this object is activated the target object doesn't lose focus. + */ + const unsigned long RELATION_POPUP_FOR = 0x0e; + + /** + * This object is a parent window of the target object. + */ + const unsigned long RELATION_PARENT_WINDOW_OF = 0x0f; + + /** + * Part of a form/dialog with a related default button. It is used for + * MSAA/XPCOM, it isn't for IA2 or ATK. + */ + const unsigned long RELATION_DEFAULT_BUTTON = 0x10; + + /** + * The target object is the containing document object. + */ + const unsigned long RELATION_CONTAINING_DOCUMENT = 0x11; + + /** + * The target object is the topmost containing document object in the tab pane. + */ + const unsigned long RELATION_CONTAINING_TAB_PANE = 0x12; + + /** + * The target object is the containing window object. + */ + const unsigned long RELATION_CONTAINING_WINDOW = 0x13; + + /** + * The target object is the containing application object. + */ + const unsigned long RELATION_CONTAINING_APPLICATION = 0x14; + + /** + * The target object provides the detailed, extended description for this + * object. It provides more detailed information than would normally be + * provided using the DESCRIBED_BY relation. A common use for this relation is + * in digital publishing where an extended description needs to be conveyed in + * a book that requires structural markup or the embedding of other technology + * to provide illustrative content. + */ + const unsigned long RELATION_DETAILS = 0x15; + + /** + * This object provides the detailed, extended description for the target + * object. See DETAILS relation. + */ + const unsigned long RELATION_DETAILS_FOR = 0x16; + + /** + * The target object is the error message for this object. + */ + const unsigned long RELATION_ERRORMSG = 0x17; + + /** + * This object is the error message for the target object. + */ + const unsigned long RELATION_ERRORMSG_FOR = 0x18; + + /** + * The target object is the anchor referenced by this link. + */ + const unsigned long RELATION_LINKS_TO = 0x19; + + /** + * Returns the type of the relation. + */ + readonly attribute unsigned long relationType; + + /** + * Returns the number of targets for this relation. + */ + readonly attribute unsigned long targetsCount; + + /** + * Returns one accessible relation target. + * @param index - 0 based index of relation target. + */ + nsIAccessible getTarget(in unsigned long index); + + /** + * Returns multiple accessible relation targets. + */ + nsIArray getTargets(); +}; diff --git a/accessible/interfaces/nsIAccessibleRole.idl b/accessible/interfaces/nsIAccessibleRole.idl new file mode 100644 index 0000000000..e8024063c1 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleRole.idl @@ -0,0 +1,802 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +/** + * Defines cross platform (Gecko) roles. + */ +[scriptable, builtinclass, uuid(ad7f32a5-6d5f-4154-a5b8-0fa7aed48936)] +interface nsIAccessibleRole : nsISupports +{ + /** + * Used when the accessible has no strongly-defined role. + */ + const unsigned long ROLE_NOTHING = 0; + + /** + * Represents the menu bar (positioned beneath the title bar of a window) + * from which menus are selected by the user. The role is used by + * xul:menubar or role="menubar". + */ + const unsigned long ROLE_MENUBAR = 1; + + /** + * Represents a vertical or horizontal scroll bar, which is part of the client + * area or used in a control. + */ + const unsigned long ROLE_SCROLLBAR = 2; + + /** + * Represents an alert or a condition that a user should be notified about. + * Assistive Technologies typically respond to the role by reading the entire + * onscreen contents of containers advertising this role. Should be used for + * warning dialogs, etc. The role is used by xul:browsermessage, + * role="alert". + */ + const unsigned long ROLE_ALERT = 3; + + /** + * A sub-document (<frame> or <iframe>) + */ + const unsigned long ROLE_INTERNAL_FRAME = 4; + + /** + * Represents a menu, which presents a list of options from which the user can + * make a selection to perform an action. It is used for role="menu". + */ + const unsigned long ROLE_MENUPOPUP = 5; + + /** + * Represents a menu item, which is an entry in a menu that a user can choose + * to carry out a command, select an option. It is used for xul:menuitem, + * role="menuitem". + */ + const unsigned long ROLE_MENUITEM = 6; + + /** + * Represents a ToolTip that provides helpful hints. + */ + const unsigned long ROLE_TOOLTIP = 7; + + /** + * Represents a main window for an application. It is used for + * role="application". Also refer to ROLE_APP_ROOT + */ + const unsigned long ROLE_APPLICATION = 8; + + /** + * Represents a document window. A document window is always contained within + * an application window. For role="document", see NON_NATIVE_DOCUMENT. + */ + const unsigned long ROLE_DOCUMENT = 9; + + /** + * Represents a pane within a frame or document window. Users can navigate + * between panes and within the contents of the current pane, but cannot + * navigate between items in different panes. Thus, panes represent a level + * of grouping lower than frame windows or documents, but above individual + * controls. It is used for the first child of a <frame> or <iframe>. + */ + const unsigned long ROLE_PANE = 10; + + /** + * Represents a dialog box or message box. It is used for xul:dialog, + * role="dialog". + */ + const unsigned long ROLE_DIALOG = 11; + + /** + * Logically groups other objects. There is not always a parent-child + * relationship between the grouping object and the objects it contains. It + * is used for html:textfield, xul:groupbox, role="group". + */ + const unsigned long ROLE_GROUPING = 12; + + /** + * Used to visually divide a space into two regions, such as a separator menu + * item or a bar that divides split panes within a window. It is used for + * xul:separator, html:hr, role="separator". + */ + const unsigned long ROLE_SEPARATOR = 13; + + /** + * Represents a toolbar, which is a grouping of controls (push buttons or + * toggle buttons) that provides easy access to frequently used features. It + * is used for xul:toolbar, role="toolbar". + */ + const unsigned long ROLE_TOOLBAR = 14; + + /** + * Represents a status bar, which is an area at the bottom of a window that + * displays information about the current operation, state of the application, + * or selected object. The status bar has multiple fields, which display + * different kinds of information. It is used for xul:statusbar. + */ + const unsigned long ROLE_STATUSBAR = 15; + + /** + * Represents a table that contains rows and columns of cells, and optionally, + * row headers and column headers. It is used for html:table, + * role="grid". Also refer to the following roles: ROLE_COLUMNHEADER, + * ROLE_ROWHEADER, ROLE_ROW, ROLE_CELL. + */ + const unsigned long ROLE_TABLE = 16; + + /** + * Represents a column header, providing a visual label for a column in + * a table. It is used for XUL tree column headers, html:th, + * role="colheader". Also refer to ROLE_TABLE. + */ + const unsigned long ROLE_COLUMNHEADER = 17; + + /** + * Represents a row header, which provides a visual label for a table row. + * It is used for role="rowheader". Also, see ROLE_TABLE. + */ + const unsigned long ROLE_ROWHEADER = 18; + + /** + * Represents a row of cells within a table. Also, see ROLE_TABLE. + */ + const unsigned long ROLE_ROW = 19; + + /** + * Represents a cell within a table. It is used for html:td and xul:tree cell. + * Also, see ROLE_TABLE. + */ + const unsigned long ROLE_CELL = 20; + + /** + * Represents a link to something else. This object might look like text or + * a graphic, but it acts like a button. It is used for + * xul:label@class="text-link", html:a, html:area. + */ + const unsigned long ROLE_LINK = 21; + + /** + * Represents a list box, allowing the user to select one or more items. It + * is used for xul:listbox, html:select@size, role="list". See also + * ROLE_LIST_ITEM. + */ + const unsigned long ROLE_LIST = 22; + + /** + * Represents an item in a list. See also ROLE_LIST. + */ + const unsigned long ROLE_LISTITEM = 23; + + /** + * Represents an outline or tree structure, such as a tree view control, + * that displays a hierarchical list and allows the user to expand and + * collapse branches. Is is used for role="tree". + */ + const unsigned long ROLE_OUTLINE = 24; + + /** + * Represents an item in an outline or tree structure. It is used for + * role="treeitem". + */ + const unsigned long ROLE_OUTLINEITEM = 25; + + /** + * Represents a page tab, it is a child of a page tab list. It is used for + * xul:tab, role="treeitem". Also refer to ROLE_PAGETABLIST. + */ + const unsigned long ROLE_PAGETAB = 26; + + /** + * Represents a property sheet. It is used for xul:tabpanel, + * role="tabpanel". + */ + const unsigned long ROLE_PROPERTYPAGE = 27; + + /** + * Represents a picture. Is is used for xul:image, html:img. + */ + const unsigned long ROLE_GRAPHIC = 28; + + /** + * Represents read-only text, such as labels for other controls or + * instructions in a dialog box. Static text cannot be modified or selected. + * Is is used for xul:label, xul:description, html:label, role="label". + */ + const unsigned long ROLE_STATICTEXT = 29; + + /** + * Represents selectable text that allows edits or is designated read-only. + */ + const unsigned long ROLE_TEXT_LEAF = 30; + + /** + * Represents a push button control. It is used for xul:button, html:button, + * role="button". + */ + const unsigned long ROLE_PUSHBUTTON = 31; + + /** + * Represents a check box control. It is used for xul:checkbox, + * html:input@type="checkbox", role="checkbox". + */ + const unsigned long ROLE_CHECKBUTTON = 32; + + /** + * Represents an option button, also called a radio button. It is one of a + * group of mutually exclusive options. All objects sharing a single parent + * that have this attribute are assumed to be part of single mutually + * exclusive group. It is used for xul:radio, html:input@type="radio", + * role="radio". + */ + const unsigned long ROLE_RADIOBUTTON = 33; + + /** + * Represents a combo box; a popup button with an associated list box that + * provides a set of predefined choices. It is used for html:select with a + * size of 1 and xul:menulist. See also ROLE_EDITCOMBOBOX. + */ + const unsigned long ROLE_COMBOBOX = 34; + + /** + * Represents a progress bar, dynamically showing the user the percent + * complete of an operation in progress. It is used for html:progress, + * role="progressbar". + */ + const unsigned long ROLE_PROGRESSBAR = 35; + + /** + * Represents a slider, which allows the user to adjust a setting in given + * increments between minimum and maximum values. It is used by xul:scale, + * role="slider". + */ + const unsigned long ROLE_SLIDER = 36; + + /** + * Represents a spin box, which is a control that allows the user to increment + * or decrement the value displayed in a separate "buddy" control associated + * with the spin box. It is used for input[type=number] spin buttons. + */ + const unsigned long ROLE_SPINBUTTON = 37; + + /** + * Represents a graphical image used to diagram data. It is used for svg:svg. + */ + const unsigned long ROLE_DIAGRAM = 38; + + /** + * Represents an animation control, which contains content that changes over + * time, such as a control that displays a series of bitmap frames. + */ + const unsigned long ROLE_ANIMATION = 39; + + /** + * Represents a button that drops down a list of items. + */ + const unsigned long ROLE_BUTTONDROPDOWN = 40; + + /** + * Represents a button that drops down a menu. + */ + const unsigned long ROLE_BUTTONMENU = 41; + + /** + * Represents blank space between other objects. + */ + const unsigned long ROLE_WHITESPACE = 42; + + /** + * Represents a container of page tab controls. Is it used for xul:tabs, + * DHTML: role="tabs". Also refer to ROLE_PAGETAB. + */ + const unsigned long ROLE_PAGETABLIST = 43; + + /** + * Represents a control that can be drawn into and is used to trap events. + * It is used for html:canvas. + */ + const unsigned long ROLE_CANVAS = 44; + + /** + * Represents a menu item with a check box. + */ + const unsigned long ROLE_CHECK_MENU_ITEM = 45; + + /** + * Represents control whose purpose is to allow a user to edit a date. + */ + const unsigned long ROLE_DATE_EDITOR = 46; + + /** + * Frame role. A top level window with a title bar, border, menu bar, etc. + * It is often used as the primary window for an application. + */ + const unsigned long ROLE_CHROME_WINDOW = 47; + + /** + * Presents an icon or short string in an interface. + */ + const unsigned long ROLE_LABEL = 48; + + /** + * A text object uses for passwords, or other places where the text content + * is not shown visibly to the user. + */ + const unsigned long ROLE_PASSWORD_TEXT = 49; + + /** + * A radio button that is a menu item. + */ + const unsigned long ROLE_RADIO_MENU_ITEM = 50; + + /** + * Collection of objects that constitute a logical text entity. + */ + const unsigned long ROLE_TEXT_CONTAINER = 51; + + /** + * A toggle button. A specialized push button that can be checked or + * unchecked, but does not provide a separate indicator for the current state. + */ + const unsigned long ROLE_TOGGLE_BUTTON = 52; + + /** + * Representas a control that is capable of expanding and collapsing rows as + * well as showing multiple columns of data. + * XXX: it looks like this role is dupe of ROLE_OUTLINE. + */ + const unsigned long ROLE_TREE_TABLE = 53; + + /** + * A paragraph of text. + */ + const unsigned long ROLE_PARAGRAPH = 54; + + /** + * An control whose textual content may be entered or modified by the user. + */ + const unsigned long ROLE_ENTRY = 55; + + /** + * A caption describing another object. + */ + const unsigned long ROLE_CAPTION = 56; + + /** + * An element containing content that assistive technology users may want to + * browse in a reading mode, rather than a focus/interactive/application mode. + * This role is used for role="document". For the container which holds the + * content of a web page, see ROLE_DOCUMENT. + */ + const unsigned long ROLE_NON_NATIVE_DOCUMENT = 57; + + /** + * Heading. + */ + const unsigned long ROLE_HEADING = 58; + + /** + * A container of document content. An example of the use of this role is to + * represent an html:div. + */ + const unsigned long ROLE_SECTION = 59; + + /** + * A container of form controls. An example of the use of this role is to + * represent an html:form. + */ + const unsigned long ROLE_FORM = 60; + + /** + * XXX: document this. + */ + const unsigned long ROLE_APP_ROOT = 61; + + /** + * Represents a menu item, which is an entry in a menu that a user can choose + * to display another menu. + */ + const unsigned long ROLE_PARENT_MENUITEM = 62; + + /** + * A list of items that is shown by combobox. + */ + const unsigned long ROLE_COMBOBOX_LIST = 63; + + /** + * A item of list that is shown by combobox; + */ + const unsigned long ROLE_COMBOBOX_OPTION = 64; + + /** + * An image map -- has child links representing the areas + */ + const unsigned long ROLE_IMAGE_MAP = 65; + + /** + * An option in a listbox + */ + const unsigned long ROLE_OPTION = 66; + + /** + * A rich option in a listbox, it can have other widgets as children + */ + const unsigned long ROLE_RICH_OPTION = 67; + + /** + * A list of options + */ + const unsigned long ROLE_LISTBOX = 68; + + /** + * Represents a mathematical equation in the accessible name + */ + const unsigned long ROLE_FLAT_EQUATION = 69; + + /** + * Represents a cell within a grid. It is used for role="gridcell". Unlike + * ROLE_CELL, it allows the calculation of the accessible name from subtree. + * Also, see ROLE_TABLE. + */ + const unsigned long ROLE_GRID_CELL = 70; + + /** + * A note. Originally intended to be hidden until activated, but now also used + * for things like html 'aside'. + */ + const unsigned long ROLE_NOTE = 71; + + /** + * A figure. Used for things like HTML5 figure element. + */ + const unsigned long ROLE_FIGURE = 72; + + /** + * Represents a rich item with a check box. + */ + const unsigned long ROLE_CHECK_RICH_OPTION = 73; + + /** + * An HTML definition list <dl> + */ + const unsigned long ROLE_DEFINITION_LIST = 74; + + /** + * An HTML definition term <dt> + */ + const unsigned long ROLE_TERM = 75; + + /** + * An HTML definition <dd> + */ + const unsigned long ROLE_DEFINITION = 76; + + /** + * A keyboard or keypad key. + */ + const unsigned long ROLE_KEY = 77; + + /** + * A switch control widget. + */ + const unsigned long ROLE_SWITCH = 78; + + /** + * A block of MathML code (math). + */ + const unsigned long ROLE_MATHML_MATH = 79; + + /** + * A MathML identifier (mi in MathML). + */ + const unsigned long ROLE_MATHML_IDENTIFIER = 80; + + /** + * A MathML number (mn in MathML). + */ + const unsigned long ROLE_MATHML_NUMBER = 81; + + /** + * A MathML operator (mo in MathML). + */ + const unsigned long ROLE_MATHML_OPERATOR = 82; + + /** + * A MathML text (mtext in MathML). + */ + const unsigned long ROLE_MATHML_TEXT = 83; + + /** + * A MathML string literal (ms in MathML). + */ + const unsigned long ROLE_MATHML_STRING_LITERAL = 84; + + /** + * A MathML glyph (mglyph in MathML). + */ + const unsigned long ROLE_MATHML_GLYPH = 85; + + /** + * A MathML row (mrow in MathML). + */ + const unsigned long ROLE_MATHML_ROW = 86; + + /** + * A MathML fraction (mfrac in MathML). + */ + const unsigned long ROLE_MATHML_FRACTION = 87; + + /** + * A MathML square root (msqrt in MathML). + */ + const unsigned long ROLE_MATHML_SQUARE_ROOT = 88; + + /** + * A MathML root (mroot in MathML). + */ + const unsigned long ROLE_MATHML_ROOT = 89; + + /** + * A MathML enclosed element (menclose in MathML). + */ + const unsigned long ROLE_MATHML_ENCLOSED = 90; + + /** + * A MathML styling element (mstyle in MathML). + */ + const unsigned long ROLE_MATHML_STYLE = 91; + + /** + * A MathML subscript (msub in MathML). + */ + const unsigned long ROLE_MATHML_SUB = 92; + + /** + * A MathML superscript (msup in MathML). + */ + const unsigned long ROLE_MATHML_SUP = 93; + + /** + * A MathML subscript and superscript (msubsup in MathML). + */ + const unsigned long ROLE_MATHML_SUB_SUP = 94; + + /** + * A MathML underscript (munder in MathML). + */ + const unsigned long ROLE_MATHML_UNDER = 95; + + /** + * A MathML overscript (mover in MathML). + */ + const unsigned long ROLE_MATHML_OVER = 96; + + /** + * A MathML underscript and overscript (munderover in MathML). + */ + const unsigned long ROLE_MATHML_UNDER_OVER = 97; + + /** + * A MathML multiple subscript and superscript element (mmultiscripts in + * MathML). + */ + const unsigned long ROLE_MATHML_MULTISCRIPTS = 98; + + /** + * A MathML table (mtable in MathML). + */ + const unsigned long ROLE_MATHML_TABLE = 99; + + /** + * A MathML labelled table row (mlabeledtr in MathML). + */ + const unsigned long ROLE_MATHML_LABELED_ROW = 100; + + /** + * A MathML table row (mtr in MathML). + */ + const unsigned long ROLE_MATHML_TABLE_ROW = 101; + + /** + * A MathML table entry or cell (mtd in MathML). + */ + const unsigned long ROLE_MATHML_CELL = 102; + + /** + * A MathML interactive element (maction in MathML). + */ + const unsigned long ROLE_MATHML_ACTION = 103; + + /** + * A MathML error message (merror in MathML). + */ + const unsigned long ROLE_MATHML_ERROR = 104; + + /** + * A MathML stacked (rows of numbers) element (mstack in MathML). + */ + const unsigned long ROLE_MATHML_STACK = 105; + + /** + * A MathML long division element (mlongdiv in MathML). + */ + const unsigned long ROLE_MATHML_LONG_DIVISION = 106; + + /** + * A MathML stack group (msgroup in MathML). + */ + const unsigned long ROLE_MATHML_STACK_GROUP = 107; + + /** + * A MathML stack row (msrow in MathML). + */ + const unsigned long ROLE_MATHML_STACK_ROW = 108; + + /** + * MathML carries, borrows, or crossouts for a row (mscarries in MathML). + */ + const unsigned long ROLE_MATHML_STACK_CARRIES = 109; + + /** + * A MathML carry, borrow, or crossout for a column (mscarry in MathML). + */ + const unsigned long ROLE_MATHML_STACK_CARRY = 110; + + /** + * A MathML line in a stack (msline in MathML). + */ + const unsigned long ROLE_MATHML_STACK_LINE = 111; + + /** + * A group containing radio buttons + */ + const unsigned long ROLE_RADIO_GROUP = 112; + + /** + * A text container exposing brief amount of information. See related + * TEXT_CONTAINER role. + */ + const unsigned long ROLE_TEXT = 113; + + /** + * A text container exposing brief amount of information. See related + * DETAILS role. + */ + const unsigned long ROLE_DETAILS = 114; + + /** + * A text container exposing brief amount of information. See related + * SUMMARY role. + */ + const unsigned long ROLE_SUMMARY = 115; + + /** + * An ARIA landmark. See related NAVIGATION role. + */ + const unsigned long ROLE_LANDMARK = 116; + + /** + * A specific type of ARIA landmark. The ability to distinguish navigation + * landmarks from other types of landmarks is needed because macOS has a + * specific AXSubrole and AXRoleDescription for navigation landmarks. + */ + const unsigned long ROLE_NAVIGATION = 117; + + /** + * An object that contains the text of a footnote. + */ + const unsigned long ROLE_FOOTNOTE = 118; + + /** + * A complete or self-contained composition in a document, page, application, + * or site and that is, in principle, independently distributable or reusable, + * e.g. in syndication. + */ + const unsigned long ROLE_ARTICLE = 119; + + /** + * A perceivable section containing content that is relevant to a specific, + * author-specified purpose and sufficiently important that users will likely + * want to be able to navigate to the section easily and to have it listed in + * a summary of the page. + */ + const unsigned long ROLE_REGION = 120; + + /** + * Represents a control with a text input and a popup with a set of predefined + * choices. It is used for ARIA's combobox role. See also ROLE_COMBOBOX. + */ + const unsigned long ROLE_EDITCOMBOBOX = 121; + + /** + * A section of content that is quoted from another source. + */ + const unsigned long ROLE_BLOCKQUOTE = 122; + + /** + * Content previously deleted or proposed for deletion, e.g. in revision + * history or a content view providing suggestions from reviewers. + */ + const unsigned long ROLE_CONTENT_DELETION = 123; + + /** + * Content previously inserted or proposed for insertion, e.g. in revision + * history or a content view providing suggestions from reviewers. + */ + const unsigned long ROLE_CONTENT_INSERTION = 124; + + /** + * An html:form element with a label provided by WAI-ARIA. + * This may also be used if role="form" with a label should be exposed + * differently in the future. + */ + const unsigned long ROLE_FORM_LANDMARK = 125; + + /** + * The html:mark element. + * May also be used if WAI-ARIA gets an equivalent role. + */ + const unsigned long ROLE_MARK = 126; + + /** + * The WAI-ARIA suggestion role. + */ + const unsigned long ROLE_SUGGESTION = 127; + + /** + * The WAI-ARIA comment role. + */ + const unsigned long ROLE_COMMENT = 128; + + /** + * A snippet of program code. ATs might want to treat this differently. + */ + const unsigned long ROLE_CODE = 129; + + /** + * Represents control whose purpose is to allow a user to edit a time. + */ + const unsigned long ROLE_TIME_EDITOR = 130; + + /** + * Represents the marker associated with a list item. In unordered lists, + * this is a bullet, while in ordered lists this is a number. + */ + const unsigned long ROLE_LISTITEM_MARKER = 131; + + /** + * Essentially, this is a progress bar with a contextually defined + * scale, ex. the strength of a password entered in an input. + */ + const unsigned long ROLE_METER = 132; + + /** + * Represents phrasing content that is presented with vertical alignment + * lower than the baseline and a smaller font size. For example, the "2" in + * the chemical formula H2O. + */ + const unsigned long ROLE_SUBSCRIPT = 133; + + /** + * Represents phrasing content that is presented with vertical alignment + * higher than the baseline and a smaller font size. For example, the + * exponent in a math expression. + */ + const unsigned long ROLE_SUPERSCRIPT = 134; + + /** + * Represents one or more emphasized characters. Use this role to stress or + * emphasize content. + */ + const unsigned long ROLE_EMPHASIS = 135; + + /** + * Represents content that is important, serious, or urgent. + */ + const unsigned long ROLE_STRONG = 136; + + /** + * Represents a specific point in time. + */ + const unsigned long ROLE_TIME = 137; +}; diff --git a/accessible/interfaces/nsIAccessibleScrollingEvent.idl b/accessible/interfaces/nsIAccessibleScrollingEvent.idl new file mode 100644 index 0000000000..229d745793 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleScrollingEvent.idl @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/* + * An interface scroll events. + * Stores new scroll position and max scroll position. + */ +[scriptable, builtinclass, uuid(f75f0b32-5342-4d60-b1a5-b7bd6888eef5)] +interface nsIAccessibleScrollingEvent : nsIAccessibleEvent +{ + /** + * New X scroll position within a scrollable container in device pixels. + */ + readonly attribute unsigned long scrollX; + + /** + * New Y scroll position within a scrollable container in device pixels. + */ + readonly attribute unsigned long scrollY; + + /** + * Max X scroll position within a scrollable container in device pixels. + */ + readonly attribute unsigned long maxScrollX; + + /** + * Max Y scroll position within a scrollable container in device pixels. + */ + readonly attribute unsigned long maxScrollY; +}; diff --git a/accessible/interfaces/nsIAccessibleSelectable.idl b/accessible/interfaces/nsIAccessibleSelectable.idl new file mode 100644 index 0000000000..dff2677e20 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleSelectable.idl @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessible; +interface nsIArray; + +/** + * An accessibility interface for selectable widgets. + */ +[scriptable, builtinclass, uuid(8efb03d4-1354-4875-94cf-261336057626)] +interface nsIAccessibleSelectable : nsISupports +{ + /** + * Return an nsIArray of selected items within the widget. + */ + readonly attribute nsIArray selectedItems; + + /** + * Return the number of currently selected items. + */ + readonly attribute unsigned long selectedItemCount; + + /** + * Return a nth selected item within the widget. + */ + nsIAccessible getSelectedItemAt(in unsigned long index); + + /** + * Return true if the given item is selected. + */ + boolean isItemSelected(in unsigned long index); + + /** + * Adds the specified item to the widget's selection. + */ + void addItemToSelection(in unsigned long index); + + /** + * Removes the specified item from the widget's selection. + */ + void removeItemFromSelection(in unsigned long index); + + /** + * Select all items. + * + * @return false if the object does not accept multiple selection, + * otherwise true. + */ + boolean selectAll(); + + /** + * Unselect all items. + */ + void unselectAll(); +}; diff --git a/accessible/interfaces/nsIAccessibleStateChangeEvent.idl b/accessible/interfaces/nsIAccessibleStateChangeEvent.idl new file mode 100644 index 0000000000..4d7505d5bb --- /dev/null +++ b/accessible/interfaces/nsIAccessibleStateChangeEvent.idl @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when a state of an accessible changes. + */ +[scriptable, builtinclass, uuid(58b74954-1835-46ed-9ccd-c906490106f6)] +interface nsIAccessibleStateChangeEvent : nsIAccessibleEvent +{ + /** + * Returns the state of accessible (see constants declared + * in nsIAccessibleStates). + */ + readonly attribute unsigned long state; + + /** + * Returns true if the state is extra state. + */ + readonly attribute boolean isExtraState; + + /** + * Returns true if the state is turned on. + */ + readonly attribute boolean isEnabled; +}; diff --git a/accessible/interfaces/nsIAccessibleStates.idl b/accessible/interfaces/nsIAccessibleStates.idl new file mode 100644 index 0000000000..6d25e469c6 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleStates.idl @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, uuid(f1e0fbb7-fde4-4519-9383-2bcbee428513)] +interface nsIAccessibleStates : nsISupports +{ + /** + * MSAA State flags - used for bitfield. More than 1 allowed. + */ + const unsigned long STATE_UNAVAILABLE = 0x00000001; // Disabled, maps to opposite of Java ENABLED, Gnome/ATK SENSITIVE? + const unsigned long STATE_SELECTED = 0x00000002; + const unsigned long STATE_FOCUSED = 0x00000004; + const unsigned long STATE_PRESSED = 0x00000008; + const unsigned long STATE_CHECKED = 0x00000010; + const unsigned long STATE_MIXED = 0x00000020; // 3-state checkbox or toolbar button + const unsigned long STATE_READONLY = 0x00000040; // Maps to opposite of Java/Gnome/ATK EDITABLE state + const unsigned long STATE_HOTTRACKED = 0x00000080; + const unsigned long STATE_DEFAULT = 0x00000100; + const unsigned long STATE_EXPANDED = 0x00000200; + const unsigned long STATE_COLLAPSED = 0x00000400; + const unsigned long STATE_BUSY = 0x00000800; + const unsigned long STATE_FLOATING = 0x00001000; // Children "owned" not "contained" by parent + const unsigned long STATE_MARQUEED = 0x00002000; + const unsigned long STATE_ANIMATED = 0x00004000; + const unsigned long STATE_INVISIBLE = 0x00008000; // Programatically hidden + const unsigned long STATE_OFFSCREEN = 0x00010000; // Scrolled off + const unsigned long STATE_SIZEABLE = 0x00020000; + const unsigned long STATE_MOVEABLE = 0x00040000; + const unsigned long STATE_SELFVOICING = 0x00080000; + const unsigned long STATE_FOCUSABLE = 0x00100000; + const unsigned long STATE_SELECTABLE = 0x00200000; + const unsigned long STATE_LINKED = 0x00400000; + const unsigned long STATE_TRAVERSED = 0x00800000; + const unsigned long STATE_MULTISELECTABLE = 0x01000000; // Supports multiple selection + const unsigned long STATE_EXTSELECTABLE = 0x02000000; // Supports extended selection + const unsigned long STATE_ALERT_LOW = 0x04000000; // This information is of low priority + const unsigned long STATE_ALERT_MEDIUM = 0x08000000; // This information is of medium priority + const unsigned long STATE_ALERT_HIGH = 0x10000000; // This information is of high priority + const unsigned long STATE_PROTECTED = 0x20000000; // Maps to Gnome's *Role* ATK_ROLE_PASSWD_TEXT, nothing for Java? + const unsigned long STATE_HASPOPUP = 0x40000000; // New in MSAA 2.0 + + // Mapping important states that we don't have to unused alert states on MSAA + // as per discussions with AT vendors. On ATK there will be legitimate states for + // STATE_REQUIRED AND STATE_INVALID + const unsigned long STATE_REQUIRED = STATE_ALERT_LOW; + const unsigned long STATE_IMPORTANT = STATE_ALERT_MEDIUM; // Not currently used + const unsigned long STATE_INVALID = STATE_ALERT_HIGH; + const unsigned long STATE_CHECKABLE = STATE_MARQUEED; + +/** + * Extended state flags (for now non-MSAA, for Java and Gnome/ATK support) + * "Extended state flags" has separate value space from "MSAA State flags". + */ + const unsigned long EXT_STATE_SUPPORTS_AUTOCOMPLETION = 0x00000001; // For editable areas that have any kind of autocompletion + const unsigned long EXT_STATE_DEFUNCT = 0x00000002; // Object no longer exists + const unsigned long EXT_STATE_SELECTABLE_TEXT = 0x00000004; // For text which is selectable, object must implement nsIAccessibleText + const unsigned long EXT_STATE_EDITABLE = 0x00000008; // Implements nsIAccessibleEditableText + const unsigned long EXT_STATE_ACTIVE = 0x00000010; // This window is currently the active window + const unsigned long EXT_STATE_MODAL = 0x00000020; // Must do something with control before leaving it + const unsigned long EXT_STATE_MULTI_LINE = 0x00000040; // Edit control that can take multiple lines + const unsigned long EXT_STATE_HORIZONTAL = 0x00000080; // Uses horizontal layout + const unsigned long EXT_STATE_OPAQUE = 0x00000100; // Indicates this object paints every pixel within its rectangular region. + const unsigned long EXT_STATE_SINGLE_LINE = 0x00000200; // This text object can only contain 1 line of text + const unsigned long EXT_STATE_TRANSIENT = 0x00000400; // + const unsigned long EXT_STATE_VERTICAL = 0x00000800; // Especially used for sliders and scrollbars + const unsigned long EXT_STATE_STALE = 0x00001000; // Object not dead, but not up-to-date either + const unsigned long EXT_STATE_ENABLED = 0x00002000; // A widget that is not unavailable + const unsigned long EXT_STATE_SENSITIVE = 0x00004000; // Same as ENABLED for now + const unsigned long EXT_STATE_EXPANDABLE = 0x00008000; // If COLLAPSED or EXPANDED + const unsigned long EXT_STATE_PINNED = 0x00010000; // Indicates object is pinned. + const unsigned long EXT_STATE_CURRENT = 0x00020000; // Indicates object is the current item in its container +}; diff --git a/accessible/interfaces/nsIAccessibleTable.idl b/accessible/interfaces/nsIAccessibleTable.idl new file mode 100644 index 0000000000..ab4b60a5cc --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTable.idl @@ -0,0 +1,234 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessible; +interface nsIArray; + +[scriptable, builtinclass, uuid(cb0bf7b9-117e-40e2-9e46-189c3d43ce4a)] +interface nsIAccessibleTable : nsISupports +{ + /** + * Return the caption accessible for the table. For example, html:caption + * element of html:table element. + */ + readonly attribute nsIAccessible caption; + + /** + * Return summary description for the table. For example, @summary attribute + * on html:table element. + */ + readonly attribute AString summary; + + /** + * Return columns count in the table. + */ + readonly attribute long columnCount; + + /** + * Return rows count in the table. + */ + readonly attribute long rowCount; + + /** + * Return the accessible object at the specified row and column in the table. + * If both row and column index are valid then the corresponding accessible + * object is returned that represents the requested cell regardless of whether + * the cell is currently visible (on the screen). + * + * @param rowIndex [in] the row index to retrieve the cell at + * @param columnIndex [in] the column index to retrieve the cell at + */ + nsIAccessible getCellAt(in long rowIndex, in long columnIndex); + + /** + * Translate the given row and column indices into the corresponding cell + * index. + * + * @param rowIndex [in] the row index to return cell index at + * @param columnIndex [in] the column index to return cell index at + */ + long getCellIndexAt(in long rowIndex, in long columnIndex); + + /** + * Translate the given cell index into the corresponding column index. + * + * @param cellIndex [in] index of the table cell to return column index for + */ + long getColumnIndexAt(in long cellIndex); + + /** + * Translate the given cell index into the corresponding row index. + * + * @param cellIndex [in] index of the table cell to return row index for + */ + long getRowIndexAt(in long cellIndex); + + /** + * Translate the given cell index into the corresponding row and column + * indices. + * + * @param cellIndex [in] cell index to return row and column indices for + * @param rowIndex [out] row index at the given cell index + * @param columnIndex [out] column index at the given cell index + */ + void getRowAndColumnIndicesAt(in long cellIndex, + out long rowIndex, out long columnIndex); + + /** + * Return the number of columns occupied by the accessible cell at + * the specified row and column in the table. The result differs from 1 if + * the specified cell spans multiple columns. + * + * @param row [in] row index of the cell to return the column extent for + * @param column [in] column index of the cell to return the column extent + * for + */ + long getColumnExtentAt(in long row, in long column); + + /** + * Return the number of rows occupied by the accessible cell at the specified + * row and column in the table. The result differs from 1 if the specified + * cell spans multiple rows. + * + * @param row [in] row index of the cell to return the column extent for + * @param column [in] column index of the cell to return the column extent + * for + */ + long getRowExtentAt(in long row, in long column); + + /** + * Return the description text of the specified column in the table. + * + * @param columnIndex [in] the column index to retrieve description for + */ + AString getColumnDescription(in long columnIndex); + + /** + * Return the description text of the specified row in the table. + * + * @param rowIndex [in] the row index to retrieve description for + */ + AString getRowDescription(in long rowIndex); + + /** + * Return a boolean value indicating whether the specified column is + * selected, i.e. all cells within the column are selected. + * + * @param columnIndex [in] the column index to determine if it's selected + */ + boolean isColumnSelected(in long columnIndex); + + /** + * Return a boolean value indicating whether the specified row is selected, + * i.e. all cells within the row are selected. + * + * @param rowIndex [in] the row index to determine whether it's selected + */ + boolean isRowSelected(in long rowIndex); + + /** + * Return a boolean value indicating whether the specified cell is selected. + * + * @param rowIndex [in] the row index of the cell + * @param columnIndex [in] the column index of the cell + */ + boolean isCellSelected(in long rowIndex, in long columnIndex); + + /** + * Return the total number of selected cells. + */ + readonly attribute unsigned long selectedCellCount; + + /** + * Return the total number of selected columns. + */ + readonly attribute unsigned long selectedColumnCount; + + /** + * Return the total number of selected rows. + */ + readonly attribute unsigned long selectedRowCount; + + /** + * Return an array of selected cells. + */ + readonly attribute nsIArray selectedCells; + + /** + * Return an array of cell indices currently selected. + * + * @return array of indexes of selected cells + */ + Array<uint32_t> getSelectedCellIndices(); + + /** + * Return an array of column indices currently selected. + * + * @return array of indices of selected columns + */ + Array<uint32_t> getSelectedColumnIndices(); + + /** + * Return an array of row indices currently selected. + * + * @return array of indices of selected rows + */ + Array<uint32_t> getSelectedRowIndices(); + + /** + * Use heuristics to determine if table is most likely used for layout. + */ + boolean isProbablyForLayout(); +}; + + +[scriptable, builtinclass, uuid(654e296d-fae6-452b-987d-746b20b9514b)] +interface nsIAccessibleTableCell : nsISupports +{ + /** + * Return host table accessible. + */ + readonly attribute nsIAccessibleTable table; + + /** + * Return column index of this cell. + */ + readonly attribute long columnIndex; + + /** + * Return row index of this cell. + */ + readonly attribute long rowIndex; + + /** + * Return the number of columns occupied by this cell. The result differs + * from 1 if the specified cell spans multiple columns. + */ + readonly attribute long columnExtent; + + /** + * Return the number of rows occupied by this accessible cell. The result + * differs from 1 if the specified cell spans multiple rows. + */ + readonly attribute long rowExtent; + + /** + * Return an array of column header cells for this cell. + */ + readonly attribute nsIArray columnHeaderCells; + + /** + * Return an array of row header cells for this cell. + */ + readonly attribute nsIArray rowHeaderCells; + + /** + * Return a boolean value indicating whether this cell is selected. + */ + boolean isSelected(); +}; diff --git a/accessible/interfaces/nsIAccessibleTableChangeEvent.idl b/accessible/interfaces/nsIAccessibleTableChangeEvent.idl new file mode 100644 index 0000000000..f8804e6dae --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTableChangeEvent.idl @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +[scriptable, builtinclass, uuid(9fb3a8a4-d254-43d3-80a5-20e171d52b21)] +interface nsIAccessibleTableChangeEvent: nsIAccessibleEvent +{ + /** + * Return the row or column index. + */ + readonly attribute long rowOrColIndex; + + /** + * Return the number of rows or cols + */ + readonly attribute long RowsOrColsCount; +}; diff --git a/accessible/interfaces/nsIAccessibleText.idl b/accessible/interfaces/nsIAccessibleText.idl new file mode 100644 index 0000000000..5bd125c304 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleText.idl @@ -0,0 +1,220 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +typedef long AccessibleTextBoundary; + +interface nsIAccessible; +interface nsIArray; +interface nsIPersistentProperties; +interface nsIAccessibleTextRange; + +[scriptable, builtinclass, uuid(a4cc7576-45bb-44c5-b347-d9cb3ca4de9f)] +interface nsIAccessibleText : nsISupports +{ + // In parameters for character offsets: + // -1 will be treated as the equal to the end of the text + // -2 will be treated as the caret position + const int32_t TEXT_OFFSET_END_OF_TEXT = -1; + const int32_t TEXT_OFFSET_CARET = -2; + + const AccessibleTextBoundary BOUNDARY_CHAR = 0; + const AccessibleTextBoundary BOUNDARY_WORD_START = 1; + const AccessibleTextBoundary BOUNDARY_WORD_END = 2; + const AccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated + const AccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated + const AccessibleTextBoundary BOUNDARY_LINE_START = 5; + const AccessibleTextBoundary BOUNDARY_LINE_END = 6; + const AccessibleTextBoundary BOUNDARY_PARAGRAPH = 7; + + /** + * The current current caret offset. + * If set < 0 then caret will be placed at the end of the text + */ + attribute long caretOffset; + + void getCaretRect(out long x, out long y, out long width, out long height); + + readonly attribute long characterCount; + readonly attribute long selectionCount; + + /** + * String methods may need to return multibyte-encoded strings, + * since some locales can't be encoded using 16-bit chars. + * So the methods below might return UTF-16 strings, or they could + * return "string" values which are UTF-8. + */ + AString getText (in long startOffset, in long endOffset); + + AString getTextAfterOffset (in long offset, + in AccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + AString getTextAtOffset (in long offset, + in AccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + AString getTextBeforeOffset (in long offset, + in AccessibleTextBoundary boundaryType, + out long startOffset, + out long endOffset); + + /** + * It would be better to return an unsigned long here, + * to allow unicode chars > 16 bits + */ + wchar getCharacterAtOffset (in long offset); + + /** + * Get the accessible start/end offsets around the given offset, + * return the text attributes for this range of text. + * + * @param includeDefAttrs [in] points whether text attributes applied to + * the entire accessible should be included or not. + * @param offset [in] text offset + * @param rangeStartOffset [out] start offset of the range of text + * @param rangeEndOffset [out] end offset of the range of text + */ + nsIPersistentProperties getTextAttributes(in boolean includeDefAttrs, + in long offset, + out long rangeStartOffset, + out long rangeEndOffset); + + /** + * Return the text attributes that apply to the entire accessible. + */ + readonly attribute nsIPersistentProperties defaultTextAttributes; + + /** + * Returns the bounding box of the specified position. + * + * The virtual character after the last character of the represented text, + * i.e. the one at position length is a special case. It represents the + * current input position and will therefore typically be queried by AT more + * often than other positions. Because it does not represent an existing + * character its bounding box is defined in relation to preceding characters. + * It should be roughly equivalent to the bounding box of some character when + * inserted at the end of the text. Its height typically being the maximal + * height of all the characters in the text or the height of the preceding + * character, its width being at least one pixel so that the bounding box is + * not degenerate. + * + * @param offset - Index of the character for which to return its bounding + * box. The valid range is 0..length. + * @param x - X coordinate of the bounding box of the referenced character. + * @param y - Y coordinate of the bounding box of the referenced character. + * @param width - Width of the bounding box of the referenced character. + * @param height - Height of the bounding box of the referenced character. + * @param coordType - Specifies if the coordinates are relative to the screen + * or to the parent window (see constants declared in + * nsIAccessibleCoordinateType). + */ + void getCharacterExtents (in long offset, + out long x, + out long y, + out long width, + out long height, + in unsigned long coordType); + + void getRangeExtents (in long startOffset, + in long endOffset, + out long x, + out long y, + out long width, + out long height, + in unsigned long coordType); + + /** + * Get the text offset at the given point, or return -1 + * if no character exists at that point + * + * @param x - The position's x value for which to look up the index of the + * character that is rendered on to the display at that point. + * @param y - The position's y value for which to look up the index of the + * character that is rendered on to the display at that point. + * @param coordType - Screen coordinates or window coordinates (see constants + * declared in nsIAccessibleCoordinateType). + * @return offset - Index of the character under the given point or -1 if + * the point is invalid or there is no character under + * the point. + */ + long getOffsetAtPoint (in long x, in long y, + in unsigned long coordType); + + void getSelectionBounds (in long selectionNum, + out long startOffset, + out long endOffset); + + /** + * Set the bounds for the given selection range. + * A reverse range where the start offset is larger than the end offset is + * acceptable. The caretOffset will be set to the endOffset argument. + */ + void setSelectionBounds (in long selectionNum, + in long startOffset, + in long endOffset); + + void addSelection (in long startOffset, in long endOffset); + + void removeSelection (in long selectionNum); + + + /** + * Makes a specific part of string visible on screen. + * + * @param startIndex 0-based character offset + * @param endIndex 0-based character offset - the offset of the + * character just past the last character of the + * string + * @param scrollType defines how to scroll (see nsIAccessibleScrollType for + * available constants) + */ + void scrollSubstringTo(in long startIndex, in long endIndex, + in unsigned long scrollType); + + /** + * Moves the top left of a substring to a specified location. + * + * @param startIndex 0-based character offset + * @param endIndex 0-based character offset - the offset of the + * character just past the last character of + * the string + * @param coordinateType specifies the coordinates origin (for available + * constants refer to nsIAccessibleCoordinateType) + * @param x defines the x coordinate + * @param y defines the y coordinate + */ + void scrollSubstringToPoint(in long startIndex, in long endIndex, + in unsigned long coordinateType, + in long x, in long y); + + /** + * Return an array of disjoint ranges for selected text within the text control + * or otherwise the document this accessible belongs to. + */ + readonly attribute nsIArray selectionRanges; +}; + +/* + Assumptions: + + Using wstring (UCS2) instead of string encoded in UTF-8. + Multibyte encodings (or at least potentially multi-byte + encodings) would be preferred for the reasons cited above. + + The following methods will throw an exception on failure + (since not every text component will allow every operation): + setSelectionBounds, addSelection, removeSelection, setCaretOffset. + + we assume that all text components support the idea of + a caret offset, whether visible or "virtual". If this + isn't the case, caretOffset can be made readonly and + a setCaretOffset method provided which throws an exception + on failure (as with *selection methods above). +*/ diff --git a/accessible/interfaces/nsIAccessibleTextChangeEvent.idl b/accessible/interfaces/nsIAccessibleTextChangeEvent.idl new file mode 100644 index 0000000000..4aaadb8671 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTextChangeEvent.idl @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +/** + * Fired when an accessible's text changes. + */ +[scriptable, builtinclass, uuid(1fcc0dfa-93e6-48f4-bbd4-f80eb1d9f2e6)] +interface nsIAccessibleTextChangeEvent : nsIAccessibleEvent +{ + /** + * Returns offset of changed text in accessible. + */ + readonly attribute long start; + + /** + * Returns length of changed text. + */ + readonly attribute unsigned long length; + + /** + * Returns true if text was inserted, otherwise false. + */ + readonly attribute boolean isInserted; + + /** + * The inserted or removed text + */ + readonly attribute AString modifiedText; +}; diff --git a/accessible/interfaces/nsIAccessibleTextLeafRange.idl b/accessible/interfaces/nsIAccessibleTextLeafRange.idl new file mode 100644 index 0000000000..00b9cc4cad --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTextLeafRange.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIArray.idl" +#include "nsIAccessibleText.idl" + +interface nsIAccessible; + +[scriptable, builtinclass, uuid(9181e777-8954-4f8f-8cee-32f9771e40d7)] +interface nsIAccessibleTextLeafPoint : nsISupports +{ + attribute nsIAccessible accessible; + + attribute long offset; + + /** + * Find a boundary (word start, line start, etc.) in a specific direction. + * If no boundary is found, the start/end of the document is returned + * (depending on the direction). + * + * @param aBoundaryType [in] the boundary type to search for + * @param aDirection [in] search next or previous + * @param aFlags [in] optional flags for search + */ + nsIAccessibleTextLeafPoint findBoundary(in AccessibleTextBoundary aBoundaryType, + in unsigned long aDirection, + in unsigned long aFlags); + + const long DIRECTION_NEXT = 0x0; + const long DIRECTION_PREVIOUS = 0x1; + + // Keep these flags up to date with the ones in TextLeafPoint. + const unsigned long BOUNDARY_FLAG_DEFAULT = 0x0; + // If current point is a matching boundary, return unchanged. + const unsigned long BOUNDARY_FLAG_INCLUDE_ORIGIN = 0x1; + // Do not search past end of editables. + const unsigned long BOUNDARY_FLAG_STOP_IN_EDITABLE = 0x2; + // Skip over list items in searches and don't consider them line or paragraph starts. + const unsigned long BOUNDARY_FLAG_SKIP_LIST_ITEM_MARKER = 0x4; +}; diff --git a/accessible/interfaces/nsIAccessibleTextRange.idl b/accessible/interfaces/nsIAccessibleTextRange.idl new file mode 100644 index 0000000000..5a3e6facaf --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTextRange.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIAccessible; +interface nsIAccessibleText; +interface nsIArray; +interface nsIVariant; + +/** + * A range representing a piece of text in the document. + */ +[scriptable, builtinclass, uuid(c4515623-55f9-4543-a3d5-c1e9afa588f4)] +interface nsIAccessibleTextRange : nsISupports +{ + readonly attribute nsIAccessibleText startContainer; + readonly attribute long startOffset; + readonly attribute nsIAccessibleText endContainer; + readonly attribute long endOffset; + + /** + * Return an accessible containing the whole range + */ + readonly attribute nsIAccessible container; + + /** + * Return true if this range has the same end points of the given range. + */ + boolean compare(in nsIAccessibleTextRange aOtherRange); + + /** + * The two endpoints of the range (starting and ending). + */ + const unsigned long EndPoint_Start = 1; + const unsigned long EndPoint_End = 2; + + /** + * Compare this and given ranges end points. + * + * @return -1/0/1 if this range end point is before/equal/after the given + * range end point. + */ + long compareEndPoints(in unsigned long aEndPoint, + in nsIAccessibleTextRange aOtherRange, + in unsigned long aOtherRangeEndPoint); + + /** + * Crops the range by the given accessible element. + */ + boolean crop(in nsIAccessible aContainer); + + const unsigned long AlignToTop = 0; + const unsigned long AlignToBottom = 1; +}; diff --git a/accessible/interfaces/nsIAccessibleTextSelectionChangeEvent.idl b/accessible/interfaces/nsIAccessibleTextSelectionChangeEvent.idl new file mode 100644 index 0000000000..6ca09192ef --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTextSelectionChangeEvent.idl @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIAccessibleEvent.idl" + +interface nsIArray; + +/** + * Fired when the caret changes position in text. + */ +[scriptable, builtinclass, uuid(011f98e2-2beb-4ec3-97a5-f154f624e112)] +interface nsIAccessibleTextSelectionChangeEvent: nsIAccessibleEvent +{ + /** + * Return an array of disjoint ranges for selected text within the + * source of this event. + */ + readonly attribute nsIArray selectionRanges; +}; diff --git a/accessible/interfaces/nsIAccessibleTypes.idl b/accessible/interfaces/nsIAccessibleTypes.idl new file mode 100644 index 0000000000..913636d2b0 --- /dev/null +++ b/accessible/interfaces/nsIAccessibleTypes.idl @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +/** + * These constants control the scrolling of an object or substring into a + * window. Note, keep them synchronized with IA2ScrollType. + */ +[scriptable, builtinclass, uuid(05cd38b1-94b3-4cdf-8371-3935a9611405)] +interface nsIAccessibleScrollType : nsISupports +{ + /** + * Scroll the top left of the object or substring to the top left of the + * window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_TOP_LEFT =0x00; + + /** + * Scroll the bottom right of the object or substring to the bottom right of + * the window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_BOTTOM_RIGHT = 0x01; + + /** + * Scroll the top edge of the object or substring to the top edge of the + * window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_TOP_EDGE = 0x02; + + /** + * Scroll the bottom edge of the object or substring to the bottom edge of + * the window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_BOTTOM_EDGE = 0x03; + + /** + * Scroll the left edge of the object or substring to the left edge of the + * window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_LEFT_EDGE =0x04; + + /** + * Scroll the right edge of the object or substring to the right edge of the + * window (or as close as possible). + */ + const unsigned long SCROLL_TYPE_RIGHT_EDGE = 0x05; + + /** + * Scroll an object the minimum amount necessary in order for the entire + * frame to be visible (if possible). + */ + const unsigned long SCROLL_TYPE_ANYWHERE = 0x06; +}; + + +/** + * These constants define which coordinate system a point is located in. + */ +[scriptable, builtinclass, uuid(c9fbdf10-619e-436f-bf4b-8566686f1577)] +interface nsIAccessibleCoordinateType : nsISupports +{ + /** + * The coordinates are relative to the screen. + */ + const unsigned long COORDTYPE_SCREEN_RELATIVE = 0x00; + + /** + * The coordinates are relative to the window. + */ + const unsigned long COORDTYPE_WINDOW_RELATIVE = 0x01; + + /** + * The coordinates are relative to the upper left corner of the bounding box + * of the immediate parent. + */ + const unsigned long COORDTYPE_PARENT_RELATIVE = 0x02; +}; diff --git a/accessible/interfaces/nsIAccessibleValue.idl b/accessible/interfaces/nsIAccessibleValue.idl new file mode 100644 index 0000000000..886fcb8fed --- /dev/null +++ b/accessible/interfaces/nsIAccessibleValue.idl @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, builtinclass, uuid(42a1e1dc-58cf-419d-bff0-ed3314c70016)] +interface nsIAccessibleValue : nsISupports +{ + readonly attribute double maximumValue; + readonly attribute double minimumValue; + attribute double currentValue; + readonly attribute double minimumIncrement; +}; + +/* + Assumptions: + + The attribute currentValue will throw an exception + if it cannot be set i.e. if the value is not a + member of the interval. + This may not be the 'desired' behaviour given gObject + equivalent. Thus it could be changed to be: + + readonly attribute double currentValue; + boolean setCurrentValue (double long value); + + GValue can represent many basic types. + Since this interface is designed to represent + an interval and a member of double should + cover the cases of char int and float. + +*/ |