Qt 4.8
Public Functions | Properties | List of all members
QWindowsAccessible Class Reference
Inheritance diagram for QWindowsAccessible:
QAccessible

Public Functions

HRESULT STDMETHODCALLTYPE accDoDefaultAction (VARIANT varID)
 
HRESULT STDMETHODCALLTYPE accHitTest (long xLeft, long yTop, VARIANT *pvarID)
 
HRESULT STDMETHODCALLTYPE accLocation (long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID)
 
HRESULT STDMETHODCALLTYPE accNavigate (long navDir, VARIANT varStart, VARIANT *pvarEnd)
 
HRESULT STDMETHODCALLTYPE accSelect (long flagsSelect, VARIANT varID)
 
ULONG STDMETHODCALLTYPE AddRef ()
 
HRESULT STDMETHODCALLTYPE ContextSensitiveHelp (BOOL fEnterMode)
 
HRESULT STDMETHODCALLTYPE get_accChild (VARIANT varChildID, IDispatch **ppdispChild)
 
HRESULT STDMETHODCALLTYPE get_accChildCount (long *pcountChildren)
 
HRESULT STDMETHODCALLTYPE get_accDefaultAction (VARIANT varID, BSTR *pszDefaultAction)
 
HRESULT STDMETHODCALLTYPE get_accDescription (VARIANT varID, BSTR *pszDescription)
 
HRESULT STDMETHODCALLTYPE get_accFocus (VARIANT *pvarID)
 
HRESULT STDMETHODCALLTYPE get_accHelp (VARIANT varID, BSTR *pszHelp)
 
HRESULT STDMETHODCALLTYPE get_accHelpTopic (BSTR *pszHelpFile, VARIANT varChild, long *pidTopic)
 
HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut (VARIANT varID, BSTR *pszKeyboardShortcut)
 
HRESULT STDMETHODCALLTYPE get_accName (VARIANT varID, BSTR *pszName)
 
HRESULT STDMETHODCALLTYPE get_accParent (IDispatch **ppdispParent)
 
HRESULT STDMETHODCALLTYPE get_accRole (VARIANT varID, VARIANT *pvarRole)
 
HRESULT STDMETHODCALLTYPE get_accSelection (VARIANT *pvarChildren)
 
HRESULT STDMETHODCALLTYPE get_accState (VARIANT varID, VARIANT *pvarState)
 
HRESULT STDMETHODCALLTYPE get_accValue (VARIANT varID, BSTR *pszValue)
 
HRESULT STDMETHODCALLTYPE GetIDsOfNames (const _GUID &, wchar_t **, unsigned int, unsigned long, long *)
 
HRESULT STDMETHODCALLTYPE GetTypeInfo (unsigned int, unsigned long, ITypeInfo **)
 
HRESULT STDMETHODCALLTYPE GetTypeInfoCount (unsigned int *)
 
HRESULT STDMETHODCALLTYPE GetWindow (HWND *phwnd)
 
HRESULT STDMETHODCALLTYPE Invoke (long, const _GUID &, unsigned long, unsigned short, tagDISPPARAMS *, tagVARIANT *, tagEXCEPINFO *, unsigned int *)
 
HRESULT STDMETHODCALLTYPE put_accName (VARIANT varChild, BSTR szName)
 
HRESULT STDMETHODCALLTYPE put_accValue (VARIANT varChild, BSTR szValue)
 
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID, LPVOID *)
 
 QWindowsAccessible (QAccessibleInterface *a)
 
ULONG STDMETHODCALLTYPE Release ()
 
virtual ~QWindowsAccessible ()
 

Properties

QAccessibleInterfaceaccessible
 
ULONG ref
 

Additional Inherited Members

- Private Types inherited from QAccessible
enum  Action {
  DefaultAction = 0, Press = -1, FirstStandardAction = Press, SetFocus = -2,
  Increase = -3, Decrease = -4, Accept = -5, Cancel = -6,
  Select = -7, ClearSelection = -8, RemoveSelection = -9, ExtendSelection = -10,
  AddToSelection = -11, LastStandardAction = AddToSelection
}
 This enum describes the possible types of action that can occur. More...
 
enum  Event {
  SoundPlayed = 0x0001, Alert = 0x0002, ForegroundChanged = 0x0003, MenuStart = 0x0004,
  MenuEnd = 0x0005, PopupMenuStart = 0x0006, PopupMenuEnd = 0x0007, ContextHelpStart = 0x000C,
  ContextHelpEnd = 0x000D, DragDropStart = 0x000E, DragDropEnd = 0x000F, DialogStart = 0x0010,
  DialogEnd = 0x0011, ScrollingStart = 0x0012, ScrollingEnd = 0x0013, MenuCommand = 0x0018,
  ActionChanged = 0x0101, ActiveDescendantChanged = 0x0102, AttributeChanged = 0x0103, DocumentContentChanged = 0x0104,
  DocumentLoadComplete = 0x0105, DocumentLoadStopped = 0x0106, DocumentReload = 0x0107, HyperlinkEndIndexChanged = 0x0108,
  HyperlinkNumberOfAnchorsChanged = 0x0109, HyperlinkSelectedLinkChanged = 0x010A, HypertextLinkActivated = 0x010B, HypertextLinkSelected = 0x010C,
  HyperlinkStartIndexChanged = 0x010D, HypertextChanged = 0x010E, HypertextNLinksChanged = 0x010F, ObjectAttributeChanged = 0x0110,
  PageChanged = 0x0111, SectionChanged = 0x0112, TableCaptionChanged = 0x0113, TableColumnDescriptionChanged = 0x0114,
  TableColumnHeaderChanged = 0x0115, TableModelChanged = 0x0116, TableRowDescriptionChanged = 0x0117, TableRowHeaderChanged = 0x0118,
  TableSummaryChanged = 0x0119, TextAttributeChanged = 0x011A, TextCaretMoved = 0x011B, TextColumnChanged = 0x011D,
  TextInserted = 0x011E, TextRemoved = 0x011F, TextUpdated = 0x0120, TextSelectionChanged = 0x0121,
  VisibleDataChanged = 0x0122, ObjectCreated = 0x8000, ObjectDestroyed = 0x8001, ObjectShow = 0x8002,
  ObjectHide = 0x8003, ObjectReorder = 0x8004, Focus = 0x8005, Selection = 0x8006,
  SelectionAdd = 0x8007, SelectionRemove = 0x8008, SelectionWithin = 0x8009, StateChanged = 0x800A,
  LocationChanged = 0x800B, NameChanged = 0x800C, DescriptionChanged = 0x800D, ValueChanged = 0x800E,
  ParentChanged = 0x800F, HelpChanged = 0x80A0, DefaultActionChanged = 0x80B0, AcceleratorChanged = 0x80C0
}
 This enum type defines accessible event types. More...
 
