Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
4.9 KiB

  1. #ifndef _IAccessible_h
  2. #define _IAccessible_h
  3. // (DavidJen) might be paranoic but these two function were previously defined extern "C" in this header
  4. // just to be sure I pull in the thunked definitions; these definitions are used within browseUI
  5. #if !defined(NotifyWinEvent) || !defined(LresultFromObject)
  6. #include "apithk.h"
  7. #endif
  8. #include "oleacc.h"
  9. #include "mnbase.h"
  10. #include "menuband.h"
  11. #define CHILDID_SELF 0
  12. // NOTE (lamadio): The designers of the Accessibility interface did not know
  13. // the rule about COM identity. They allow a QI for the external object IEnumVariant
  14. class CAccessible : public IAccessible, public IEnumVARIANT, public IOleWindow
  15. {
  16. int _cRef;
  17. // IDispatch Support
  18. ITypeInfo* _pTypeInfo;
  19. BOOL _LoadTypeLib();
  20. // Track menu popup Support
  21. IAccessible* _pInnerAcc;
  22. HWND _hwndMenuWindow;
  23. HMENU _hMenu;
  24. WORD _wID;
  25. // Menuband Support
  26. CMenuToolbarBase* _pmtbBottom;
  27. CMenuToolbarBase* _pmtbTop;
  28. IShellMenuAcc* _psma;
  29. IMenuBand* _pmb;
  30. // Menuband Item Support
  31. CMenuToolbarBase* _pmtbItem;
  32. int _iAccIndex;
  33. int _iIndex;
  34. int _iEnumIndex;
  35. int _idCmd;
  36. // Object info
  37. BITBOOL _fInitialized: 1;
  38. BITBOOL _fState: 3;
  39. HRESULT _GetVariantFromChildIndex(HWND hwnd, int iIndex, VARIANT* pvarChild);
  40. HRESULT _GetChildFromVariant(VARIANT* pvarChild, CMenuToolbarBase** ppmtb, int* iIndex);
  41. HRESULT _GetAccessibleItem(int iIndex, IDispatch** ppdisp);
  42. HRESULT _GetAccName(BSTR* pbstr);
  43. HRESULT _Navigate(long navDir, VARIANT varStart, VARIANT * pvarEndUpAt);
  44. public:
  45. CAccessible(HMENU, WORD);
  46. CAccessible(IMenuBand*);
  47. CAccessible(IMenuBand*, int iIndex);
  48. virtual ~CAccessible();
  49. HRESULT InitAcc();
  50. // *** IUnknown methods ***
  51. virtual STDMETHODIMP_(ULONG) AddRef();
  52. virtual STDMETHODIMP_(ULONG) Release();
  53. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
  54. // *** IDispatch methods ***
  55. virtual STDMETHODIMP GetTypeInfoCount(UINT FAR* pctinfo);
  56. virtual STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
  57. virtual STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, UINT cNames,
  58. LCID lcid, DISPID FAR* rgdispid);
  59. virtual STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,
  60. DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo,
  61. UINT FAR* puArgErr);
  62. // *** IOleWindow methods ***
  63. virtual STDMETHODIMP GetWindow(HWND * lphwnd);
  64. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
  65. // *** IAccessible methods ***
  66. virtual STDMETHODIMP get_accParent(IDispatch * FAR* ppdispParent);
  67. virtual STDMETHODIMP get_accChildCount(long FAR* pChildCount);
  68. virtual STDMETHODIMP get_accChild(VARIANT varChildIndex, IDispatch * FAR* ppdispChild);
  69. virtual STDMETHODIMP get_accName(VARIANT varChild, BSTR* pszName);
  70. virtual STDMETHODIMP get_accValue(VARIANT varChild, BSTR* pszValue);
  71. virtual STDMETHODIMP get_accDescription(VARIANT varChild, BSTR FAR* pszDescription);
  72. virtual STDMETHODIMP get_accRole(VARIANT varChild, VARIANT *pvarRole);
  73. virtual STDMETHODIMP get_accState(VARIANT varChild, VARIANT *pvarState);
  74. virtual STDMETHODIMP get_accHelp(VARIANT varChild, BSTR* pszHelp);
  75. virtual STDMETHODIMP get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, long* pidTopic);
  76. virtual STDMETHODIMP get_accKeyboardShortcut(VARIANT varChild, BSTR* pszKeyboardShortcut);
  77. virtual STDMETHODIMP get_accFocus(VARIANT FAR * pvarFocusChild);
  78. virtual STDMETHODIMP get_accSelection(VARIANT FAR * pvarSelectedChildren);
  79. virtual STDMETHODIMP get_accDefaultAction(VARIANT varChild, BSTR* pszDefaultAction);
  80. virtual STDMETHODIMP accSelect(long flagsSelect, VARIANT varChild);
  81. virtual STDMETHODIMP accLocation(long* pxLeft, long* pyTop, long* pcxWidth, long* pcyHeight, VARIANT varChild);
  82. virtual STDMETHODIMP accNavigate(long navDir, VARIANT varStart, VARIANT * pvarEndUpAt);
  83. virtual STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT * pvarChildAtPoint);
  84. virtual STDMETHODIMP accDoDefaultAction(VARIANT varChild);
  85. virtual STDMETHODIMP put_accName(VARIANT varChild, BSTR szName);
  86. virtual STDMETHODIMP put_accValue(VARIANT varChild, BSTR pszValue);
  87. // *** IEnumVARIANT methods ***
  88. virtual STDMETHODIMP Next(unsigned long celt,
  89. VARIANT FAR* rgvar,
  90. unsigned long FAR* pceltFetched);
  91. virtual STDMETHODIMP Skip(unsigned long celt);
  92. virtual STDMETHODIMP Reset();
  93. virtual STDMETHODIMP Clone(IEnumVARIANT FAR* FAR* ppenum);
  94. };
  95. #endif