NVDA Helper
In-process and lite high-speed utilities for NVDA
ia2utils.h File Reference
#include <atlcomcli.h>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <memory>
#include <ia2.h>

Go to the source code of this file.

Classes

class  HyperlinkGetter
 Base class to support retrieving hyperlinks (embedded objects) from IAccessibleHypertext or IAccessibleHypertext2. More...
 
class  HtHyperlinkGetter
 Supports retrieval of hyperlinks from IAccessibleHypertext. More...
 
class  Ht2HyperlinkGetter
 Supports retrieval of hyperlinks from IAccessibleHypertext2. More...
 

Functions

bool fetchIA2Attributes (IAccessible2 *pacc2, std::map< std::wstring, std::wstring > &attribsMap)
 
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.
 
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.
 
std::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,
std::map< std::wstring, std::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()

std::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.