typedef QAccessibleInterface *(* InterfaceFactory) (const QString &key, QObject *)
 This is a typedef for a pointer to a function with the following signature: More...
 
enum  Method {
  ListSupportedMethods = 0, SetCursorPosition = 1, GetCursorPosition = 2, ForegroundColor = 3,
  BackgroundColor = 4
}
 This enum describes the possible types of methods that can be invoked on an accessible object. More...
 
enum  RelationFlag {
  Unrelated = 0x00000000, Self = 0x00000001, Ancestor = 0x00000002, Child = 0x00000004,
  Descendent = 0x00000008, Sibling = 0x00000010, HierarchyMask = 0x000000ff, Up = 0x00000100,
  Down = 0x00000200, Left = 0x00000400, Right = 0x00000800, Covers = 0x00001000,
  Covered = 0x00002000, GeometryMask = 0x0000ff00, FocusChild = 0x00010000, Label = 0x00020000,
  Labelled = 0x00040000, Controller = 0x00080000, Controlled = 0x00100000, LogicalMask = 0x00ff0000
}
 This enum type defines bit flags that can be combined to indicate the relationship between two accessible objects. More...
 
enum  Role {
  NoRole = 0x00000000, TitleBar = 0x00000001, MenuBar = 0x00000002, ScrollBar = 0x00000003,
  Grip = 0x00000004, Sound = 0x00000005, Cursor = 0x00000006, Caret = 0x00000007,
  AlertMessage = 0x00000008, Window = 0x00000009, Client = 0x0000000A, PopupMenu = 0x0000000B,
  MenuItem = 0x0000000C, ToolTip = 0x0000000D, Application = 0x0000000E, Document = 0x0000000F,
  Pane = 0x00000010, Chart = 0x00000011, Dialog = 0x00000012, Border = 0x00000013,
  Grouping = 0x00000014, Separator = 0x00000015, ToolBar = 0x00000016, StatusBar = 0x00000017,
  Table = 0x00000018, ColumnHeader = 0x00000019, RowHeader = 0x0000001A, Column = 0x0000001B,
  Row = 0x0000001C, Cell = 0x0000001D, Link = 0x0000001E, HelpBalloon = 0x0000001F,
  Assistant = 0x00000020, List = 0x00000021, ListItem = 0x00000022, Tree = 0x00000023,
  TreeItem = 0x00000024, PageTab = 0x00000025, PropertyPage = 0x00000026, Indicator = 0x00000027,
  Graphic = 0x00000028, StaticText = 0x00000029, EditableText = 0x0000002A, PushButton = 0x0000002B,
  CheckBox = 0x0000002C, RadioButton = 0x0000002D, ComboBox = 0x0000002E, ProgressBar = 0x00000030,
  Dial = 0x00000031, HotkeyField = 0x00000032, Slider = 0x00000033, SpinBox = 0x00000034,
  Canvas = 0x00000035, Animation = 0x00000036, Equation = 0x00000037, ButtonDropDown = 0x00000038,
  ButtonMenu = 0x00000039, ButtonDropGrid = 0x0000003A, Whitespace = 0x0000003B, PageTabList = 0x0000003C,
  Clock = 0x0000003D, Splitter = 0x0000003E, LayeredPane = 0x0000003F, Terminal = 0x00000040,
  Desktop = 0x00000041, UserRole = 0x0000ffff
}
 This enum defines the role of an accessible object. More...
 
typedef void(* RootObjectHandler) (QObject *)
 A function pointer type. More...
 
enum  StateFlag {
  Normal = 0x00000000, Unavailable = 0x00000001, Selected = 0x00000002, Focused = 0x00000004,
  Pressed = 0x00000008, Checked = 0x00000010, Mixed = 0x00000020, ReadOnly = 0x00000040,
  HotTracked = 0x00000080, DefaultButton = 0x00000100, Expanded = 0x00000200, Collapsed = 0x00000400,
  Busy = 0x00000800, Marqueed = 0x00002000, Animated = 0x00004000, Invisible = 0x00008000,
  Offscreen = 0x00010000, Sizeable = 0x00020000, Movable = 0x00040000, SelfVoicing = 0x00080000,
  Focusable = 0x00100000, Selectable = 0x00200000, Linked = 0x00400000, Traversed = 0x00800000,
  MultiSelectable = 0x01000000, ExtSelectable = 0x02000000, Protected = 0x20000000, HasPopup = 0x40000000,
  Modal = 0x80000000, HasInvokeExtension = 0x10000000
}
 This enum type defines bit flags that can be combined to indicate the state of an accessible object. More...
 
enum  Text {
  Name = 0, Description, Value, Help,
  Accelerator, UserText = 0x0000ffff
}
 This enum specifies string information that an accessible object returns. More...
 
typedef void(* UpdateHandler) (QObject *, int who, Event reason)
 A function pointer type. More...
 
- Static Private Functions inherited from QAccessible
static void cleanup ()
 
static void initialize ()
 
static void installFactory (InterfaceFactory)
 Installs the InterfaceFactory factory. More...
 
static RootObjectHandler installRootObjectHandler (RootObjectHandler)
 Installs the given handler as the function to be used by setRootObject(), and returns the previously installed handler. More...
 
static UpdateHandler installUpdateHandler (UpdateHandler)
 Installs the given handler as the function to be used by updateAccessibility(), and returns the previously installed handler. More...
 
