#pragma once
#include <oleacc.h>
#include <helper/SUnknown.h>
#include "Swnd.h"
#include "interface/sacchelper-i.h"
SNSBEGIN
#ifdef SOUI_ENABLE_ACC
class SOUI_EXP SAccessible
: public IAccessible
, public IAccHelper
, public SUnknown {
protected:
SWindow *m_pWnd;
public:
SAccessible(SWindow *pWnd);
~SAccessible();
protected:
BOOL accValidateNavStart(VARIANT *pvar) const;
public:
// Implement IAccHelper
STDMETHOD_(void, SetOwner)(THIS_ IWindow * pOwner) OVERRIDE{
m_pWnd = (SWindow*)pOwner;
}
STDMETHOD_(IWindow *, GetOwner)(CTHIS) SCONST OVERRIDE{
return m_pWnd;
}
// Implement IAccessible
STDMETHODIMP get_accParent(IDispatch **ppdispParent);
STDMETHODIMP get_accChildCount(long *pcountChildren);
STDMETHODIMP get_accChild(VARIANT varChild, IDispatch **ppdispChild);
STDMETHODIMP get_accName(VARIANT varChild, BSTR *pszName);
STDMETHODIMP get_accValue(VARIANT varChild, BSTR *pszValue);
STDMETHODIMP get_accDescription(VARIANT varChild, BSTR *pszDescription);
STDMETHODIMP get_accRole(VARIANT varChild, VARIANT *pvarRole);
STDMETHODIMP get_accState(VARIANT varChild, VARIANT *pvarState);
STDMETHODIMP get_accHelp(VARIANT varChild, BSTR *pszHelp);
STDMETHODIMP get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, long *pidTopic);
STDMETHODIMP get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKeyboardShortcut);
STDMETHODIMP get_accFocus(VARIANT *pvarChild);
STDMETHODIMP get_accSelection(VARIANT *pvarChildren);
STDMETHODIMP get_accDefaultAction(VARIANT varChild, BSTR *pszDefaultAction);
STDMETHODIMP accSelect(long flagsSelect, VARIANT varChild);
STDMETHODIMP accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varChild);
STDMETHODIMP accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEndUpAt);
STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT *pvarChild);
STDMETHODIMP accDoDefaultAction(VARIANT varChild);
STDMETHODIMP put_accName(VARIANT varChild, BSTR szName);
STDMETHODIMP put_accValue(VARIANT varChild, BSTR szValue);
// Implement IDispatch
STDMETHODIMP GetTypeInfoCount(unsigned int FAR *pctinfo);
STDMETHODIMP GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR *FAR *ppTInfo);
STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR FAR *FAR *rgszNames, unsigned int cNames, LCID lcid, DISPID FAR *rgDispId);
STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult, EXCEPINFO FAR *pExcepInfo, unsigned int FAR *puArgErr);
public:
IUNKNOWN_BEGIN(IAccessible)
IUNKNOWN_ADD_IID(IAccHelper)
IUNKNOWN_ADD_IID(IDispatch)
IUNKNOWN_END()
};
#endif // SOUI_ENABLE_ACC
SNSEND
SwndAccessible.h(SAccessible 接口实现 IAccHelper、IAccessible)
-
C++
107 引用 • 153 回帖 • 2 关注
C++ 是在 C 语言的基础上开发的一种通用编程语言,应用广泛。C++ 支持多种编程范式,面向对象编程、泛型编程和过程化编程。
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于