NVDA Helper
In-process and lite high-speed utilities for NVDA
ia2utils.cpp File Reference
#include <string>
#include <map>
#include "ia2utils.h"
#include <ia2.h>

Go to the source code of this file.

Functions

bool fetchIA2Attributes (IAccessible2 *pacc2, map< wstring, wstring > &attribsMap)
 
void IA2AttribsToMap (const wstring &attribsString, map< wstring, wstring > &attribsMap)
 Convert an IAccessible2 attributes string to a map of attribute keys and values.
 
std::pair< std::vector< CComVariant >, HRESULTgetAccessibleChildren (IAccessible *pacc, long indexOfFirstChild, long maxChildCount)
 Helper to collect the children for an IAccessible, uses memory managed types that will clear / delete automatically.
 
unique_ptr< HyperlinkGettermakeHyperlinkGetter (IAccessible2 *acc)
 Create an appropriate HyperlinkGetter to retrieve hyperlinks (embedded objects) if they are supported.
 

Function Documentation

◆ fetchIA2Attributes()

bool fetchIA2Attributes ( IAccessible2 * pacc2,
map< wstring, wstring > & attribsMap )

◆ IA2AttribsToMap()

void IA2AttribsToMap ( const std::wstring & attribsString,
std::map< std::wstring, std::wstring > & attribsMap )

Convert an IAccessible2 attributes string to a map of attribute keys and values.

An IAccessible2 attributes string is of the form "name:value;name:value;...;" Colons and semi-colons must be escaped with a backslash character. An invalid attributes string does not cause an error, but strange results may be returned.

Note
: Sub-attributes are currently not handled in any special way.
Parameters
attribsStringThe IAccessible2 attributes string to convert.
attribsMapThe map into which the attributes should be placed, with keys and values as strings.

Referenced by createMapOfIA2AttributesFromPacc(), and fetchIA2Attributes().

◆ getAccessibleChildren()

std::pair< std::vector< CComVariant >, HRESULT > getAccessibleChildren ( IAccessible * pacc,
long indexOfFirstChild,
long maxChildCount )

Helper to collect the children for an IAccessible, uses memory managed types that will clear / delete automatically.

Referenced by getTextFromIAccessible(), and lotusNotesRichTextVBufBackend_t::render().

◆ makeHyperlinkGetter()

unique_ptr< HyperlinkGetter > makeHyperlinkGetter ( IAccessible2 * acc)

Create an appropriate HyperlinkGetter to retrieve hyperlinks (embedded objects) if they are supported.

IAccessibleHypertext2 will be used in preference to IAccessibleHypertext.

Parameters
accThe accessible to use.
Returns
A pointer to the HyperlinkGetter or a null pointer if hyperlinks aren't supported.