static bool isActive ()
 Returns true if an accessibility implementation has been requested during the runtime of the application; otherwise returns false. More...
 
static QAccessibleInterfacequeryAccessibleInterface (QObject *)
 If a QAccessibleInterface implementation exists for the given object, this function returns a pointer to the implementation; otherwise it returns 0. More...
 
static void removeFactory (InterfaceFactory)
 Removes factory from the list of installed InterfaceFactories. More...
 
static void setRootObject (QObject *)
 Sets the root accessible object of this application to object. More...
 
static void updateAccessibility (QObject *, int who, Event reason)
 Notifies accessibility clients about a change in object's accessibility information. More...
 

Detailed Description

Definition at line 648 of file qaccessible_win.cpp.

Constructors and Destructors

◆ QWindowsAccessible()

QWindowsAccessible::QWindowsAccessible ( QAccessibleInterface a)
inline

Definition at line 651 of file qaccessible_win.cpp.

652  : ref(0), accessible(a)
653  {
654  }
QAccessibleInterface * accessible

◆ ~QWindowsAccessible()

virtual QWindowsAccessible::~QWindowsAccessible ( )
inlinevirtual

Definition at line 656 of file qaccessible_win.cpp.

657  {
658  delete accessible;
659  }
QAccessibleInterface * accessible

Functions

◆ accDoDefaultAction()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accDoDefaultAction ( VARIANT  varID)

Definition at line 1192 of file qaccessible_win.cpp.

1193 {
1194  showDebug(__FUNCTION__, accessible);
1195  if (!accessible->isValid())
1196  return E_FAIL;
1197 
1198  AccessibleElement elem(varID.lVal, accessible);
1199  const bool res = elem.iface ? elem.iface->doAction(DefaultAction, elem.entry, QVariantList()) : false;
1200  return res ? S_OK : S_FALSE;
1201 }
QAccessibleInterface * accessible
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ accHitTest()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accHitTest ( long  xLeft,
long  yTop,
VARIANT *  pvarID 
)

Definition at line 996 of file qaccessible_win.cpp.

997 {
998  showDebug(__FUNCTION__, accessible);
999  if (!accessible->isValid())
1000  return E_FAIL;
1001 
1002  int control = accessible->childAt(xLeft, yTop);
1003  if (control == -1) {
1004  (*pvarID).vt = VT_EMPTY;
1005  return S_FALSE;
1006  }
1007  QAccessibleInterface *acc = 0;
1008  if (control)
1009  accessible->navigate(Child, control, &acc);
1010  if (!acc) {
1011  (*pvarID).vt = VT_I4;
1012  (*pvarID).lVal = control;
1013  return S_OK;
1014  }
1015 
1016  QWindowsAccessible* wacc = new QWindowsAccessible(acc);
1017  IDispatch *iface = 0;
1018  wacc->QueryInterface(IID_IDispatch, (void**)&iface);
1019  if (iface) {
1020  (*pvarID).vt = VT_DISPATCH;
1021  (*pvarID).pdispVal = iface;
1022  return S_OK;
1023  } else {
1024  delete wacc;
1025  }
1026 
1027  (*pvarID).vt = VT_EMPTY;
1028  return S_FALSE;
1029 }
QAccessibleInterface * accessible
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
QWindowsAccessible(QAccessibleInterface *a)
virtual int childAt(int x, int y) const =0
Returns the 1-based index of the child that contains the screen coordinates (x, y).
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)

◆ accLocation()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accLocation ( long *  pxLeft,
long *  pyTop,
long *  pcxWidth,
long *  pcyHeight,
VARIANT  varID 
)

Definition at line 1031 of file qaccessible_win.cpp.

1032 {
1033  showDebug(__FUNCTION__, accessible);
1034  if (!accessible->isValid())
1035  return E_FAIL;
1036 
1037  AccessibleElement elem(varID.lVal, accessible);
1038  QRect rect = elem.iface ? elem.iface->rect(elem.entry) : QRect();
1039  if (rect.isValid()) {
1040  *pxLeft = rect.x();
1041  *pyTop = rect.y();
1042  *pcxWidth = rect.width();
1043  *pcyHeight = rect.height();
1044  } else {
1045  *pxLeft = 0;
1046  *pyTop = 0;
1047  *pcxWidth = 0;
1048  *pcyHeight = 0;
1049  }
1050  return S_OK;
1051 }
QAccessibleInterface * accessible
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
int y() const
Returns the y-coordinate of the rectangle's top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle's left edge.
Definition: qrect.h:252
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define showDebug(f, iface)
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237

◆ accNavigate()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate ( long  navDir,
VARIANT  varStart,
VARIANT *  pvarEnd 
)

Definition at line 1053 of file qaccessible_win.cpp.

1054 {
1055  showDebug(__FUNCTION__, accessible);
1056  if (!accessible->isValid())
1057  return E_FAIL;
1058 
1059  QAccessibleInterface *acc = 0;
1060  int control = -1;
1061  switch(navDir) {
1062  case NAVDIR_FIRSTCHILD:
1063  control = accessible->navigate(Child, 1, &acc);
1064  break;
1065  case NAVDIR_LASTCHILD:
1066  control = accessible->navigate(Child, accessible->childCount(), &acc);
1067  break;
1068  case NAVDIR_NEXT:
1069  case NAVDIR_PREVIOUS:
1070  if (!varStart.lVal){
1071  QAccessibleInterface *parent = 0;
1072  accessible->navigate(Ancestor, 1, &parent);
1073  if (parent) {
1074  int index = parent->indexOfChild(accessible);
1075  index += (navDir == NAVDIR_NEXT) ? 1 : -1;
1076  if (index > 0 && index <= parent->childCount())
1077  control = parent->navigate(Child, index, &acc);
1078  delete parent;
1079  }
1080  } else {
1081  int index = varStart.lVal;
1082  index += (navDir == NAVDIR_NEXT) ? 1 : -1;
1083  if (index > 0 && index <= accessible->childCount())
1084  control = accessible->navigate(Child, index, &acc);
1085  }
1086  break;
1087  case NAVDIR_UP:
1088  control = accessible->navigate(Up, varStart.lVal, &acc);
1089  break;
1090  case NAVDIR_DOWN:
1091  control = accessible->navigate(Down, varStart.lVal, &acc);
1092  break;
1093  case NAVDIR_LEFT:
1094  control = accessible->navigate(Left, varStart.lVal, &acc);
1095  break;
1096  case NAVDIR_RIGHT:
1097  control = accessible->navigate(Right, varStart.lVal, &acc);
1098  break;
1099  default:
1100  break;
1101  }
1102  if (control == -1) {
1103  (*pvarEnd).vt = VT_EMPTY;
1104  return S_FALSE;
1105  }
1106  if (!acc) {
1107  (*pvarEnd).vt = VT_I4;
1108  (*pvarEnd).lVal = control;
1109  return S_OK;
1110  }
1111 
1112  QWindowsAccessible* wacc = new QWindowsAccessible(acc);
1113 
1114  IDispatch *iface = 0;
1115  wacc->QueryInterface(IID_IDispatch, (void**)&iface);
1116  if (iface) {
1117  (*pvarEnd).vt = VT_DISPATCH;
1118  (*pvarEnd).pdispVal = iface;
1119  return S_OK;
1120  } else {
1121  delete wacc;
1122  }
1123 
1124  (*pvarEnd).vt = VT_EMPTY;
1125  return S_FALSE;
1126 }
virtual int indexOfChild(const QAccessibleInterface *) const =0
Returns the 1-based index of the object child in this object&#39;s children list, or -1 if child is not a...
QAccessibleInterface * accessible
virtual int childCount() const =0
Returns the number of children that belong to this object.
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
QWindowsAccessible(QAccessibleInterface *a)
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)
quint16 index

◆ accSelect()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accSelect ( long  flagsSelect,
VARIANT  varID 
)

Definition at line 1353 of file qaccessible_win.cpp.

1354 {
1355  showDebug(__FUNCTION__, accessible);
1356  if (!accessible->isValid())
1357  return E_FAIL;
1358 
1359  bool res = false;
1360 
1361  AccessibleElement elem(varID.lVal, accessible);
1362  QAccessibleInterface *acc = elem.iface;
1363  if (acc) {
1364  const int entry = elem.entry;
1365  if (flagsSelect & SELFLAG_TAKEFOCUS)
1366  res = acc->doAction(SetFocus, entry, QVariantList());
1367  if (flagsSelect & SELFLAG_TAKESELECTION) {
1368  acc->doAction(ClearSelection, 0, QVariantList()); //### bug, 0 should be entry??
1369  res = acc->doAction(AddToSelection, entry, QVariantList());
1370  }
1371  if (flagsSelect & SELFLAG_EXTENDSELECTION)
1372  res = acc->doAction(ExtendSelection, entry, QVariantList());
1373  if (flagsSelect & SELFLAG_ADDSELECTION)
1374  res = acc->doAction(AddToSelection, entry, QVariantList());
1375  if (flagsSelect & SELFLAG_REMOVESELECTION)
1376  res = acc->doAction(RemoveSelection, entry, QVariantList());
1377  }
1378  return res ? S_OK : S_FALSE;
1379 }
QAccessibleInterface * accessible
virtual bool doAction(int action, int child, const QVariantList &params=QVariantList())=0
Asks the object, or the object&#39;s child if child is not 0, to execute action using the parameters...
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
QList< QVariant > QVariantList
Definition: qvariant.h:443
#define showDebug(f, iface)

◆ AddRef()

ULONG STDMETHODCALLTYPE QWindowsAccessible::AddRef ( )

Definition at line 743 of file qaccessible_win.cpp.

744 {
745  return ++ref;
746 }

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::ContextSensitiveHelp ( BOOL  fEnterMode)

Definition at line 1470 of file qaccessible_win.cpp.

1471 {
1472  return S_OK;
1473 }

◆ get_accChild()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild ( VARIANT  varChildID,
IDispatch **  ppdispChild 
)

Definition at line 1128 of file qaccessible_win.cpp.

1129 {
1130  showDebug(__FUNCTION__, accessible);
1131  if (!accessible->isValid())
1132  return E_FAIL;
1133 
1134  if (varChildID.vt == VT_EMPTY)
1135  return E_INVALIDARG;
1136 
1137 
1138  int childIndex = varChildID.lVal;
1139  QAccessibleInterface *acc = 0;
1140 
1141  AccessibleElement elem(childIndex, accessible);
1142  if (elem.iface) {
1143  RelationFlag rel = elem.entry ? Child : Self;
1144  int index = elem.iface->navigate(rel, elem.entry, &acc);
1145  if (index == -1)
1146  return E_INVALIDARG;
1147  }
1148 
1149  if (acc) {
1150  QWindowsAccessible* wacc = new QWindowsAccessible(acc);
1151  wacc->QueryInterface(IID_IDispatch, (void**)ppdispChild);
1152  return S_OK;
1153  }
1154 
1155  *ppdispChild = 0;
1156  return S_FALSE;
1157 }
QAccessibleInterface * accessible
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
QWindowsAccessible(QAccessibleInterface *a)
RelationFlag
This enum type defines bit flags that can be combined to indicate the relationship between two access...
Definition: qaccessible.h:268
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)
quint16 index

◆ get_accChildCount()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChildCount ( long *  pcountChildren)

Definition at line 1159 of file qaccessible_win.cpp.

1160 {
1161  showDebug(__FUNCTION__, accessible);
1162  if (!accessible->isValid())
1163  return E_FAIL;
1164 
1165  *pcountChildren = accessible->childCount();
1166  return S_OK;
1167 }
QAccessibleInterface * accessible
virtual int childCount() const =0
Returns the number of children that belong to this object.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accDefaultAction()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDefaultAction ( VARIANT  varID,
BSTR *  pszDefaultAction 
)

Definition at line 1203 of file qaccessible_win.cpp.

1204 {
1205  showDebug(__FUNCTION__, accessible);
1206  if (!accessible->isValid())
1207  return E_FAIL;
1208 
1209  AccessibleElement elem(varID.lVal, accessible);
1210  QString def = elem.iface ? elem.iface->actionText(DefaultAction, Name, elem.entry) : QString();
1211  if (def.isEmpty()) {
1212  *pszDefaultAction = 0;
1213  return S_FALSE;
1214  }
1215 
1216  *pszDefaultAction = QStringToBSTR(def);
1217  return S_OK;
1218 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accDescription()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDescription ( VARIANT  varID,
BSTR *  pszDescription 
)

Definition at line 1220 of file qaccessible_win.cpp.

1221 {
1222  showDebug(__FUNCTION__, accessible);
1223  if (!accessible->isValid())
1224  return E_FAIL;
1225 
1226  AccessibleElement elem(varID.lVal, accessible);
1227  QString descr = elem.text(Description);
1228  if (descr.size()) {
1229  *pszDescription = QStringToBSTR(descr);
1230  return S_OK;
1231  }
1232 
1233  *pszDescription = 0;
1234  return S_FALSE;
1235 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accFocus()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accFocus ( VARIANT *  pvarID)

Definition at line 1381 of file qaccessible_win.cpp.

1382 {
1383  showDebug(__FUNCTION__, accessible);
1384  if (!accessible->isValid())
1385  return E_FAIL;
1386 
1387  QAccessibleInterface *acc = 0;
1388  int control = accessible->navigate(FocusChild, 1, &acc);
1389  if (control == -1) {
1390  (*pvarID).vt = VT_EMPTY;
1391  return S_FALSE;
1392  }
1393  if (!acc || control == 0) {
1394  (*pvarID).vt = VT_I4;
1395  (*pvarID).lVal = control ? control : CHILDID_SELF;
1396  return S_OK;
1397  }
1398 
1399  QWindowsAccessible* wacc = new QWindowsAccessible(acc);
1400  IDispatch *iface = 0;
1401  wacc->QueryInterface(IID_IDispatch, (void**)&iface);
1402  if (iface) {
1403  (*pvarID).vt = VT_DISPATCH;
1404  (*pvarID).pdispVal = iface;
1405  return S_OK;
1406  } else {
1407  delete wacc;
1408  }
1409 
1410  (*pvarID).vt = VT_EMPTY;
1411  return S_FALSE;
1412 }
QAccessibleInterface * accessible
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
QWindowsAccessible(QAccessibleInterface *a)
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)

◆ get_accHelp()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accHelp ( VARIANT  varID,
BSTR *  pszHelp 
)

Definition at line 1237 of file qaccessible_win.cpp.

1238 {
1239  showDebug(__FUNCTION__, accessible);
1240  if (!accessible->isValid())
1241  return E_FAIL;
1242 
1243  AccessibleElement elem(varID.lVal, accessible);
1244  QString help = elem.text(Help);
1245  if (help.size()) {
1246  *pszHelp = QStringToBSTR(help);
1247  return S_OK;
1248  }
1249 
1250  *pszHelp = 0;
1251  return S_FALSE;
1252 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accHelpTopic()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accHelpTopic ( BSTR *  pszHelpFile,
VARIANT  varChild,
long *  pidTopic 
)

Definition at line 1254 of file qaccessible_win.cpp.

1255 {
1256  return DISP_E_MEMBERNOTFOUND;
1257 }

◆ get_accKeyboardShortcut()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accKeyboardShortcut ( VARIANT  varID,
BSTR *  pszKeyboardShortcut 
)

Definition at line 1259 of file qaccessible_win.cpp.

1260 {
1261  showDebug(__FUNCTION__, accessible);
1262  if (!accessible->isValid())
1263  return E_FAIL;
1264 
1265  AccessibleElement elem(varID.lVal, accessible);
1266  QString sc = elem.text(Accelerator);
1267  if (sc.size()) {
1268  *pszKeyboardShortcut = QStringToBSTR(sc);
1269  return S_OK;
1270  }
1271 
1272  *pszKeyboardShortcut = 0;
1273  return S_FALSE;
1274 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accName()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accName ( VARIANT  varID,
BSTR *  pszName 
)

Definition at line 1276 of file qaccessible_win.cpp.

1277 {
1278  showDebug(__FUNCTION__, accessible);
1279  if (!accessible->isValid())
1280  return E_FAIL;
1281 
1282  AccessibleElement elem(varID.lVal, accessible);
1283  QString n = elem.text(Name);
1284  if (n.size()) {
1285  *pszName = QStringToBSTR(n);
1286  return S_OK;
1287  }
1288 
1289  *pszName = 0;
1290  return S_FALSE;
1291 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accParent()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accParent ( IDispatch **  ppdispParent)

Definition at line 1169 of file qaccessible_win.cpp.

1170 {
1171  showDebug(__FUNCTION__, accessible);
1172  if (!accessible->isValid())
1173  return E_FAIL;
1174 
1175  QAccessibleInterface *acc = 0;
1176  accessible->navigate(Ancestor, 1, &acc);
1177  if (acc) {
1178  QWindowsAccessible* wacc = new QWindowsAccessible(acc);
1179  wacc->QueryInterface(IID_IDispatch, (void**)ppdispParent);
1180 
1181  if (*ppdispParent)
1182  return S_OK;
1183  }
1184 
1185  *ppdispParent = 0;
1186  return S_FALSE;
1187 }
QAccessibleInterface * accessible
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *)
QWindowsAccessible(QAccessibleInterface *a)
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)

◆ get_accRole()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accRole ( VARIANT  varID,
VARIANT *  pvarRole 
)

Definition at line 1299 of file qaccessible_win.cpp.

1300 {
1301  showDebug(__FUNCTION__, accessible);
1302  if (!accessible->isValid())
1303  return E_FAIL;
1304 
1305  AccessibleElement elem(varID.lVal, accessible);
1306  Role role = elem.iface ? elem.iface->role(elem.entry) : NoRole;
1307  if (role != NoRole) {
1308  if (role == LayeredPane)
1309  role = QAccessible::Pane;
1310  (*pvarRole).vt = VT_I4;
1311  (*pvarRole).lVal = role;
1312  } else {
1313  (*pvarRole).vt = VT_EMPTY;
1314  }
1315  return S_OK;
1316 }
Role
This enum defines the role of an accessible object.
Definition: qaccessible.h:188
QAccessibleInterface * accessible
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accSelection()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accSelection ( VARIANT *  pvarChildren)

Definition at line 1414 of file qaccessible_win.cpp.

1415 {
1416  showDebug(__FUNCTION__, accessible);
1417  if (!accessible->isValid())
1418  return E_FAIL;
1419 
1420  int cc = accessible->childCount();
1421  QVector<int> sel(cc);
1422  int selIndex = 0;
1423  for (int i = 1; i <= cc; ++i) {
1424  QAccessibleInterface *child = 0;
1425  int i2 = accessible->navigate(Child, i, &child);
1426  bool isSelected = false;
1427  if (child) {
1428  isSelected = child->state(0) & Selected;
1429  delete child;
1430  child = 0;
1431  } else {
1432  isSelected = accessible->state(i2) & Selected;
1433  }
1434  if (isSelected)
1435  sel[selIndex++] = i;
1436  }
1437  sel.resize(selIndex);
1438  if (sel.isEmpty()) {
1439  (*pvarChildren).vt = VT_EMPTY;
1440  return S_FALSE;
1441  }
1442  if (sel.size() == 1) {
1443  (*pvarChildren).vt = VT_I4;
1444  (*pvarChildren).lVal = sel[0];
1445  return S_OK;
1446  }
1447  IEnumVARIANT *iface = new QWindowsEnumerate(sel);
1448  IUnknown *uiface;
1449  iface->QueryInterface(IID_IUnknown, (void**)&uiface);
1450  (*pvarChildren).vt = VT_UNKNOWN;
1451  (*pvarChildren).punkVal = uiface;
1452 
1453  return S_OK;
1454 }
virtual State state(int child) const =0
Returns the current state of the object, or of the object&#39;s child if child is not 0...
QAccessibleInterface * accessible
virtual int childCount() const =0
Returns the number of children that belong to this object.
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
#define showDebug(f, iface)

◆ get_accState()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accState ( VARIANT  varID,
VARIANT *  pvarState 
)

Definition at line 1318 of file qaccessible_win.cpp.

1319 {
1320  showDebug(__FUNCTION__, accessible);
1321  if (!accessible->isValid())
1322  return E_FAIL;
1323 
1324  (*pvarState).vt = VT_I4;
1325  AccessibleElement elem(varID.lVal, accessible);
1326  (*pvarState).lVal = elem.iface ? elem.iface->state(elem.entry) : State(Normal);
1327  return S_OK;
1328 }
QAccessibleInterface * accessible
State
Definition: qaudio.h:59
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ get_accValue()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accValue ( VARIANT  varID,
BSTR *  pszValue 
)

Definition at line 1330 of file qaccessible_win.cpp.

1331 {
1332  showDebug(__FUNCTION__, accessible);
1333  if (!accessible->isValid())
1334  return E_FAIL;
1335 
1336  AccessibleElement elem(varID.lVal, accessible);
1337  QString value = elem.text(Value);
1338  if (!value.isNull()) {
1339  *pszValue = QStringToBSTR(value);
1340  return S_OK;
1341  }
1342 
1343  *pszValue = 0;
1344  return S_FALSE;
1345 }
static BSTR QStringToBSTR(const QString &str)
QAccessibleInterface * accessible
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...
#define showDebug(f, iface)

◆ GetIDsOfNames()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetIDsOfNames ( const _GUID ,
wchar_t **  rgszNames,
unsigned  int,
unsigned  long,
long *  rgdispid 
)

Definition at line 775 of file qaccessible_win.cpp.

776 {
777 #if !defined(Q_CC_BOR) && !defined(Q_CC_GNU)
778  // PROPERTIES: Hierarchical
779  if (_bstr_t(rgszNames[0]) == _bstr_t(L"accParent"))
780  rgdispid[0] = DISPID_ACC_PARENT;
781  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accChildCount"))
782  rgdispid[0] = DISPID_ACC_CHILDCOUNT;
783  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accChild"))
784  rgdispid[0] = DISPID_ACC_CHILD;
785 
786  // PROPERTIES: Descriptional
787  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accName("))
788  rgdispid[0] = DISPID_ACC_NAME;
789  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accValue"))
790  rgdispid[0] = DISPID_ACC_VALUE;
791  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accDescription"))
792  rgdispid[0] = DISPID_ACC_DESCRIPTION;
793  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accRole"))
794  rgdispid[0] = DISPID_ACC_ROLE;
795  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accState"))
796  rgdispid[0] = DISPID_ACC_STATE;
797  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accHelp"))
798  rgdispid[0] = DISPID_ACC_HELP;
799  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accHelpTopic"))
800  rgdispid[0] = DISPID_ACC_HELPTOPIC;
801  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accKeyboardShortcut"))
802  rgdispid[0] = DISPID_ACC_KEYBOARDSHORTCUT;
803  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accFocus"))
804  rgdispid[0] = DISPID_ACC_FOCUS;
805  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accSelection"))
806  rgdispid[0] = DISPID_ACC_SELECTION;
807  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accDefaultAction"))
808  rgdispid[0] = DISPID_ACC_DEFAULTACTION;
809 
810  // METHODS
811  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accSelect"))
812  rgdispid[0] = DISPID_ACC_SELECT;
813  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accLocation"))
814  rgdispid[0] = DISPID_ACC_LOCATION;
815  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accNavigate"))
816  rgdispid[0] = DISPID_ACC_NAVIGATE;
817  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accHitTest"))
818  rgdispid[0] = DISPID_ACC_HITTEST;
819  else if(_bstr_t(rgszNames[0]) == _bstr_t(L"accDoDefaultAction"))
820  rgdispid[0] = DISPID_ACC_DODEFAULTACTION;
821  else
822  return DISP_E_UNKNOWNINTERFACE;
823 
824  return S_OK;
825 #else
826  Q_UNUSED(rgszNames);
827  Q_UNUSED(rgdispid);
828 
829  return DISP_E_MEMBERNOTFOUND;
830 #endif
831 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ GetTypeInfo()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetTypeInfo ( unsigned  int,
unsigned  long,
ITypeInfo **  pptinfo 
)

Definition at line 768 of file qaccessible_win.cpp.

769 {
770  // We don't use a type library
771  *pptinfo = 0;
772  return S_OK;
773 }

◆ GetTypeInfoCount()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetTypeInfoCount ( unsigned int *  pctinfo)

Definition at line 761 of file qaccessible_win.cpp.

762 {
763  // We don't use a type library
764  *pctinfo = 0;
765  return S_OK;
766 }

◆ GetWindow()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetWindow ( HWND *  phwnd)

Definition at line 1456 of file qaccessible_win.cpp.

1457 {
1458  *phwnd = 0;
1459  if (!accessible->isValid())
1460  return E_UNEXPECTED;
1461 
1462  QObject *o = accessible->object();
1463  if (!o || !o->isWidgetType())
1464  return E_FAIL;
1465 
1466  *phwnd = static_cast<QWidget*>(o)->effectiveWinId();
1467  return S_OK;
1468 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QAccessibleInterface * accessible
virtual QObject * object() const =0
Returns a pointer to the QObject this interface implementation provides information for...
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Definition: qobject.h:146
virtual bool isValid() const =0
Returns true if all the data necessary to use this interface implementation is valid (e...

◆ Invoke()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::Invoke ( long  dispIdMember,
const _GUID ,
unsigned  long,
unsigned short  wFlags,
tagDISPPARAMS *  pDispParams,
tagVARIANT *  pVarResult,
tagEXCEPINFO *  ,
unsigned int *   
)

Definition at line 833 of file qaccessible_win.cpp.

834 {
835  HRESULT hr = DISP_E_MEMBERNOTFOUND;
836 
837  switch(dispIdMember)
838  {
839  case DISPID_ACC_PARENT:
840  if (wFlags == DISPATCH_PROPERTYGET) {
841  if (!pVarResult)
842  return E_INVALIDARG;
843  hr = get_accParent(&pVarResult->pdispVal);
844  } else {
845  hr = DISP_E_MEMBERNOTFOUND;
846  }
847  break;
848 
849  case DISPID_ACC_CHILDCOUNT:
850  if (wFlags == DISPATCH_PROPERTYGET) {
851  if (!pVarResult)
852  return E_INVALIDARG;
853  hr = get_accChildCount(&pVarResult->lVal);
854  } else {
855  hr = DISP_E_MEMBERNOTFOUND;
856  }
857  break;
858 
859  case DISPID_ACC_CHILD:
860  if (wFlags == DISPATCH_PROPERTYGET)
861  hr = get_accChild(pDispParams->rgvarg[0], &pVarResult->pdispVal);
862  else
863  hr = DISP_E_MEMBERNOTFOUND;
864  break;
865 
866  case DISPID_ACC_NAME:
867  if (wFlags == DISPATCH_PROPERTYGET)
868  hr = get_accName(pDispParams->rgvarg[0], &pVarResult->bstrVal);
869  else if (wFlags == DISPATCH_PROPERTYPUT)
870  hr = put_accName(pDispParams->rgvarg[0], pVarResult->bstrVal);
871  else
872  hr = DISP_E_MEMBERNOTFOUND;
873  break;
874 
875  case DISPID_ACC_VALUE:
876  if (wFlags == DISPATCH_PROPERTYGET)
877  hr = get_accValue(pDispParams->rgvarg[0], &pVarResult->bstrVal);
878  else if (wFlags == DISPATCH_PROPERTYPUT)
879  hr = put_accValue(pDispParams->rgvarg[0], pVarResult->bstrVal);
880  else
881  hr = DISP_E_MEMBERNOTFOUND;
882  break;
883 
884  case DISPID_ACC_DESCRIPTION:
885  if (wFlags == DISPATCH_PROPERTYGET)
886  hr = get_accDescription(pDispParams->rgvarg[0], &pVarResult->bstrVal);
887  else
888  hr = DISP_E_MEMBERNOTFOUND;
889  break;
890 
891  case DISPID_ACC_ROLE:
892  if (wFlags == DISPATCH_PROPERTYGET)
893  hr = get_accRole(pDispParams->rgvarg[0], pVarResult);
894  else
895  hr = DISP_E_MEMBERNOTFOUND;
896  break;
897 
898  case DISPID_ACC_STATE:
899  if (wFlags == DISPATCH_PROPERTYGET)
900  hr = get_accState(pDispParams->rgvarg[0], pVarResult);
901  else
902  hr = DISP_E_MEMBERNOTFOUND;
903  break;
904 
905  case DISPID_ACC_HELP:
906  if (wFlags == DISPATCH_PROPERTYGET)
907  hr = get_accHelp(pDispParams->rgvarg[0], &pVarResult->bstrVal);
908  else
909  hr = DISP_E_MEMBERNOTFOUND;
910  break;
911 
912  case DISPID_ACC_HELPTOPIC:
913  if (wFlags == DISPATCH_PROPERTYGET)
914  hr = get_accHelpTopic(&pDispParams->rgvarg[2].bstrVal, pDispParams->rgvarg[1], &pDispParams->rgvarg[0].lVal);
915  else
916  hr = DISP_E_MEMBERNOTFOUND;
917  break;
918 
919  case DISPID_ACC_KEYBOARDSHORTCUT:
920  if (wFlags == DISPATCH_PROPERTYGET)
921  hr = get_accKeyboardShortcut(pDispParams->rgvarg[0], &pVarResult->bstrVal);
922  else
923  hr = DISP_E_MEMBERNOTFOUND;
924  break;
925 
926  case DISPID_ACC_FOCUS:
927  if (wFlags == DISPATCH_PROPERTYGET)
928  hr = get_accFocus(pVarResult);
929  else
930  hr = DISP_E_MEMBERNOTFOUND;
931  break;
932 
933  case DISPID_ACC_SELECTION:
934  if (wFlags == DISPATCH_PROPERTYGET)
935  hr = get_accSelection(pVarResult);
936  else
937  hr = DISP_E_MEMBERNOTFOUND;
938  break;
939 
940  case DISPID_ACC_DEFAULTACTION:
941  if (wFlags == DISPATCH_PROPERTYGET)
942  hr = get_accDefaultAction(pDispParams->rgvarg[0], &pVarResult->bstrVal);
943  else
944  hr = DISP_E_MEMBERNOTFOUND;
945  break;
946 
947  case DISPID_ACC_SELECT:
948  if (wFlags == DISPATCH_METHOD)
949  hr = accSelect(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0]);
950  else
951  hr = DISP_E_MEMBERNOTFOUND;
952  break;
953 
954  case DISPID_ACC_LOCATION:
955  if (wFlags == DISPATCH_METHOD)
956  hr = accLocation(&pDispParams->rgvarg[4].lVal, &pDispParams->rgvarg[3].lVal, &pDispParams->rgvarg[2].lVal, &pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0]);
957  else
958  hr = DISP_E_MEMBERNOTFOUND;
959  break;
960 
961  case DISPID_ACC_NAVIGATE:
962  if (wFlags == DISPATCH_METHOD)
963  hr = accNavigate(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0], pVarResult);
964  else
965  hr = DISP_E_MEMBERNOTFOUND;
966  break;
967 
968  case DISPID_ACC_HITTEST:
969  if (wFlags == DISPATCH_METHOD)
970  hr = accHitTest(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0].lVal, pVarResult);
971  else
972  hr = DISP_E_MEMBERNOTFOUND;
973  break;
974 
975  case DISPID_ACC_DODEFAULTACTION:
976  if (wFlags == DISPATCH_METHOD)
977  hr = accDoDefaultAction(pDispParams->rgvarg[0]);
978  else
979  hr = DISP_E_MEMBERNOTFOUND;
980  break;
981 
982  default:
983  hr = DISP_E_MEMBERNOTFOUND;
984  break;
985  }
986 
987  if (!SUCCEEDED(hr)) {
988  return hr;
989  }
990  return hr;
991 }
HRESULT STDMETHODCALLTYPE accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEnd)
HRESULT STDMETHODCALLTYPE get_accSelection(VARIANT *pvarChildren)
HRESULT STDMETHODCALLTYPE accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID)
HRESULT STDMETHODCALLTYPE get_accDescription(VARIANT varID, BSTR *pszDescription)
HRESULT STDMETHODCALLTYPE put_accValue(VARIANT varChild, BSTR szValue)
HRESULT STDMETHODCALLTYPE accSelect(long flagsSelect, VARIANT varID)
HRESULT STDMETHODCALLTYPE get_accParent(IDispatch **ppdispParent)
HRESULT STDMETHODCALLTYPE get_accRole(VARIANT varID, VARIANT *pvarRole)
HRESULT STDMETHODCALLTYPE get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, long *pidTopic)
HRESULT STDMETHODCALLTYPE get_accHelp(VARIANT varID, BSTR *pszHelp)
HRESULT STDMETHODCALLTYPE get_accState(VARIANT varID, VARIANT *pvarState)
HRESULT STDMETHODCALLTYPE get_accValue(VARIANT varID, BSTR *pszValue)
long HRESULT
HRESULT STDMETHODCALLTYPE put_accName(VARIANT varChild, BSTR szName)
HRESULT STDMETHODCALLTYPE accDoDefaultAction(VARIANT varID)
HRESULT STDMETHODCALLTYPE get_accFocus(VARIANT *pvarID)
HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut(VARIANT varID, BSTR *pszKeyboardShortcut)
HRESULT STDMETHODCALLTYPE get_accName(VARIANT varID, BSTR *pszName)
HRESULT STDMETHODCALLTYPE get_accDefaultAction(VARIANT varID, BSTR *pszDefaultAction)
HRESULT STDMETHODCALLTYPE get_accChildCount(long *pcountChildren)
HRESULT STDMETHODCALLTYPE get_accChild(VARIANT varChildID, IDispatch **ppdispChild)
HRESULT STDMETHODCALLTYPE accHitTest(long xLeft, long yTop, VARIANT *pvarID)

◆ put_accName()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::put_accName ( VARIANT  varChild,
BSTR  szName 
)

Definition at line 1293 of file qaccessible_win.cpp.

1294 {
1295  showDebug(__FUNCTION__, accessible);
1296  return DISP_E_MEMBERNOTFOUND;
1297 }
QAccessibleInterface * accessible
#define showDebug(f, iface)

◆ put_accValue()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::put_accValue ( VARIANT  varChild,
BSTR  szValue 
)

Definition at line 1347 of file qaccessible_win.cpp.

1348 {
1349  showDebug(__FUNCTION__, accessible);
1350  return DISP_E_MEMBERNOTFOUND;
1351 }
QAccessibleInterface * accessible
#define showDebug(f, iface)

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE QWindowsAccessible::QueryInterface ( REFIID  id,
LPVOID *  iface 
)

Definition at line 725 of file qaccessible_win.cpp.

Referenced by accHitTest(), accNavigate(), get_accChild(), get_accFocus(), get_accParent(), and qt_createWindowsAccessible().

726 {
727  *iface = 0;
728  if (id == IID_IUnknown)
729  *iface = (IUnknown*)(IDispatch*)this;
730  else if (id == IID_IDispatch)
731  *iface = (IDispatch*)this;
732  else if (id == IID_IAccessible)
733  *iface = (IAccessible*)this;
734  else if (id == IID_IOleWindow)
735  *iface = (IOleWindow*)this;
736  else
737  return E_NOINTERFACE;
738 
739  AddRef();
740  return S_OK;
741 }
ULONG STDMETHODCALLTYPE AddRef()

◆ Release()

ULONG STDMETHODCALLTYPE QWindowsAccessible::Release ( )

Definition at line 748 of file qaccessible_win.cpp.

749 {
750  if (!--ref) {
751  delete this;
752  return 0;
753  }
754  return ref;
755 }

Properties

◆ accessible

QAccessibleInterface* QWindowsAccessible::accessible
private

Definition at line 703 of file qaccessible_win.cpp.

◆ ref

ULONG QWindowsAccessible::ref
private

Definition at line 702 of file qaccessible_win.cpp.


The documentation for this class was generated from the following file: