summaryrefslogtreecommitdiff
path: root/winaccessibility/source
diff options
context:
space:
mode:
authorSteve Yin <steve_y@apache.org>2013-11-14 08:18:05 +0000
committerMichael Meeks <michael.meeks@collabora.com>2013-11-19 00:01:31 +0000
commit1baeaa55c6210ac2e354649a8ca055554f9bdb78 (patch)
treeb3e20903dad6a0754dd239da94614d31a7772ebc /winaccessibility/source
parenta0c1d96aa48906b2ebb332f6190b4bcfe9e2a161 (diff)
Integrate branch of IAccessible2
Just the winaccessibility directory initially. Change-Id: Ia21abb8d7088646ad6c1f83b3a03e7add716b0c0
Diffstat (limited to 'winaccessibility/source')
-rw-r--r--winaccessibility/source/UAccCOM/AccAction.cxx120
-rw-r--r--winaccessibility/source/UAccCOM/AccAction.h105
-rw-r--r--winaccessibility/source/UAccCOM/AccAction.rgs26
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.cxx416
-rw-r--r--winaccessibility/source/UAccCOM/AccActionBase.h92
-rw-r--r--winaccessibility/source/UAccCOM/AccComponent.cxx72
-rw-r--r--winaccessibility/source/UAccCOM/AccComponent.h97
-rw-r--r--winaccessibility/source/UAccCOM/AccComponent.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccComponentBase.cxx213
-rw-r--r--winaccessibility/source/UAccCOM/AccComponentBase.h78
-rw-r--r--winaccessibility/source/UAccCOM/AccContext.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccEditableText.cxx508
-rw-r--r--winaccessibility/source/UAccCOM/AccEditableText.h115
-rw-r--r--winaccessibility/source/UAccCOM/AccEditableText.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccExtendedComponent.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccFont.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccHyperLink.cxx296
-rw-r--r--winaccessibility/source/UAccCOM/AccHyperLink.h140
-rw-r--r--winaccessibility/source/UAccCOM/AccHyperLink.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccHypertext.cxx409
-rw-r--r--winaccessibility/source/UAccCOM/AccHypertext.h161
-rw-r--r--winaccessibility/source/UAccCOM/AccHypertext.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccImage.cxx102
-rw-r--r--winaccessibility/source/UAccCOM/AccImage.h101
-rw-r--r--winaccessibility/source/UAccCOM/AccImage.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccKeyBinding.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccRelation.cxx214
-rw-r--r--winaccessibility/source/UAccCOM/AccRelation.h88
-rw-r--r--winaccessibility/source/UAccCOM/AccRelation.rgs25
-rw-r--r--winaccessibility/source/UAccCOM/AccSelection.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.cxx1069
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.h175
-rw-r--r--winaccessibility/source/UAccCOM/AccTable.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccText.cxx282
-rw-r--r--winaccessibility/source/UAccCOM/AccText.h140
-rw-r--r--winaccessibility/source/UAccCOM/AccText.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccTextBase.cxx995
-rw-r--r--winaccessibility/source/UAccCOM/AccTextBase.h122
-rw-r--r--winaccessibility/source/UAccCOM/AccValue.cxx224
-rw-r--r--winaccessibility/source/UAccCOM/AccValue.h104
-rw-r--r--winaccessibility/source/UAccCOM/AccValue.rgs23
-rw-r--r--winaccessibility/source/UAccCOM/AccessibleKeyStroke.h157
-rw-r--r--winaccessibility/source/UAccCOM/CheckEnableAccessible.cxx35
-rw-r--r--winaccessibility/source/UAccCOM/CheckEnableAccessible.h30
-rw-r--r--winaccessibility/source/UAccCOM/EnumVariant.cxx227
-rw-r--r--winaccessibility/source/UAccCOM/EnumVariant.h106
-rw-r--r--winaccessibility/source/UAccCOM/EnumVariant.rgs26
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx3267
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.h294
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.rgs26
-rw-r--r--winaccessibility/source/UAccCOM/Resource.h70
-rw-r--r--winaccessibility/source/UAccCOM/StdAfx.cxx29
-rw-r--r--winaccessibility/source/UAccCOM/UAccCOM.cxx109
-rw-r--r--winaccessibility/source/UAccCOM/UAccCOM.def7
-rw-r--r--winaccessibility/source/UAccCOM/UAccCOM.rc149
-rw-r--r--winaccessibility/source/UAccCOM/UNOXWrapper.cxx27
-rw-r--r--winaccessibility/source/UAccCOM/UNOXWrapper.h72
-rw-r--r--winaccessibility/source/UAccCOM/UNOXWrapper.rgs26
-rw-r--r--winaccessibility/source/UAccCOM/acccommon.h95
-rw-r--r--winaccessibility/source/UAccCOM/stdafx.h64
-rw-r--r--winaccessibility/source/UAccCOMIDL/AccessibleKeyBinding.idl66
-rw-r--r--winaccessibility/source/UAccCOMIDL/AccessibleKeyStroke.idl149
-rw-r--r--winaccessibility/source/UAccCOMIDL/Charset.idl33
-rw-r--r--winaccessibility/source/UAccCOMIDL/UAccCOM.idl209
-rw-r--r--winaccessibility/source/UAccCOMIDL/defines.idl40
-rw-r--r--winaccessibility/source/UAccCOMIDL/ia2_api_all.idl5473
-rw-r--r--winaccessibility/source/service/AccComponentEventListener.cxx336
-rw-r--r--winaccessibility/source/service/AccContainerEventListener.cxx573
-rw-r--r--winaccessibility/source/service/AccDescendantManagerEventListener.cxx226
-rw-r--r--winaccessibility/source/service/AccDialogEventListener.cxx150
-rw-r--r--winaccessibility/source/service/AccEventListener.cxx309
-rw-r--r--winaccessibility/source/service/AccFrameEventListener.cxx173
-rw-r--r--winaccessibility/source/service/AccListEventListener.cxx123
-rw-r--r--winaccessibility/source/service/AccMenuEventListener.cxx151
-rw-r--r--winaccessibility/source/service/AccObject.cxx1109
-rw-r--r--winaccessibility/source/service/AccObjectContainerEventListener.cxx72
-rw-r--r--winaccessibility/source/service/AccObjectManagerAgent.cxx386
-rw-r--r--winaccessibility/source/service/AccObjectWinManager.cxx1321
-rw-r--r--winaccessibility/source/service/AccParagraphEventListener.cxx145
-rw-r--r--winaccessibility/source/service/AccResource.cxx85
-rw-r--r--winaccessibility/source/service/AccTableEventListener.cxx146
-rw-r--r--winaccessibility/source/service/AccTextComponentEventListener.cxx65
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx321
-rw-r--r--winaccessibility/source/service/AccTreeEventListener.cxx87
-rw-r--r--winaccessibility/source/service/AccWindowEventListener.cxx152
-rw-r--r--winaccessibility/source/service/ResIDGenerator.cxx54
-rw-r--r--winaccessibility/source/service/checkmt.cxx36
-rw-r--r--winaccessibility/source/service/checkmt.hxx28
-rw-r--r--winaccessibility/source/service/exports.dxp2
-rw-r--r--winaccessibility/source/service/msaaservice_impl.cxx289
-rw-r--r--winaccessibility/source/service/winaccessibility.component27
91 files changed, 23940 insertions, 0 deletions
diff --git a/winaccessibility/source/UAccCOM/AccAction.cxx b/winaccessibility/source/UAccCOM/AccAction.cxx
new file mode 100644
index 000000000000..fe233f4ef3ab
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccAction.cxx
@@ -0,0 +1,120 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+/**
+ * AccAction.cpp : Implementation of CAccAction
+ */
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccAction.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * Returns the number of action.
+ *
+ * @param nActions the number of action.
+ */
+STDMETHODIMP CAccAction::nActions(/*[out,retval]*/long* nActions)
+{
+
+ return CAccActionBase::nActions(nActions);
+}
+
+/**
+ * Performs specified action on the object.
+ *
+ * @param actionIndex the index of action.
+ */
+STDMETHODIMP CAccAction::doAction(/* [in] */ long actionIndex)
+{
+
+ return CAccActionBase::doAction(actionIndex);
+}
+
+/**
+ * Gets description of specified action.
+ *
+ * @param actionIndex the index of action.
+ * @param description the description string of the specified action.
+ */
+STDMETHODIMP CAccAction::get_description(long actionIndex,BSTR __RPC_FAR *description)
+{
+
+ return CAccActionBase::get_description(actionIndex, description);
+}
+
+STDMETHODIMP CAccAction::get_name( long actionIndex, BSTR __RPC_FAR *name)
+{
+
+ return CAccActionBase::get_name(actionIndex, name);
+}
+
+STDMETHODIMP CAccAction::get_localizedName( long actionIndex, BSTR __RPC_FAR *localizedName)
+{
+
+ return CAccActionBase::get_localizedName(actionIndex, localizedName);
+}
+
+/**
+ * Returns key binding object (if any) associated with specified action
+ * key binding is string.
+ * e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ *
+ * @param actionIndex the index of action.
+ * @param nMaxBinding the max number of key binding.
+ * @param keyBinding the key binding array.
+ * @param nBinding the actual number of key binding returned.
+ */
+STDMETHODIMP CAccAction::get_keyBinding(
+ /* [in] */ long actionIndex,
+ /* [in] */ long nMaxBinding,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding)
+{
+
+ return CAccActionBase::get_keyBinding(actionIndex, nMaxBinding, keyBinding, nBinding);
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccAction::put_XInterface(long pXInterface)
+{
+
+ return CAccActionBase::put_XInterface(pXInterface);
+}
+/**
+ * Put UNO interface.
+ * @param pXSubInterface XAccessibleHyperlink interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccAction::put_XSubInterface(long pXSubInterface)
+{
+
+
+ pRXAct = (XAccessibleAction*)pXSubInterface;
+
+ return S_OK;
+}
diff --git a/winaccessibility/source/UAccCOM/AccAction.h b/winaccessibility/source/UAccCOM/AccAction.h
new file mode 100644
index 000000000000..01488b1dfbbc
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccAction.h
@@ -0,0 +1,105 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ACCACTION_H_
+#define __ACCACTION_H_
+
+#include "resource.h" // main symbols
+#include "AccActionBase.h"
+
+/**
+ * CAccAction implements IAccessibleAction interface.
+ */
+class ATL_NO_VTABLE CAccAction :
+ public CComObjectRoot,
+ public CComCoClass<CAccAction, &CLSID_AccAction>,
+ public IAccessibleAction,
+ public CAccActionBase
+{
+public:
+ CAccAction()
+ {
+
+ }
+ ~CAccAction()
+ {
+
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_ACCACTION)
+
+ BEGIN_COM_MAP(CAccAction)
+ COM_INTERFACE_ENTRY(IAccessibleAction)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccAction*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ // IAccessibleAction
+public:
+ // IAccessibleAction
+
+ // Returns the number of action.
+ STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
+
+ // Performs specified action on the object.
+ STDMETHOD(doAction)(/* [in] */ long actionIndex);
+
+ // Gets description of specified action.
+ STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
+
+ // added , 2006/06/28, for driver 07/11
+ // get the action name
+ STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
+
+ // get the localized action name
+ STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
+
+ // Returns key binding object (if any) associated with specified action
+ // key binding is string.
+ // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ STDMETHOD(get_keyBinding)(
+ /* [in] */ long actionIndex,
+ /* [in] */ long nMaxBinding,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XSubInterface)(long pXSubInterface);
+
+};
+
+#endif //__ACCACTION_H_
diff --git a/winaccessibility/source/UAccCOM/AccAction.rgs b/winaccessibility/source/UAccCOM/AccAction.rgs
new file mode 100644
index 000000000000..7b51e7b701cf
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccAction.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ UAccCOM.AccAction.1 = s 'AccAction Class'
+ {
+ CLSID = s '{AA49F20E-BB4E-400D-A5B0-6F5B7B770227}'
+ }
+ UAccCOM.AccAction = s 'AccAction Class'
+ {
+ CLSID = s '{AA49F20E-BB4E-400D-A5B0-6F5B7B770227}'
+ CurVer = s 'UAccCOM.AccAction.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {AA49F20E-BB4E-400D-A5B0-6F5B7B770227} = s 'AccAction Class'
+ {
+ ProgID = s 'UAccCOM.AccAction.1'
+ VersionIndependentProgID = s 'UAccCOM.AccAction'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ 'TypeLib' = s '{19ECB1B0-9376-4FF9-B580-223FC9C200B8}'
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.cxx b/winaccessibility/source/UAccCOM/AccActionBase.cxx
new file mode 100644
index 000000000000..bcad3c0df9c2
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccActionBase.cxx
@@ -0,0 +1,416 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//////////////////////////////////////////////////////////////////////
+// AccActionBase.cpp: implementation of the CAccActionBase class.
+//////////////////////////////////////////////////////////////////////
+#include "stdafx.h"
+
+#include "AccActionBase.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+
+#include "AccessibleKeyStroke.h"
+
+#ifndef __ACCCOMMON_H_
+#include "acccommon.h"
+#endif
+
+using namespace com::sun::star::accessibility::AccessibleRole;
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::awt;
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CAccActionBase::CAccActionBase()
+{}
+
+CAccActionBase::~CAccActionBase()
+{}
+
+/**
+ * Helper function used for getting default action by UNO role.
+ *
+ * @param pRContext UNO context interface pointer.
+ * @param pRet the corresponding string to be returned.
+ */
+void GetDfActionByUNORole(XAccessibleContext* pRContext, BSTR* pRet)
+{
+ // #CHECK#
+ if(pRContext == NULL || pRet == NULL)
+ {
+ return;
+ }
+
+ long Role = pRContext->getAccessibleRole();
+
+ switch(Role)
+ {
+ case PUSH_BUTTON:
+ *pRet = ::SysAllocString(PRESS);
+ break;
+ case RADIO_BUTTON:
+ case MENU_ITEM:
+ case LIST_ITEM:
+ *pRet = ::SysAllocString(SELECT);
+ break;
+ case CHECK_BOX:
+ {
+ Reference< XAccessibleStateSet > pRState = pRContext->getAccessibleStateSet();
+ if( !pRState.is() )
+ {
+ return;
+ }
+
+ Sequence<short> pStates = pRState->getStates();
+ int count = pStates.getLength();
+ *pRet = ::SysAllocString(CHECK);
+ for( int iIndex = 0;iIndex < count;iIndex++ )
+ {
+ if( pStates[iIndex] == AccessibleStateType::CHECKED )
+ {
+ SAFE_SYSFREESTRING(*pRet);
+ *pRet = ::SysAllocString(UNCHECK);
+ break;
+ }
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * Returns the number of action.
+ *
+ * @param nActions the number of action.
+ */
+STDMETHODIMP CAccActionBase::nActions(/*[out,retval]*/long* nActions)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if( pRXAct.is() && nActions != NULL )
+ {
+ *nActions = GetXInterface()->getAccessibleActionCount();
+ return S_OK;
+ }
+ *nActions = 0;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Performs specified action on the object.
+ *
+ * @param actionIndex the index of action.
+ */
+STDMETHODIMP CAccActionBase::doAction(/* [in] */ long actionIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if( pRXAct.is() )
+ {
+ return GetXInterface()->doAccessibleAction( actionIndex )?S_OK:E_FAIL;
+ }
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets description of specified action.
+ *
+ * @param actionIndex the index of action.
+ * @param description the description string of the specified action.
+ */
+STDMETHODIMP CAccActionBase::get_description(long actionIndex,BSTR __RPC_FAR *description)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(description == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXAct.is())
+ return E_FAIL;
+
+ ::rtl::OUString ouStr = GetXInterface()->getAccessibleActionDescription(actionIndex);
+ // #CHECK#
+
+ SAFE_SYSFREESTRING(*description);
+ *description = SysAllocString((OLECHAR*)ouStr.getStr());
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CAccActionBase::get_name( long, BSTR __RPC_FAR *)
+{
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP CAccActionBase::get_localizedName( long, BSTR __RPC_FAR *)
+{
+ return E_NOTIMPL;
+}
+
+/**
+ * Returns key binding object (if any) associated with specified action
+ * key binding is string.
+ * e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ *
+ * @param actionIndex the index of action.
+ * @param nMaxBinding the max number of key binding.
+ * @param keyBinding the key binding array.
+ * @param nBinding the actual number of key binding returned.
+ */
+STDMETHODIMP CAccActionBase::get_keyBinding(
+ /* [in] */ long actionIndex,
+ /* [in] */ long,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if( !keyBinding || !nBinding)
+ return E_INVALIDARG;
+
+ if( !pRXAct.is() )
+ return E_FAIL;
+
+ Reference< XAccessibleKeyBinding > binding = GetXInterface()->getAccessibleActionKeyBinding(actionIndex);
+ if( !binding.is() )
+ return E_FAIL;
+
+ long nCount = (binding.get())->getAccessibleKeyBindingCount();
+
+ OLECHAR wString[64];
+
+ *keyBinding = (BSTR*)::CoTaskMemAlloc(nCount*sizeof(BSTR));
+
+ // #CHECK Memory Allocation#
+ if(*keyBinding == NULL)
+ return E_FAIL;
+
+ for( int index = 0;index < nCount;index++ )
+ {
+ memset(wString,0,sizeof(wString));
+ GetkeyBindingStrByXkeyBinding( (binding.get())->getAccessibleKeyBinding(index), wString );
+
+ (*keyBinding)[index] = SysAllocString(wString);
+ }
+
+ *nBinding = nCount;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccActionBase::put_XInterface(long pXInterface)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ Reference<XAccessibleAction> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXAct = NULL;
+ else
+ pRXAct = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Helper function used for converting keybinding to string.
+ *
+ * @param keySet the key stroke sequence.
+ * @param pString the output keybinding string.
+ */
+void CAccActionBase::GetkeyBindingStrByXkeyBinding( const Sequence< KeyStroke > &keySet, OLECHAR* pString )
+{
+ // #CHECK#
+ if(pString == NULL)
+ return;
+
+ for( int iIndex = 0;iIndex < keySet.getLength();iIndex++ )
+ {
+ KeyStroke stroke = keySet[iIndex];
+ OLECHAR wString[64] = {NULL};
+ if(iIndex>0)
+ wcscat( wString, OLESTR(" ") );
+ if((stroke.Modifiers & MODIFIER_SHIFT) == MODIFIER_SHIFT)
+ wcscat( wString, OLESTR("Shift+") );
+ if((stroke.Modifiers & MODIFIER_CTRL) == MODIFIER_CTRL)
+ wcscat( wString, OLESTR("Ctrl+") );
+ if((stroke.Modifiers & MODIFIER_ALT) == MODIFIER_ALT)
+ wcscat( wString, OLESTR("Alt+") );
+ if(stroke.KeyCode)
+ {
+ OLECHAR* pChar = getOLECHARFromKeyCode(stroke.KeyCode);
+ if(pChar != NULL)
+ wcscat( wString, pChar );
+ else if (stroke.KeyCode <= 255)
+ {
+ OLECHAR pChar[4] = {NULL};
+ swprintf( pChar, L"%c", stroke.KeyCode);
+ wcscat( wString, pChar);
+ }
+ else
+ {
+ OLECHAR pChar[4] = {NULL};
+ swprintf( pChar, L"%d", stroke.KeyCode);
+ wcscat( wString, pChar);
+ }
+ }
+
+ wcscat( pString, wString);
+ }
+}
+
+/**
+ * Helper function used for converting key code to ole string.
+ *
+ * @param key the key code.
+ */
+OLECHAR* CAccActionBase::getOLECHARFromKeyCode(long key)
+{
+ static struct keyMap
+ {
+ int keyCode;
+ OLECHAR* key;
+ }
+ map[] =
+ {
+ {MODIFIER_SHIFT, L"SHIFT" },
+ {MODIFIER_CTRL, L"CTRL" },
+ {MODIFIER_ALT, L"ALT" },
+ CODEENTRY(NUM0),CODEENTRY(NUM1),CODEENTRY(NUM2),CODEENTRY(NUM3),CODEENTRY(NUM4),CODEENTRY(NUM5),
+ CODEENTRY(NUM6),CODEENTRY(NUM7),CODEENTRY(NUM8),CODEENTRY(NUM9),
+ CODEENTRY(A),CODEENTRY(B),CODEENTRY(C),CODEENTRY(D),CODEENTRY(E),CODEENTRY(F),
+ CODEENTRY(G),CODEENTRY(H),CODEENTRY(I),CODEENTRY(J),CODEENTRY(K),CODEENTRY(L),
+ CODEENTRY(M),CODEENTRY(N),CODEENTRY(O),CODEENTRY(P),CODEENTRY(Q),CODEENTRY(R),
+ CODEENTRY(S),CODEENTRY(T),CODEENTRY(U),CODEENTRY(V),CODEENTRY(W),CODEENTRY(X),
+ CODEENTRY(Y),CODEENTRY(Z),
+ CODEENTRY(F1),CODEENTRY(F2),CODEENTRY(F3),CODEENTRY(F4),CODEENTRY(F5),CODEENTRY(F6),
+ CODEENTRY(F7),CODEENTRY(F8),CODEENTRY(F9),CODEENTRY(F10),CODEENTRY(F11),CODEENTRY(F12),
+ CODEENTRY(F13),CODEENTRY(F14),CODEENTRY(F15),CODEENTRY(F16),CODEENTRY(F17),CODEENTRY(F18),
+ CODEENTRY(F19),CODEENTRY(F20),CODEENTRY(F21),CODEENTRY(F22),CODEENTRY(F23),CODEENTRY(F24),
+ CODEENTRY(F25),CODEENTRY(F26),
+
+ { KEYCODE_DOWN, L"DOWN" },
+ { KEYCODE_UP, L"UP" },
+ { KEYCODE_LEFT, L"LEFT" },
+ { KEYCODE_RIGHT, L"RIGHT" },
+ { KEYCODE_HOME, L"HOME" },
+ { KEYCODE_END, L"END" },
+ { KEYCODE_PAGEUP, L"PAGEUP" },
+ { KEYCODE_PAGEDOWN, L"PAGEDOWN" },
+ { KEYCODE_RETURN, L"RETURN" },
+ { KEYCODE_ESCAPE, L"ESCAPE" },
+ { KEYCODE_TAB, L"TAB" },
+ { KEYCODE_BACKSPACE, L"BACKSPACE" },
+ { KEYCODE_SPACE, L"SPACE" },
+ { KEYCODE_INSERT, L"INSERT" },
+ { KEYCODE_DELETE, L"DELETE" },
+ { KEYCODE_ADD, L"ADD" },
+ { KEYCODE_SUBTRACT, L"SUBTRACT" },
+ { KEYCODE_MULTIPLY, L"MULTIPLY" },
+ { KEYCODE_DIVIDE, L"DIVIDE" },
+ { KEYCODE_POINT, L"POINT" },
+ { KEYCODE_COMMA, L"COMMA" },
+ { KEYCODE_LESS, L"LESS" },
+ { KEYCODE_GREATER, L"GREATER" },
+ { KEYCODE_EQUAL, L"EQUAL" },
+ { KEYCODE_OPEN, L"OPEN" },
+ { KEYCODE_CUT, L"CUT" },
+ { KEYCODE_COPY, L"COPY" },
+ { KEYCODE_PASTE, L"PASTE" },
+ { KEYCODE_UNDO, L"UNDO" },
+ { KEYCODE_REPEAT, L"REPEAT" },
+ { KEYCODE_FIND, L"FIND" },
+ { KEYCODE_PROPERTIES, L"PROPERTIES" },
+ { KEYCODE_FRONT, L"FRONT" },
+ { KEYCODE_CONTEXTMENU, L"CONTEXTMENU" },
+ { KEYCODE_HELP, L"HELP" },
+ };
+ static long nCount = countof(map);
+
+ long min = 0;
+ long max = nCount-1;
+ long mid = nCount/2;
+ while(min<max)
+ {
+ if(key<map[mid].keyCode)
+ max = mid-1;
+ else if(key>map[mid].keyCode)
+ min = mid+1;
+ else
+ break;
+ mid = (min+max)/2;
+ }
+
+ if(key == map[mid].keyCode)
+ {
+ return map[mid].key;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
diff --git a/winaccessibility/source/UAccCOM/AccActionBase.h b/winaccessibility/source/UAccCOM/AccActionBase.h
new file mode 100644
index 000000000000..349bd49ad6d8
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccActionBase.h
@@ -0,0 +1,92 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//////////////////////////////////////////////////////////////////////
+// AccActionBase.h: interface for the CAccActionBase class.
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_)
+#define AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define WNT
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include "UNOXWrapper.h"
+
+class ATL_NO_VTABLE CAccActionBase : public CUNOXWrapper
+{
+public:
+ CAccActionBase();
+ virtual ~CAccActionBase();
+
+ // IAccessibleAction
+public:
+ // IAccessibleAction
+
+ // Returns the number of action.
+ STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
+
+ // Performs specified action on the object.
+ STDMETHOD(doAction)(/* [in] */ long actionIndex);
+
+ // Gets description of specified action.
+ STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
+
+ // added , 2006/06/28, for driver 07/11
+ // get the action name
+ STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
+
+ // get the localized action Name
+ STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
+
+ // Returns key binding object (if any) associated with specified action
+ // key binding is string.
+ // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ STDMETHOD(get_keyBinding)(
+ /* [in] */ long actionIndex,
+ /* [in] */ long nMaxBinding,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+ static void GetkeyBindingStrByXkeyBinding( const com::sun::star::uno::Sequence< com::sun::star::awt::KeyStroke > &keySet, OLECHAR* pString );
+
+protected:
+
+ static OLECHAR* getOLECHARFromKeyCode(long key);
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleAction> pRXAct;
+
+private:
+ inline com::sun::star::accessibility::XAccessibleAction* GetXInterface()
+ {
+ return pRXAct.get();
+ }
+};
+
+#endif // !defined(AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccComponent.cxx b/winaccessibility/source/UAccCOM/AccComponent.cxx
new file mode 100644
index 000000000000..b209ea5006db
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccComponent.cxx
@@ -0,0 +1,72 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+/**
+ * AccComponent.cpp : Implementation of CUAccCOMApp and DLL registration.
+ */
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccComponent.h"
+
+/**
+ * Returns the location of the upper left corner of the object's bounding
+ * box relative to the parent.
+ *
+ * @param Location the upper left corner of the object's bounding box.
+ */
+STDMETHODIMP CAccComponent::get_locationInParent(long *x, long *y)
+{
+
+ return CAccComponentBase::get_locationInParent(x,y);
+}
+
+/**
+ * Returns the foreground color of this object.
+ *
+ * @param Color the color of foreground.
+ */
+STDMETHODIMP CAccComponent::get_foreground(IA2Color * foreground)
+{
+
+ return CAccComponentBase::get_foreground(foreground);
+}
+
+/**
+ * Returns the background color of this object.
+ *
+ * @param Color the color of background.
+ */
+STDMETHODIMP CAccComponent::get_background(IA2Color * background)
+{
+
+ return CAccComponentBase::get_background(background);
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccComponent::put_XInterface(long pXInterface)
+{
+
+ return CAccComponentBase::put_XInterface(pXInterface);
+}
diff --git a/winaccessibility/source/UAccCOM/AccComponent.h b/winaccessibility/source/UAccCOM/AccComponent.h
new file mode 100644
index 000000000000..6544bbf273e4
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccComponent.h
@@ -0,0 +1,97 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
+#define AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include "UNOXWrapper.h"
+#include "AccComponentBase.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * CAccComponent implements IAccessibleComponent interface.
+ */
+class ATL_NO_VTABLE CAccComponent :
+ public CComObjectRoot,
+ public CComCoClass<CAccComponent,&CLSID_AccComponent>,
+ public IAccessibleComponent,
+ public CAccComponentBase
+{
+public:
+ CAccComponent()
+ {
+ }
+ ~CAccComponent()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccComponent)
+ COM_INTERFACE_ENTRY(IAccessibleComponent)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccComponent)
+
+ // IAccessibleComponent
+public:
+ // IAccessibleComponent
+
+ // Returns the location of the upper left corner of the object's bounding
+ // box relative to the parent.
+ STDMETHOD(get_locationInParent)(long *x, long *y);
+
+ // Returns the foreground color of this object.
+ STDMETHOD(get_foreground)(IA2Color * foreground);
+
+ // Returns the background color of this object.
+ STDMETHOD(get_background)(IA2Color * background);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+};
+
+#endif // !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccComponent.rgs b/winaccessibility/source/UAccCOM/AccComponent.rgs
new file mode 100644
index 000000000000..ee87c169e969
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccComponent.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccComponent.1 = s 'AccComponent Class'
+ {
+ CLSID = s '{9FD9BA47-70AF-4160-99F1-526F2B9F111B}'
+ }
+ UAccCOM.AccComponent = s 'AccComponent Class'
+ {
+ CLSID = s '{9FD9BA47-70AF-4160-99F1-526F2B9F111B}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {9FD9BA47-70AF-4160-99F1-526F2B9F111B} = s 'AccComponent Class'
+ {
+ ProgID = s 'UAccCOM.AccComponent.1'
+ VersionIndependentProgID = s 'UAccCOM.AccComponent'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.cxx b/winaccessibility/source/UAccCOM/AccComponentBase.cxx
new file mode 100644
index 000000000000..234177e62d7d
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccComponentBase.cxx
@@ -0,0 +1,213 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "AccComponentBase.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include "MAccessible.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CAccComponentBase::CAccComponentBase()
+{}
+
+CAccComponentBase::~CAccComponentBase()
+{}
+
+
+/**
+ * Returns the location of the upper left corner of the object's bounding
+ * box relative to the parent.
+ *
+ * @param Location the upper left corner of the object's bounding box.
+ */
+STDMETHODIMP CAccComponentBase::get_locationInParent(long *x, long *y)
+{
+
+ CHECK_ENABLE_INF
+
+ try
+ {
+ if (x == NULL || y == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXComp.is())
+ return E_FAIL;
+
+ const ::com::sun::star::awt::Point& pt = GetXInterface()->getLocation();
+ *x = pt.X;
+ *y = pt.Y;
+ return S_OK;
+ }
+ catch(...)
+ {
+ return E_FAIL;
+ }
+}
+
+/**
+ * Returns the location of the upper left corner of the object's bounding
+ * box in screen.
+ *
+ * @param Location the upper left corner of the object's bounding
+ * box in screen coordinates.
+ */
+STDMETHODIMP CAccComponentBase::get_locationOnScreen(long *x, long *y)
+{
+
+ CHECK_ENABLE_INF
+
+ try
+ {
+ if (x == NULL || y == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXComp.is())
+ return E_FAIL;
+
+ const ::com::sun::star::awt::Point& pt = GetXInterface()->getLocationOnScreen();
+ *x = pt.X;
+ *y = pt.Y;
+ return S_OK;
+
+ }
+ catch(...)
+ {
+ return E_FAIL;
+ }
+}
+
+/**
+ * Grabs the focus to this object.
+ *
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccComponentBase::grabFocus(boolean * success)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (success == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXComp.is())
+ {
+ return E_FAIL;
+ }
+ GetXInterface()->grabFocus();
+ *success = TRUE;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Returns the foreground color of this object.
+ *
+ * @param Color the color of foreground.
+ */
+STDMETHODIMP CAccComponentBase::get_foreground(IA2Color * foreground)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (foreground == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXComp.is())
+ {
+ return E_FAIL;
+ }
+ *foreground = (long)GetXInterface()->getForeground();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Returns the background color of this object.
+ *
+ * @param Color the color of background.
+ */
+STDMETHODIMP CAccComponentBase::get_background(IA2Color * background)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (background == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXComp.is())
+ {
+ return E_FAIL;
+ }
+ *background = (long)GetXInterface()->getBackground();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccComponentBase::put_XInterface(long pXInterface)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleComponent> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXComp = NULL;
+ else
+ pRXComp = pRXI.get();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.h b/winaccessibility/source/UAccCOM/AccComponentBase.h
new file mode 100644
index 000000000000..6eed5782be91
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccComponentBase.h
@@ -0,0 +1,78 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//////////////////////////////////////////////////////////////////////
+// AccComponentBase.h: interface for the CAccComponentBase class.
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_ACCCOMPONENTBASE_H__946BE230_1DCB_494B_ACF6_32A2E197DD2A__INCLUDED_)
+#define AFX_ACCCOMPONENTBASE_H__946BE230_1DCB_494B_ACF6_32A2E197DD2A__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define WNT
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include "UNOXWrapper.h"
+
+class ATL_NO_VTABLE CAccComponentBase : public CUNOXWrapper
+{
+public:
+ CAccComponentBase();
+ virtual ~CAccComponentBase();
+ // IAccessibleComponent
+public:
+ // IAccessibleComponent
+
+ // Returns the location of the upper left corner of the object's bounding
+ // box relative to the parent.
+ STDMETHOD(get_locationInParent)(long *x, long *y);
+
+ // Returns the location of the upper left corner of the object's bounding
+ // box in screen.
+ STDMETHOD(get_locationOnScreen)(long *x, long *y);
+
+ // Grabs the focus to this object.
+ STDMETHOD(grabFocus)(boolean * success);
+
+ // Returns the foreground color of this object.
+ STDMETHOD(get_foreground)(IA2Color * foreground);
+
+ // Returns the background color of this object.
+ STDMETHOD(get_background)(IA2Color * background);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+protected:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleComponent> pRXComp;
+
+ inline com::sun::star::accessibility::XAccessibleComponent* GetXInterface()
+ {
+ return pRXComp.get();
+ }
+};
+
+#endif // !defined(AFX_ACCCOMPONENTBASE_H__946BE230_1DCB_494B_ACF6_32A2E197DD2A__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccContext.rgs b/winaccessibility/source/UAccCOM/AccContext.rgs
new file mode 100644
index 000000000000..b3e9e3a081da
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccContext.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccContext.1 = s 'AccContext Class'
+ {
+ CLSID = s '{F77CAEC2-F04C-4E74-A36C-F3B557BC59E1}'
+ }
+ UAccCOM.AccContext = s 'AccContext Class'
+ {
+ CLSID = s '{F77CAEC2-F04C-4E74-A36C-F3B557BC59E1}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {F77CAEC2-F04C-4E74-A36C-F3B557BC59E1} = s 'AccContext Class'
+ {
+ ProgID = s 'UAccCOM.AccContext.1'
+ VersionIndependentProgID = s 'UAccCOM.AccContext'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx
new file mode 100644
index 000000000000..2dce3b8e111a
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx
@@ -0,0 +1,508 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+/**
+ * AccEditableText.cpp : Implementation of CUAccCOMApp and DLL registration.
+ */
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccEditableText.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/TabStop.hpp>
+#include <vector>
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::awt;
+using namespace com::sun::star::beans;
+using namespace std;
+
+/**
+ * Copys a range of text to the clipboard.
+ *
+ * @param startOffset the start offset of copying.
+ * @param endOffset the end offset of copying.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::copyText(long startOffset, long endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK XInterface#
+ if(!pRXEdtTxt.is())
+ {
+ return E_FAIL;
+ }
+
+ if ( GetXInterface()->copyText( startOffset, endOffset ) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Deletes a range of text.
+ *
+ * @param startOffset the start offset of deleting.
+ * @param endOffset the end offset of deleting.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::deleteText(long startOffset, long endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ if( GetXInterface()->deleteText( startOffset, endOffset ) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Inserts text at a specified offset.
+ *
+ * @param offset the offset of inserting.
+ * @param text the text to be inserted.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::insertText(long offset, BSTR * text)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (text == NULL)
+ return E_INVALIDARG;
+
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ ::rtl::OUString ouStr(*text);
+
+ if( GetXInterface()->insertText( ouStr, offset ) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Cuts a range of text to the clipboard.
+ *
+ * @param startOffset the start offset of cuting.
+ * @param endOffset the end offset of cuting.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::cutText(long startOffset, long endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ if( GetXInterface()->cutText( startOffset, endOffset ) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Pastes text from clipboard at specified offset.
+ *
+ * @param offset the offset of pasting.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::pasteText(long offset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ if( GetXInterface()->pasteText( offset ) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Replaces range of text with new text.
+ *
+ * @param startOffset the start offset of replacing.
+ * @param endOffset the end offset of replacing.
+ * @param text the replacing text.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::replaceText(long startOffset, long endOffset, BSTR * text)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if (text == NULL)
+ return E_INVALIDARG;
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ ::rtl::OUString ouStr(*text);
+
+ if( GetXInterface()->replaceText( startOffset,endOffset, ouStr) )
+ return S_OK;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Sets attributes of range of text.
+ *
+ * @param startOffset the start offset.
+ * @param endOffset the end offset.
+ * @param attributes the attribute text.
+ * @param success the boolean result to be returned.
+ */
+STDMETHODIMP CAccEditableText::setAttributes(long startOffset, long endOffset, BSTR * attributes)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if (attributes == NULL)
+ return E_INVALIDARG;
+ if( !pRXEdtTxt.is() )
+ return E_FAIL;
+
+ ::rtl::OUString ouStr(*attributes);
+
+ sal_Int32 nIndex = 0;
+ sal_Unicode cTok = ';';
+ vector< ::rtl::OUString > vecAttr;
+ do
+ {
+ ::rtl::OUString ouToken = ouStr.getToken(0, cTok, nIndex);
+ vecAttr.push_back(ouToken);
+ }
+ while(nIndex >= 0);
+
+ Sequence< PropertyValue > beanSeq(vecAttr.size());
+ for(unsigned int i = 0; i < vecAttr.size(); i ++)
+ {
+ ::rtl::OUString attr = vecAttr[i];
+ sal_Int32 nPos = attr.indexOf(':');
+ if(nPos > -1)
+ {
+ ::rtl::OUString attrName = attr.copy(0, nPos);
+ ::rtl::OUString attrValue = attr.copy(nPos + 1, attr.getLength() - nPos - 1);
+ beanSeq[i].Name = attrName;
+ get_AnyFromOLECHAR(attrName, attrValue, beanSeq[i].Value);
+ }
+ }
+
+ if( GetXInterface()->setAttributes( startOffset,endOffset, beanSeq) )
+ return S_OK;
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Convert attributes string to Any type.
+ * Reference to infra\accessibility\bridge\org\openoffice\java\accessibility\AccessibleTextImpl.java
+ *
+ * @param ouName the string of attribute name.
+ * @param ouValue the string of attribute value.
+ * @param rAny the Any object to be returned.
+ */
+void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const ::rtl::OUString &ouValue, Any &rAny)
+{
+ if(ouName.compareTo(L"CharBackColor") == 0 ||
+ ouName.compareTo(L"CharColor") == 0 ||
+ ouName.compareTo(L"ParaAdjust") == 0 ||
+ ouName.compareTo(L"ParaFirstLineIndent") == 0 ||
+ ouName.compareTo(L"ParaLeftMargin") == 0 ||
+ ouName.compareTo(L"ParaRightMargin") == 0 ||
+ ouName.compareTo(L"ParaTopMargin") == 0 ||
+ ouName.compareTo(L"ParaBottomMargin") == 0 ||
+ ouName.compareTo(L"CharFontPitch") == 0)
+ {
+ // Convert to int.
+ // NOTE: CharFontPitch is not implemented in java file.
+ sal_Int32 nValue = ouValue.toInt32();
+ rAny.setValue(&nValue, getCppuType((sal_Int32 *)0));
+ }
+ else if(ouName.compareTo(L"CharShadowed") == 0 ||
+ ouName.compareTo(L"CharContoured") == 0)
+ {
+ // Convert to boolean.
+ boolean nValue = (boolean)ouValue.toBoolean();
+ rAny.setValue(&nValue, getCppuType((sal_Bool *)sal_False));
+ }
+ else if(ouName.compareTo(L"CharEscapement") == 0 ||
+ ouName.compareTo(L"CharStrikeout") == 0 ||
+ ouName.compareTo(L"CharUnderline") == 0 ||
+ ouName.compareTo(L"CharFontPitch") == 0)
+ {
+ // Convert to short.
+ short nValue = (short)ouValue.toInt32();
+ rAny.setValue(&nValue, getCppuType((short *)0));
+ }
+ else if(ouName.compareTo(L"CharHeight") == 0 ||
+ ouName.compareTo(L"CharWeight") == 0)
+ {
+ // Convert to float.
+ float fValue = ouValue.toFloat();
+ rAny.setValue(&fValue, getCppuType((float *)0));
+ }
+ else if(ouName.compareTo(L"CharFontName") == 0)
+ {
+ // Convert to string.
+ rAny.setValue(&ouValue, getCppuType((::rtl::OUString *)0));
+ }
+ else if(ouName.compareTo(L"CharPosture") == 0)
+ {
+ // Convert to FontSlant.
+ ::com::sun::star::awt::FontSlant fontSlant = (::com::sun::star::awt::FontSlant)ouValue.toInt32();
+ rAny.setValue(&fontSlant, getCppuType((::com::sun::star::awt::FontSlant*)0));
+ }
+ else if(ouName.compareTo(L"ParaTabStops") == 0)
+ {
+ //
+ // Convert to the Sequence with TabStop element.
+ vector< ::com::sun::star::style::TabStop > vecTabStop;
+ ::com::sun::star::style::TabStop tabStop;
+ ::rtl::OUString ouSubValue;
+ sal_Int32 nIndex = 0;
+ sal_Int32 pos = 0, posComma = 0;
+
+ do
+ {
+ // Position.
+ pos = ouValue.indexOf(L"Position=", pos);
+ if(pos != -1)
+ {
+ posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "Position=".
+ if(posComma != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 9, posComma - pos - 9);
+ tabStop.Position = ouSubValue.toInt32();
+ pos = posComma + 1;
+
+ // TabAlign.
+ pos = ouValue.indexOf(L"TabAlign=", pos);
+ if(pos != -1)
+ {
+ posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "TabAlign=".
+ if(posComma != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 9, posComma - pos - 9);
+ tabStop.Alignment = (::com::sun::star::style::TabAlign)ouSubValue.toInt32();
+ pos = posComma + 1;
+
+ // DecimalChar.
+ pos = ouValue.indexOf(L"DecimalChar=", pos);
+ if(pos != -1)
+ {
+ posComma = ouValue.indexOf(',', pos + 11); // 11 = length of "TabAlign=".
+ if(posComma != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 11, posComma - pos - 11);
+ tabStop.DecimalChar = (sal_Unicode)ouSubValue.toChar();
+ pos = posComma + 1;
+
+ // FillChar.
+ pos = ouValue.indexOf(L"FillChar=", pos);
+ if(pos != -1)
+ {
+ posComma = ouValue.indexOf(',', pos + 9); // 9 = length of "TabAlign=".
+ if(posComma != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 9, posComma - pos - 9);
+ tabStop.DecimalChar = (sal_Unicode)ouSubValue.toChar();
+ pos = posComma + 1;
+
+ // Complete TabStop element.
+ vecTabStop.push_back(tabStop);
+ }
+ else
+ break; // No match comma.
+ }
+ else
+ break; // No match FillChar.
+ }
+ else
+ break; // No match comma.
+ }
+ else
+ break; // No match DecimalChar.
+ }
+ else
+ break; // No match comma.
+ }
+ else
+ break; // No match TabAlign.
+ }
+ else
+ break; // No match comma.
+ }
+ else
+ break; // No match Position.
+ }
+ while(pos < ouValue.getLength());
+
+ //
+ // Dump into Sequence.
+ int iSeqLen = (vecTabStop.size() == 0) ? 1 : vecTabStop.size();
+ Sequence< ::com::sun::star::style::TabStop > seqTabStop(iSeqLen);
+
+ if(vecTabStop.size() != 0)
+ {
+ // Dump every element.
+ for(int i = 0; i < iSeqLen; i ++)
+ {
+ seqTabStop[i] = vecTabStop[i];
+ }
+ }
+ else
+ {
+ // Create default value.
+ seqTabStop[0].Position = 0;
+ seqTabStop[0].Alignment = ::com::sun::star::style::TabAlign_DEFAULT;
+ seqTabStop[0].DecimalChar = '.';
+ seqTabStop[0].FillChar = ' ';
+ }
+
+ // Assign to Any object.
+ rAny.setValue(&seqTabStop, getCppuType((Sequence< ::com::sun::star::style::TabStop >*)0));
+ }
+ else if(ouName.compareTo(L"ParaLineSpacing") == 0)
+ {
+ // Parse value string.
+ ::com::sun::star::style::LineSpacing lineSpacing;
+ ::rtl::OUString ouSubValue;
+ sal_Int32 pos = 0, posComma = 0;
+
+ pos = ouValue.indexOf(L"Mode=", pos);
+ if(pos != -1)
+ {
+ posComma = ouValue.indexOf(',', pos + 5); // 5 = length of "Mode=".
+ if(posComma != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 5, posComma - pos - 5);
+ lineSpacing.Mode = (sal_Int16)ouSubValue.toInt32();
+ pos = posComma + 1;
+
+ pos = ouValue.indexOf(L"Height=", pos);
+ if(pos != -1)
+ {
+ ouSubValue = ouValue.copy(pos + 7, ouValue.getLength() - pos - 7);
+ lineSpacing.Height = (sal_Int16)ouSubValue.toInt32();
+ }
+ else
+ {
+ lineSpacing.Height = (sal_Int16)100; // Default height.
+ }
+ }
+ else
+ {
+ lineSpacing.Height = (sal_Int16)100; // Default height.
+ }
+ }
+ else
+ {
+ // Default Mode and Height.
+ lineSpacing.Mode = (sal_Int16)0;
+ lineSpacing.Height = (sal_Int16)100; // Default height.
+ }
+
+ // Convert to Any object.
+ rAny.setValue(&lineSpacing, getCppuType((::com::sun::star::style::LineSpacing* )0));
+ }
+ else
+ {
+ // Do nothing.
+ sal_Int32 nDefault = 0;
+ rAny.setValue(&nDefault, getCppuType((sal_Int32 *)0));
+ }
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccEditableText::put_XInterface(long pXInterface)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleEditableText> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXEdtTxt = NULL;
+ else
+ pRXEdtTxt = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
diff --git a/winaccessibility/source/UAccCOM/AccEditableText.h b/winaccessibility/source/UAccCOM/AccEditableText.h
new file mode 100644
index 000000000000..8542a740a5ee
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccEditableText.h
@@ -0,0 +1,115 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCEDITABLETEXT_H__0C41AFBE_5A87_4D9D_A284_CEC264D91F81__INCLUDED_)
+#define AFX_ACCEDITABLETEXT_H__0C41AFBE_5A87_4D9D_A284_CEC264D91F81__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h"
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
+#include "UNOXWrapper.h"
+
+/**
+ * CAccEditableText implements IAccessibleEditableText interface.
+ */
+class CAccEditableText :
+ public CComObjectRoot,
+ public CComCoClass<CAccEditableText,&CLSID_AccEditableText>,
+ public IAccessibleEditableText,
+ public CUNOXWrapper
+{
+public:
+ CAccEditableText()
+ {
+
+ }
+ virtual ~CAccEditableText()
+ {
+
+ }
+
+ BEGIN_COM_MAP(CAccEditableText)
+ COM_INTERFACE_ENTRY(IAccessibleEditableText)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccEditableText*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccEditableText)
+
+ // IAccessibleEditableText
+public:
+ // IAccessibleEditableText
+
+ // Copys a range of text to the clipboard.
+ STDMETHOD(copyText)(long startOffset, long endOffset);
+
+ // Deletes a range of text.
+ STDMETHOD(deleteText)(long startOffset, long endOffset);
+
+ // Inserts text at a specified offset.
+ STDMETHOD(insertText)(long offset, BSTR * text);
+
+ // Cuts a range of text to the clipboard.
+ STDMETHOD(cutText)(long startOffset, long endOffset);
+
+ // Pastes text from clipboard at specified offset.
+ STDMETHOD(pasteText)(long offset);
+
+ // Replaces range of text with new text.
+ STDMETHOD(replaceText)(long startOffset, long endOffset, BSTR * text);
+
+
+ // Sets attributes of range of text.
+ STDMETHOD(setAttributes)(long startOffset, long endOffset, BSTR * attributes);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleEditableText> pRXEdtTxt;
+
+ void get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const ::rtl::OUString &ouValue, com::sun::star::uno::Any &rAny);
+
+ inline com::sun::star::accessibility::XAccessibleEditableText* GetXInterface()
+ {
+ return pRXEdtTxt.get();
+ }
+};
+
+#endif // !defined(AFX_ACCEDITABLETEXT_H__0C41AFBE_5A87_4D9D_A284_CEC264D91F81__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccEditableText.rgs b/winaccessibility/source/UAccCOM/AccEditableText.rgs
new file mode 100644
index 000000000000..03aacb325719
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccEditableText.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccEditableText.1 = s 'AccEditableText Class'
+ {
+ CLSID = s '{79CE1450-1F61-48E2-BF76-C07BD10105E2}'
+ }
+ UAccCOM.AccEditableText = s 'AccEditableText Class'
+ {
+ CLSID = s '{79CE1450-1F61-48E2-BF76-C07BD10105E2}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {79CE1450-1F61-48E2-BF76-C07BD10105E2} = s 'AccEditableText Class'
+ {
+ ProgID = s 'UAccCOM.AccEditableText.1'
+ VersionIndependentProgID = s 'UAccCOM.AccEditableText'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccExtendedComponent.rgs b/winaccessibility/source/UAccCOM/AccExtendedComponent.rgs
new file mode 100644
index 000000000000..6039885b357d
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccExtendedComponent.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccExtendedComponent.1 = s 'AccExtendedComponent Class'
+ {
+ CLSID = s '{D91562E1-BE6C-41F3-A34C-E7AA846561A4}'
+ }
+ UAccCOM.AccExtendedComponent = s 'AccExtendedComponent Class'
+ {
+ CLSID = s '{D91562E1-BE6C-41F3-A34C-E7AA846561A4}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {D91562E1-BE6C-41F3-A34C-E7AA846561A4} = s 'AccExtendedComponent Class'
+ {
+ ProgID = s 'UAccCOM.AccExtendedComponent.1'
+ VersionIndependentProgID = s 'UAccCOM.AccExtendedComponent'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccFont.rgs b/winaccessibility/source/UAccCOM/AccFont.rgs
new file mode 100644
index 000000000000..c229746dbca6
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccFont.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccFont.1 = s 'AccFont Class'
+ {
+ CLSID = s '{185B9AD9-5D31-4793-888F-A21846BBAEDD}'
+ }
+ UAccCOM.AccFont = s 'AccFont Class'
+ {
+ CLSID = s '{185B9AD9-5D31-4793-888F-A21846BBAEDD}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {185B9AD9-5D31-4793-888F-A21846BBAEDD} = s 'AccFont Class'
+ {
+ ProgID = s 'UAccCOM.AccFont.1'
+ VersionIndependentProgID = s 'UAccCOM.AccFont'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccHyperLink.cxx b/winaccessibility/source/UAccCOM/AccHyperLink.cxx
new file mode 100644
index 000000000000..b63ccd09e246
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHyperLink.cxx
@@ -0,0 +1,296 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccHyperLink.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include "MAccessible.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::awt;
+
+/**
+ * Returns the number of action.
+ *
+ * @param nActions the number of action.
+ */
+STDMETHODIMP CAccHyperLink::nActions(/*[out,retval]*/long* nActions)
+{
+
+ return CAccActionBase::nActions(nActions);
+}
+
+/**
+ * Performs specified action on the object.
+ *
+ * @param actionIndex the index of action.
+ */
+STDMETHODIMP CAccHyperLink::doAction(/* [in] */ long actionIndex)
+{
+
+ return CAccActionBase::doAction(actionIndex);
+}
+
+/**
+ * Gets description of specified action.
+ *
+ * @param actionIndex the index of action.
+ * @param description the description string of the specified action.
+ */
+STDMETHODIMP CAccHyperLink::get_description(long actionIndex,BSTR __RPC_FAR *description)
+{
+
+ return CAccActionBase::get_description(actionIndex, description);
+}
+
+STDMETHODIMP CAccHyperLink::get_name( long actionIndex, BSTR __RPC_FAR *name)
+{
+
+ return CAccActionBase::get_name(actionIndex, name);
+}
+
+STDMETHODIMP CAccHyperLink::get_localizedName( long actionIndex, BSTR __RPC_FAR *localizedName)
+{
+
+ return CAccActionBase::get_name(actionIndex, localizedName);
+}
+
+/**
+ * Returns key binding object (if any) associated with specified action
+ * key binding is string.
+ * e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ *
+ * @param actionIndex the index of action.
+ * @param nMaxBinding the max number of key binding.
+ * @param keyBinding the key binding array.
+ * @param nBinding the actual number of key binding returned.
+ */
+STDMETHODIMP CAccHyperLink::get_keyBinding(
+ /* [in] */ long actionIndex,
+ /* [in] */ long nMaxBinding,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding)
+{
+
+ return CAccActionBase::get_keyBinding(actionIndex, nMaxBinding, keyBinding, nBinding);
+}
+
+/**
+ * get an object
+ * @param
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::get_anchor(/* [in] */ long index,
+ /* [retval][out] */ VARIANT __RPC_FAR *anchor)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(anchor == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ // #CHECK XInterface#
+ if(!pRXLink.is())
+ {
+ return E_FAIL;
+ }
+ // Get Any type value via pRXLink.
+ ::com::sun::star::uno::Any anyVal = GetXInterface()->getAccessibleActionAnchor(index);
+ // Convert Any to VARIANT.
+ CMAccessible::ConvertAnyToVariant(anyVal, anchor);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * get an object
+ * @param
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::get_anchorTarget(/* [in] */ long index,
+ /* [retval][out] */ VARIANT __RPC_FAR *anchorTarget)
+{
+
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(anchorTarget == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ // #CHECK XInterface#
+ if(!pRXLink.is())
+ {
+ return E_FAIL;
+ }
+ // Get Any type value via pRXLink.
+ ::com::sun::star::uno::Any anyVal = GetXInterface()->getAccessibleActionObject(index);
+ // Convert Any to VARIANT.
+ CMAccessible::ConvertAnyToVariant(anyVal, anchorTarget);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+/**
+ * Get start index.
+ * @param index Variant to get start index.
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::get_startIndex(/* [retval][out] */ long __RPC_FAR *index)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(index == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ *index = GetXInterface()->getStartIndex();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get start index.
+ * @param index Variant to get end index.
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::get_endIndex(/* [retval][out] */ long __RPC_FAR *index)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(index == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ // #CHECK XInterface#
+ if(!pRXLink.is())
+ {
+ return E_FAIL;
+ }
+ *index = GetXInterface()->getEndIndex();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Judge if the hyperlink is valid.
+ * @param valid Variant to get validity.
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::get_valid(/* [retval][out] */ boolean __RPC_FAR *valid)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(valid == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ // #CHECK XInterface#
+ if(!pRXLink.is())
+ {
+ return E_FAIL;
+ }
+ *valid = GetXInterface()->isValid();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put UNO interface.
+ * @param pXInterface XAccessibleContext interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::put_XInterface(long pXInterface)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ CAccActionBase::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface != NULL)
+ {
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleHyperlink> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ {
+ pRXLink = NULL;
+ }
+ else
+ pRXLink = pRXI.get();
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put UNO interface.
+ * @param pXSubInterface XAccessibleHyperlink interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccHyperLink::put_XSubInterface(long pXSubInterface)
+{
+
+ CHECK_ENABLE_INF
+
+ pRXLink = (XAccessibleHyperlink*)pXSubInterface;
+ pRXAct = (XAccessibleAction*)pXSubInterface;
+
+ return S_OK;
+}
diff --git a/winaccessibility/source/UAccCOM/AccHyperLink.h b/winaccessibility/source/UAccCOM/AccHyperLink.h
new file mode 100644
index 000000000000..56415c225ca3
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHyperLink.h
@@ -0,0 +1,140 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCHYPERLINK_H__59DA79A5_A895_43DB_9495_2B2049CF5C65__INCLUDED_)
+#define AFX_ACCHYPERLINK_H__59DA79A5_A895_43DB_9495_2B2049CF5C65__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+#include "AccActionBase.h"
+#include "UNOXWrapper.h"
+
+/**
+ * CAccHyperLink implements IAccessibleHyperlink interface.
+ */
+class ATL_NO_VTABLE CAccHyperLink :
+ public CComObjectRoot,
+ public CComCoClass<CAccHyperLink,&CLSID_AccHyperLink>,
+ public IAccessibleHyperlink,
+ public CAccActionBase
+{
+public:
+ CAccHyperLink()
+ {
+ }
+ ~CAccHyperLink()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccHyperLink)
+ COM_INTERFACE_ENTRY(IAccessibleAction)
+ COM_INTERFACE_ENTRY(IAccessibleHyperlink)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ END_COM_MAP()
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccHyperLink)
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccHyperLink*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ // IAccessibleHyperlink
+public:
+ // IAccessibleAction
+
+ // Returns the number of action.
+ STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
+
+ // Performs specified action on the object.
+ STDMETHOD(doAction)(/* [in] */ long actionIndex);
+
+ // get the action name
+ STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
+
+ // get the localized action name
+ STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
+
+ // Gets description of specified action.
+ STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
+
+ // Returns key binding object (if any) associated with specified action
+ // key binding is string.
+ // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
+ STDMETHOD(get_keyBinding)(
+ /* [in] */ long actionIndex,
+ /* [in] */ long nMaxBinding,
+ /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
+ /* [retval][out] */ long __RPC_FAR *nBinding);
+
+ // IAccessibleHyperlink
+
+ // get an object, e.g. BSTR or image object, that is overloaded with link behavior
+ STDMETHOD(get_anchor)(/* [in] */ long index,
+ /* [retval][out] */ VARIANT __RPC_FAR *anchor);
+
+ // get an object representing the target of the link, usually a BSTR of the URI
+ STDMETHOD(get_anchorTarget)(/* [in] */ long index,
+ /* [retval][out] */ VARIANT __RPC_FAR *anchorTarget);
+
+ // Returns the index at which the textual representation of the
+ // hyperlink (group) starts.
+ STDMETHOD(get_startIndex)(/* [retval][out] */ long __RPC_FAR *index);
+
+ // Returns the index at which the textual rerpesentation of the
+ // hyperlink (group) ends.
+ STDMETHOD(get_endIndex)(/* [retval][out] */ long __RPC_FAR *index);
+
+ // Returns whether the document referenced by this links is still valid.
+ STDMETHOD(get_valid)(/* [retval][out] */ boolean __RPC_FAR *valid);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XSubInterface)(long pXSubInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleHyperlink> pRXLink;
+
+ inline com::sun::star::accessibility::XAccessibleHyperlink* GetXInterface()
+ {
+ return pRXLink.get();
+ }
+
+};
+
+#endif // !defined(AFX_ACCHYPERLINK_H__59DA79A5_A895_43DB_9495_2B2049CF5C65__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccHyperLink.rgs b/winaccessibility/source/UAccCOM/AccHyperLink.rgs
new file mode 100644
index 000000000000..ceb622ee0e95
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHyperLink.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccHyperLink.1 = s 'AccHyperLink Class'
+ {
+ CLSID = s '{519A64CD-F6A6-4793-BE50-4E36C4C593EF}'
+ }
+ UAccCOM.AccHyperLink = s 'AccHyperLink Class'
+ {
+ CLSID = s '{519A64CD-F6A6-4793-BE50-4E36C4C593EF}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {519A64CD-F6A6-4793-BE50-4E36C4C593EF} = s 'AccHyperLink Class'
+ {
+ ProgID = s 'UAccCOM.AccHyperLink.1'
+ VersionIndependentProgID = s 'UAccCOM.AccHyperLink'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccHypertext.cxx b/winaccessibility/source/UAccCOM/AccHypertext.cxx
new file mode 100644
index 000000000000..5e0e40d82d2c
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHypertext.cxx
@@ -0,0 +1,409 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccHypertext.h"
+
+#include "act.hxx"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/////////////////////////////////////////////////////////////////////////////
+//
+/**
+ * Get special selection.
+ * @param startOffset Start selection offset.
+ * @param endOffset End selection offset.
+ * @param success Variant to accept the result of if the method call is successful.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::addSelection(long startOffset, long endOffset)
+{
+
+ return CAccTextBase::get_addSelection(startOffset, endOffset);
+}
+
+
+/**
+ * Get special attributes.
+ * @param offset Offset.
+ * @param startOffset Variant to accept start offset.
+ * @param endOffset Variant to accept end offset.
+ * @param textAttributes Variant to accept attributes.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes)
+{
+
+ return CAccTextBase::get_attributes(offset, startOffset, endOffset, textAttributes);
+}
+
+/**
+ * Get caret position.
+ * @param offset Variant to accept caret offset.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_caretOffset(long * offset)
+{
+
+ return CAccTextBase::get_caretOffset(offset);
+}
+
+/**
+ * Get character count.
+ * @param nCharacters Variant to accept character count.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_characterCount(long * nCharacters)
+{
+
+ return CAccTextBase::get_characterCount(nCharacters);
+}
+
+/**
+ * Get character extents.
+ * @param offset Offset.
+ * @param x Variant to accpet x position.
+ * @param y Variant to accpet y position.
+ * @param width Variant to accpet width.
+ * @param Height Variant to accpet height.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height)
+{
+
+ return CAccTextBase::get_characterExtents(offset, coordType, x, y, width, height);
+}
+
+/**
+ * Get slections count.
+ * @param nSelections Variant to accpet slections count.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_nSelections(long * nSelections)
+{
+
+ return CAccTextBase::get_nSelections(nSelections);
+}
+
+/**
+ * Get offset of some special point.
+ * @param x X position of one point.
+ * @param x Y position of one point.
+ * @param coordType Type.
+ * @param offset Variant to accept offset.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_offsetAtPoint(long x, long y, IA2CoordinateType coordType, long * offset)
+{
+ return CAccTextBase::get_offsetAtPoint(x, y, coordType, offset);
+}
+
+/**
+ * Get selection range.
+ * @param selection selection count.
+ * @param startOffset Variant to accept the start offset of special selection.
+ * @param endOffset Variant to accept the end offset of special selection.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_selection(long selection, long * startOffset, long * endOffset)
+{
+
+ return CAccTextBase::get_selection(selection, startOffset, endOffset);
+}
+
+/**
+ * Get special text.
+ * @param startOffset Start position of special range.
+ * @param endOffset End position of special range.
+ * @param text Variant to accept the text of special range.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_text(long startOffset, long endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_text(startOffset, endOffset, text);
+}
+
+/**
+ * Get special text before some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textBeforeOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Get special text after some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textAfterOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Get special text at some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textAtOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Remove selection.
+ * @param selectionIndex Special selection index
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::removeSelection(long selectionIndex)
+{
+
+ return CAccTextBase::removeSelection(selectionIndex);
+}
+
+/**
+ * Set caret position.
+ * @param offset Special position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::setCaretOffset(long offset)
+{
+
+ return CAccTextBase::setCaretOffset(offset);
+}
+
+/**
+ * Set special selection.
+ * @param selectionIndex Special selection index.
+ * @param startOffset start position.
+ * @param endOffset end position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::setSelection(long selectionIndex, long startOffset, long endOffset)
+{
+
+ return CAccTextBase::setSelection(selectionIndex, startOffset,
+ endOffset);
+}
+
+/**
+ * Get characters count.
+ * @param nCharacters Variant to accept the characters count.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_nCharacters(long * nCharacters)
+{
+
+ return CAccTextBase::get_nCharacters(nCharacters);
+}
+
+STDMETHODIMP CAccHypertext::get_newText( IA2TextSegment *newText)
+{
+ return CAccTextBase::get_newText(newText);
+}
+
+STDMETHODIMP CAccHypertext::get_oldText( IA2TextSegment *oldText)
+{
+ return CAccTextBase::get_oldText(oldText);
+}
+
+/**
+ * Scroll to special sub-string .
+ * @param startIndex Start index of sub string.
+ * @param endIndex End index of sub string.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::scrollSubstringToPoint(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y )
+{
+
+ return CAccTextBase::scrollSubstringToPoint(startIndex, endIndex, coordinateType, x, y);
+}
+STDMETHODIMP CAccHypertext::scrollSubstringTo(long startIndex, long endIndex,enum IA2ScrollType scrollType)
+{
+
+ return CAccTextBase::scrollSubstringTo(startIndex, endIndex,scrollType);
+}
+
+/**
+ * Get hyperlink count.
+ * @param hyperlinkCount Variant to accpet hyperlink count.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_nHyperlinks(long *hyperlinkCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(hyperlinkCount == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pHyperText.is())
+ {
+ return E_FAIL;
+ }
+
+ *hyperlinkCount = pHyperText->getHyperLinkCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special hyperlink.
+ * @param index Special hyperlink index.
+ * @param hyperlink Variant to accept special hyperlink via index.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_hyperlink(long index,IAccessibleHyperlink **hyperlink)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(hyperlink == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pHyperText.is())
+ {
+ return E_FAIL;
+ }
+
+ Reference<XAccessibleHyperlink> pRLink = pHyperText->getHyperLink(index);
+ if(!pRLink.is())
+ {
+ *hyperlink = NULL;
+ return E_FAIL;
+ }
+
+ IAccessibleHyperlink* plink = NULL;
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance( CLSID_AccHyperLink, NULL, CLSCTX_SERVER ,
+ IID_IAccessibleHyperlink,
+ (void **)&plink);
+ DeactivateActContext();
+ if( SUCCEEDED(hr) )
+ {
+ IUNOXWrapper* wrapper = NULL;
+ plink->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
+ if(wrapper)
+ {
+ wrapper->put_XSubInterface((long)pRLink.get()/*pXI*/);
+ wrapper->Release();
+ }
+ *hyperlink = plink;
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Returns the index of the hyperlink that is associated with this character index.
+ * @param charIndex Special char index.
+ * @param hyperlinkIndex Variant to accept special hyperlink index.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::get_hyperlinkIndex(long charIndex, long *hyperlinkIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(hyperlinkIndex == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pHyperText.is())
+ {
+ return E_FAIL;
+ }
+
+ *hyperlinkIndex = pHyperText->getHyperLinkIndex(charIndex);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put UNO interface.
+ * @param pXInterface UNO interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccHypertext::put_XInterface(long pXInterface)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CAccTextBase::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleHypertext> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pHyperText = NULL;
+ else
+ pHyperText = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
diff --git a/winaccessibility/source/UAccCOM/AccHypertext.h b/winaccessibility/source/UAccCOM/AccHypertext.h
new file mode 100644
index 000000000000..5a817d20f492
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHypertext.h
@@ -0,0 +1,161 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCHYPERTEXT_H__6DC133B6_03DB_42C6_A9B7_27AF4FDA00CA__INCLUDED_)
+#define AFX_ACCHYPERTEXT_H__6DC133B6_03DB_42C6_A9B7_27AF4FDA00CA__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
+#include "AccTextBase.h"
+
+/**
+ * CAccHypertext implements IAccessibleHypertext interface.
+ */
+class ATL_NO_VTABLE CAccHypertext :
+ public CComObjectRoot,
+ public CComCoClass<CAccHypertext,&CLSID_AccHypertext>,
+ public IAccessibleHypertext,
+ public CAccTextBase
+{
+public:
+ CAccHypertext()
+ {
+ }
+ ~CAccHypertext()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccHypertext)
+ COM_INTERFACE_ENTRY(IAccessibleText)
+ COM_INTERFACE_ENTRY(IAccessibleHypertext)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccHypertext*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccHypertext)
+
+ // IAccessibleHypertext
+public:
+ // IAccessibleText
+
+ // Adds a text selection.
+ STDMETHOD(addSelection)(long startOffset, long endOffset);//, unsigned char * success)
+
+ // Gets text attributes.
+ STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes);
+
+ // Gets caret offset.
+ STDMETHOD(get_caretOffset)(long * offset);
+
+ // Gets total number of characters.
+ STDMETHOD(get_characterCount)(long * nCharacters);
+
+ // Gets bounding rect containing the glyph(s) representing the character
+ // at the specified text offset
+ STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height);
+
+ // Gets number of active non-contiguous selections.
+ STDMETHOD(get_nSelections)(long * nSelections);
+
+ // Gets bounding rect for the glyph at a certain point.
+ STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset);
+
+ // Gets character offsets of N-th active text selection.
+ STDMETHOD(get_selection)(long selection, long * startOffset, long * endOffset);
+
+ // Gets a range of text by offset NOTE: returned string may be longer
+ // than endOffset-startOffset bytes if text contains multi-byte characters.
+ STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text);
+
+ // Gets a specified amount of text that ends before a specified offset.
+ STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that spans the specified offset.
+ STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that starts after a specified offset.
+ STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Unselects a range of text.
+ STDMETHOD(removeSelection)(long selectionIndex);
+
+ // Moves text caret.
+ STDMETHOD(setCaretOffset)(long offset);
+
+ // Changes the bounds of an existing selection.
+ STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset);
+
+ // Gets total number of characters.
+ // NOTE: this may be different than the total number of bytes required
+ // to store the text, if the text contains multi-byte characters.
+ STDMETHOD(get_nCharacters)(long * nCharacters);
+
+ // Makes specific part of string visible on screen.
+ STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType);
+
+ STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y );
+
+ STDMETHOD(get_newText)( IA2TextSegment *newText);
+
+ STDMETHOD(get_oldText)( IA2TextSegment *oldText);
+
+ //IAccessibleHypertext
+
+ // Gets the number of hyperlink.
+ STDMETHOD(get_nHyperlinks)(long *hyperlinkCount);
+
+ // Gets the hyperlink object via specified index.
+ STDMETHOD(get_hyperlink)(long index,IAccessibleHyperlink **hyperlink);
+
+ // Returns the index of the hyperlink that is associated with this
+ // character index.
+ STDMETHOD(get_hyperlinkIndex)(long charIndex, long *hyperlinkIndex);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleHypertext> pHyperText;
+
+};
+
+#endif // !defined(AFX_ACCHYPERTEXT_H__6DC133B6_03DB_42C6_A9B7_27AF4FDA00CA__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccHypertext.rgs b/winaccessibility/source/UAccCOM/AccHypertext.rgs
new file mode 100644
index 000000000000..6baf54496e6a
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccHypertext.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccHypertext.1 = s 'AccHypertext Class'
+ {
+ CLSID = s '{CC55D71B-1828-4EE0-89E2-C3749CF9C9AB}'
+ }
+ UAccCOM.AccHypertext = s 'AccHypertext Class'
+ {
+ CLSID = s '{CC55D71B-1828-4EE0-89E2-C3749CF9C9AB}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {CC55D71B-1828-4EE0-89E2-C3749CF9C9AB} = s 'AccHypertext Class'
+ {
+ ProgID = s 'UAccCOM.AccHypertext.1'
+ VersionIndependentProgID = s 'UAccCOM.AccHypertext'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccImage.cxx b/winaccessibility/source/UAccCOM/AccImage.cxx
new file mode 100644
index 000000000000..7e3ba7699443
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccImage.cxx
@@ -0,0 +1,102 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccImage.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * Get description.
+ * @param description Variant to get description.
+ * @return Result.
+*/
+STDMETHODIMP CAccImage::get_description(BSTR * description)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if (description == NULL)
+ return E_INVALIDARG;
+ if( !pRXImg.is() )
+ return E_FAIL;
+
+ ::rtl::OUString ouStr = GetXInterface()->getAccessibleImageDescription();
+ SAFE_SYSFREESTRING(*description);
+ *description = SysAllocString((OLECHAR*)ouStr.getStr());
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CAccImage::get_imagePosition(
+ /* [in] */ enum IA2CoordinateType,
+ /* [out] */ long __RPC_FAR *,
+ /* [retval][out] */ long __RPC_FAR *)
+{
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP CAccImage::get_imageSize(
+ /* [out] */ long __RPC_FAR *,
+ /* [retval][out] */ long __RPC_FAR *)
+{
+ return E_NOTIMPL;
+}
+
+/**
+ * Put UNO interface.
+ * @param pXInterface UNO interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccImage::put_XInterface(long pXInterface)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleImage> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXImg = NULL;
+ else
+ pRXImg = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
diff --git a/winaccessibility/source/UAccCOM/AccImage.h b/winaccessibility/source/UAccCOM/AccImage.h
new file mode 100644
index 000000000000..41921f9480fe
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccImage.h
@@ -0,0 +1,101 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_)
+#define AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
+#include "UNOXWrapper.h"
+
+/**
+ * CAccImage implements IAccessibleImage interface.
+ */
+class ATL_NO_VTABLE CAccImage :
+ public CComObjectRoot,
+ public CComCoClass<CAccImage,&CLSID_AccImage>,
+ public IAccessibleImage,
+ public CUNOXWrapper
+{
+public:
+ CAccImage()
+ {
+ }
+ virtual ~CAccImage()
+ {
+ }
+ BEGIN_COM_MAP(CAccImage)
+ COM_INTERFACE_ENTRY(IAccessibleImage)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccImage*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccImage)
+
+ // IAccessibleImage
+public:
+ // IAccessibleImage
+
+ // Gets the description of the image.
+ STDMETHOD(get_description)(BSTR * description);
+
+ STDMETHOD(get_imagePosition)( enum IA2CoordinateType coordinateType,
+ long __RPC_FAR *x,
+ long __RPC_FAR *y);
+
+ STDMETHOD(get_imageSize)(
+ long __RPC_FAR *height,
+ long __RPC_FAR *width);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleImage> pRXImg;
+
+ inline com::sun::star::accessibility::XAccessibleImage* GetXInterface()
+ {
+ return pRXImg.get();
+ }
+};
+
+#endif // !defined(AFX_ACCIMAGE_H__D5E55275_CCD4_497F_8E77_F9B391D2F4A8__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccImage.rgs b/winaccessibility/source/UAccCOM/AccImage.rgs
new file mode 100644
index 000000000000..9be96fd3e777
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccImage.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccImage.1 = s 'AccImage Class'
+ {
+ CLSID = s '{73A45800-7A62-432C-A1A6-BF8852994331}'
+ }
+ UAccCOM.AccImage = s 'AccImage Class'
+ {
+ CLSID = s '{73A45800-7A62-432C-A1A6-BF8852994331}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {73A45800-7A62-432C-A1A6-BF8852994331} = s 'AccImage Class'
+ {
+ ProgID = s 'UAccCOM.AccImage.1'
+ VersionIndependentProgID = s 'UAccCOM.AccImage'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccKeyBinding.rgs b/winaccessibility/source/UAccCOM/AccKeyBinding.rgs
new file mode 100644
index 000000000000..6967bf2b6458
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccKeyBinding.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccKeyBinding.1 = s 'AccKeyBinding Class'
+ {
+ CLSID = s '{98AFE6FB-D748-4313-B4D6-E7B273B6255D}'
+ }
+ UAccCOM.AccKeyBinding = s 'AccKeyBinding Class'
+ {
+ CLSID = s '{98AFE6FB-D748-4313-B4D6-E7B273B6255D}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {98AFE6FB-D748-4313-B4D6-E7B273B6255D} = s 'AccKeyBinding Class'
+ {
+ ProgID = s 'UAccCOM.AccKeyBinding.1'
+ VersionIndependentProgID = s 'UAccCOM.AccKeyBinding'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccRelation.cxx b/winaccessibility/source/UAccCOM/AccRelation.cxx
new file mode 100644
index 000000000000..1eb261575be7
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccRelation.cxx
@@ -0,0 +1,214 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccRelation.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include "MAccessible.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * Get relation type.
+ * @param relationType Variant to get relation type.
+ * @return Result.
+*/
+STDMETHODIMP CAccRelation::get_relationType(BSTR * relationType)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (relationType == NULL)
+ return E_INVALIDARG;
+
+ int type = relation.RelationType;
+ SAFE_SYSFREESTRING(*relationType);
+
+ *relationType = getRelationTypeBSTR(type);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+// Gets what the type of localized relation is.
+STDMETHODIMP CAccRelation::get_localizedRelationType(BSTR *)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get targets length.
+ * @param nTargets Variant to get targets length.
+ * @return Result.
+*/
+STDMETHODIMP CAccRelation::get_nTargets(long * nTargets)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CHECK_ENABLE_INF
+ if (nTargets == NULL)
+ return E_INVALIDARG;
+
+ Sequence< Reference< XInterface > > xTargets = relation.TargetSet;
+ *nTargets = xTargets.getLength();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special target.
+ * @param targetIndex target index.
+ * @param target Variant to get special target.
+ * @return Result.
+*/
+STDMETHODIMP CAccRelation::get_target(long targetIndex, IUnknown * * target)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (target == NULL)
+ return E_FAIL;
+
+ Sequence< Reference< XInterface > > xTargets = relation.TargetSet;
+ int nCount = xTargets.getLength();
+ if( targetIndex >= nCount )
+ return E_FAIL;
+
+ Reference<XInterface> pRAcc = xTargets[targetIndex];
+ IAccessible* pRet = NULL;
+
+ BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+ if(isGet)
+ {
+ *target = /*(IAccessible2 *)*/(IUnknown*)pRet;
+ pRet->AddRef();
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special targets.
+ * @param maxTargets Special targets count.
+ * @param target Variant to get special target.
+ * @param nTargets Variant to accept actual target length.
+ * @return Result.
+*/
+STDMETHODIMP CAccRelation::get_targets(long, IUnknown * * target, long * nTargets)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(target == NULL)
+ return E_INVALIDARG;
+ if (nTargets == NULL)
+ return E_INVALIDARG;
+
+ Sequence< Reference< XInterface > > xTargets = relation.TargetSet;
+ int nCount = xTargets.getLength();
+
+ *target = (IUnknown*)::CoTaskMemAlloc(nCount*sizeof(IUnknown));
+
+ // #CHECK Memory Allocation#
+ if(*target == NULL)
+ {
+ return E_FAIL;
+ }
+
+ for(int i=0; i<nCount ; i++)
+ {
+ IUnknown* pAcc = NULL;
+ HRESULT hr = get_target(i,&pAcc);
+ if(SUCCEEDED(hr))
+ target[i] = pAcc;
+ }
+
+ *nTargets = nCount;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put UNO interface.
+ * @param pXSubInterface AccessibleRelation pointer.
+ * @return Result.
+*/
+STDMETHODIMP CAccRelation::put_XSubInterface(long pXSubInterface)
+{
+
+ relation = *((AccessibleRelation*)pXSubInterface);
+ return S_OK;
+}
+
+/**
+ * Get relation type string by type.
+ * @param type Relation type.
+ * @return relation type string.
+*/
+BSTR CAccRelation::getRelationTypeBSTR(int type)
+{
+ static struct TYPE_BSTR_MAP
+ {
+ LPCTSTR string;
+ int type;
+ }
+ map[] =
+ {
+ {_T("INVALID") , 0},
+ {IA2_RELATION_FLOWS_FROM , 1},
+ {IA2_RELATION_FLOWS_TO , 2},
+ {IA2_RELATION_CONTROLLED_BY , 3},
+ {IA2_RELATION_CONTROLLER_FOR, 4},
+ {IA2_RELATION_LABEL_FOR , 5},
+ {IA2_RELATION_LABELED_BY , 6},
+ {IA2_RELATION_MEMBER_OF , 7},
+ {IA2_RELATION_SUBWINDOW_OF , 8},
+ {IA2_RELATION_NODE_CHILD_OF, 9},
+ {IA2_RELATION_DESCRIBED_BY , 10},
+ };
+
+ USES_CONVERSION;
+
+ return (type >= 0 && type <= 10) ? T2BSTR(map[type].string) : _T("");
+}
diff --git a/winaccessibility/source/UAccCOM/AccRelation.h b/winaccessibility/source/UAccCOM/AccRelation.h
new file mode 100644
index 000000000000..a7903f7dc571
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccRelation.h
@@ -0,0 +1,88 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ACCRELATION_H_
+#define __ACCRELATION_H_
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include "UNOXWrapper.h"
+
+/**
+ * CAccRelation implements IAccessibleRelation interface.
+ */
+class ATL_NO_VTABLE CAccRelation :
+ public CComObjectRoot,
+ public CComCoClass<CAccRelation, &CLSID_AccRelation>,
+ public IAccessibleRelation,
+ public CUNOXWrapper
+{
+public:
+ CAccRelation()
+ {
+ }
+ virtual ~CAccRelation()
+ {
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_ACCRELATION)
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CAccRelation)
+ COM_INTERFACE_ENTRY(IAccessibleRelation)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ END_COM_MAP()
+
+ // IAccessibleRelation
+public:
+ // IAccessibleRelation
+
+ // Gets what the type of relation is.
+ STDMETHOD(get_relationType)(BSTR * relationType);
+
+ // Gets what the type of localized relation is.
+ STDMETHOD(get_localizedRelationType)(BSTR * relationType);
+
+ // Gets how many targets this relation have.
+ STDMETHOD(get_nTargets)(long * nTargets);
+
+ // Gets one accessible relation target.
+ STDMETHOD(get_target)(long targetIndex, IUnknown * * target);
+
+ // Gets multiple accessible relation targets.
+ STDMETHOD(get_targets)(long maxTargets, IUnknown * * target, long * nTargets);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XSubInterface)(long pXSubInterface);
+
+ //static OLECHAR* getRelationTypeOLECHAR(int type);
+ static BSTR getRelationTypeBSTR(int type);
+
+private:
+
+ com::sun::star::accessibility::AccessibleRelation relation;
+};
+
+#endif //__ACCRELATION_H_
diff --git a/winaccessibility/source/UAccCOM/AccRelation.rgs b/winaccessibility/source/UAccCOM/AccRelation.rgs
new file mode 100644
index 000000000000..3a7d3d2c6ed1
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccRelation.rgs
@@ -0,0 +1,25 @@
+HKCR
+{
+ UAccCOM.AccRelation.1 = s 'AccRelation Class'
+ {
+ CLSID = s '{8745CF0C-3104-4BAE-B7D0-D7B1717C006E}'
+ }
+ UAccCOM.AccRelation = s 'AccRelation Class'
+ {
+ CLSID = s '{8745CF0C-3104-4BAE-B7D0-D7B1717C006E}'
+ CurVer = s 'UAccCOM.AccRelation.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {8745CF0C-3104-4BAE-B7D0-D7B1717C006E} = s 'AccRelation Class'
+ {
+ ProgID = s 'UAccCOM.AccRelation.1'
+ VersionIndependentProgID = s 'UAccCOM.AccRelation'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{19ECB1B0-9376-4FF9-B580-223FC9C200B8}'
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccSelection.rgs b/winaccessibility/source/UAccCOM/AccSelection.rgs
new file mode 100644
index 000000000000..484099086c5d
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccSelection.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccSelection.1 = s 'AccSelection Class'
+ {
+ CLSID = s '{9B83B8C3-3592-4C29-8682-559E37368E95}'
+ }
+ UAccCOM.AccSelection = s 'AccSelection Class'
+ {
+ CLSID = s '{9B83B8C3-3592-4C29-8682-559E37368E95}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {9B83B8C3-3592-4C29-8682-559E37368E95} = s 'AccSelection Class'
+ {
+ ProgID = s 'UAccCOM.AccSelection.1'
+ VersionIndependentProgID = s 'UAccCOM.AccSelection'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccTable.cxx b/winaccessibility/source/UAccCOM/AccTable.cxx
new file mode 100644
index 000000000000..4ad5e22c782e
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccTable.cxx
@@ -0,0 +1,1069 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+/**
+ * AccTable.cpp : Implementation of CAccTable.
+ */
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccTable.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include "MAccessible.h"
+
+#include "act.hxx"
+
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLETABLEEXTENT_HPP_
+#include <com/sun/star/accessibility/XAccessibleTableSelection.hpp>
+#endif
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+/**
+ * Gets accessible table cell.
+ *
+ * @param row the row of the specified cell.
+ * @param column the column of the specified cell.
+ * @param accessible the accessible object of the cell.
+ */
+
+STDMETHODIMP CAccTable::get_accessibleAt(long row, long column, IUnknown * * accessible)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(accessible == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessible> pRAcc = GetXInterface()->getAccessibleCellAt(row,column);
+
+ if(!pRAcc.is())
+ {
+ *accessible = NULL;
+ return E_FAIL;
+ }
+
+ IAccessible* pRet = NULL;
+
+ BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+ if(isTRUE)
+ {
+ *accessible = (IAccessible2 *)pRet;
+ pRet->AddRef();
+ return S_OK;
+ }
+ else if(pRAcc.is())
+ {
+ Reference<XAccessible> pxTable(GetXInterface(),UNO_QUERY);
+
+ CMAccessible::g_pAgent->InsertAccObj(pRAcc.get(),pxTable.get());
+ isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+
+ if(isTRUE)
+ {
+ *accessible = (IAccessible2 *)pRet;
+ pRet->AddRef();
+ return S_OK;
+ }
+ }
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible table caption.
+ *
+ * @param accessible the accessible object of table cpation.
+ */
+STDMETHODIMP CAccTable::get_caption(IUnknown * *)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible column description (as string).
+ *
+ * @param column the column index.
+ * @param description the description of the specified column.
+ */
+STDMETHODIMP CAccTable::get_columnDescription(long column, BSTR * description)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(description == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ const ::rtl::OUString& ouStr = GetXInterface()->getAccessibleColumnDescription(column);
+ // #CHECK#
+
+ SAFE_SYSFREESTRING(*description);//??
+ *description = SysAllocString((OLECHAR*)ouStr.getStr());
+ if(description==NULL)
+ return E_FAIL;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets number of columns spanned by table cell.
+ *
+ * @param row the row of the specified cell.
+ * @param column the column of the specified cell.
+ * @param spanColumns the column span of the specified cell.
+ */
+STDMETHODIMP CAccTable::get_columnExtentAt(long row, long column, long * nColumnsSpanned)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ XAccessibleTable *pXAccTable = GetXInterface();
+
+ // Check pointer.
+ if(nColumnsSpanned == NULL)
+ return E_INVALIDARG;
+
+ // Get Extent.
+ if(pXAccTable)
+ {
+ long lExt = pXAccTable->getAccessibleColumnExtentAt(row,column);
+
+ // Fill Extent struct.
+ *nColumnsSpanned = lExt;
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible column header.
+ *
+ * @param column the column index.
+ * @param accessible the accessible object of the specified column.
+ */
+STDMETHODIMP CAccTable::get_columnHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(accessibleTable == NULL || startingRowIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTable> pRColumnHeaderTable = GetXInterface()->getAccessibleColumnHeaders();
+ if(!pRColumnHeaderTable.is())
+ {
+ *accessibleTable = NULL;
+ return E_FAIL;
+ }
+
+ Reference<XAccessible> pRXColumnHeader(pRColumnHeaderTable,UNO_QUERY);
+
+ if(!pRXColumnHeader.is())
+ {
+ *accessibleTable = NULL;
+ return E_FAIL;
+ }
+ *startingRowIndex = 0 ;
+
+ IAccessible* m_pIMacc = NULL;
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance( CLSID_MAccessible, NULL, CLSCTX_ALL ,
+ IID_IMAccessible,
+ (void **)&m_pIMacc
+ );
+ DeactivateActContext();
+ ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXColumnHeader.get());
+ m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable);
+ if( SUCCEEDED(hr) )
+ {
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets total number of columns in table.
+ *
+ * @param columnCount the number of columns in table.
+ */
+STDMETHODIMP CAccTable::get_nColumns(long * columnCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(columnCount == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *columnCount = GetXInterface()->getAccessibleColumnCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets total number of rows in table.
+ *
+ * @param rowCount the number of rows in table.
+ */
+STDMETHODIMP CAccTable::get_nRows(long * rowCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(rowCount == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *rowCount = GetXInterface()->getAccessibleRowCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets total number of selected columns.
+ *
+ * @param columnCount the number of selected columns.
+ */
+STDMETHODIMP CAccTable::get_nSelectedColumns(long * columnCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(columnCount == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Sequence<long> pSelected = GetXInterface()->getSelectedAccessibleColumns();
+ *columnCount = pSelected.getLength();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets total number of selected rows.
+ *
+ * @param rowCount the number of selected rows.
+ */
+STDMETHODIMP CAccTable::get_nSelectedRows(long * rowCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(rowCount == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Sequence<long> pSelected = GetXInterface()->getSelectedAccessibleRows();
+ *rowCount = pSelected.getLength();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible row description (as string).
+ *
+ * @param row the row index.
+ * @param description the description of the specified row.
+ */
+STDMETHODIMP CAccTable::get_rowDescription(long row, BSTR * description)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(description == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ const ::rtl::OUString& ouStr = GetXInterface()->getAccessibleRowDescription(row);
+ // #CHECK#
+
+ SAFE_SYSFREESTRING(*description);
+ *description = SysAllocString((OLECHAR*)ouStr.getStr());
+ if(description==NULL)
+ return E_FAIL;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets number of rows spanned by a table cell.
+ *
+ * @param row the row of the specified cell.
+ * @param column the column of the specified cell.
+ * @param spanRows the row span of the specified cell.
+ */
+STDMETHODIMP CAccTable::get_rowExtentAt(long row, long column, long * nRowsSpanned)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ XAccessibleTable *pXAccTable = GetXInterface();
+
+ // Check pointer.
+ if(nRowsSpanned == NULL)
+ return E_INVALIDARG;
+
+ // Get Extent.
+ if(pXAccTable)
+ {
+ long lExt = GetXInterface()->getAccessibleRowExtentAt(row,column);
+
+ // Fill Extent struct.
+ *nRowsSpanned= lExt;
+
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible row header.
+ *
+ * @param row the row index.
+ * @param accessible the accessible object of the row header.
+ */
+STDMETHODIMP CAccTable::get_rowHeader(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(accessibleTable == NULL || startingColumnIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTable> pRRowHeaderTable = GetXInterface()->getAccessibleRowHeaders();
+ if(!pRRowHeaderTable.is())
+ {
+ *accessibleTable = NULL;
+ return E_FAIL;
+ }
+
+ Reference<XAccessible> pRXRowHeader(pRRowHeaderTable,UNO_QUERY);
+
+ if(!pRXRowHeader.is())
+ {
+ *accessibleTable = NULL;
+ return E_FAIL;
+ }
+ *startingColumnIndex = 0 ;
+
+ IAccessible* m_pIMacc = NULL;
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance( CLSID_MAccessible, NULL, CLSCTX_ALL ,
+ IID_IMAccessible,
+ (void **)&m_pIMacc
+ );
+ DeactivateActContext();
+ ((CMAccessible*)m_pIMacc)->SetXAccessible((long)pRXRowHeader.get());
+ m_pIMacc->QueryInterface(IID_IAccessibleTable,(void **)accessibleTable);
+ if( SUCCEEDED(hr) )
+ {
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets list of row indexes currently selected (0-based).
+ *
+ * @param maxRows the max number of the rows.
+ * @param accessible the accessible object array of the selected rows.
+ * @param nRows the actual size of the accessible object array.
+ */
+STDMETHODIMP CAccTable::get_selectedRows(long, long ** rows, long * nRows)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(rows == NULL || nRows == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Sequence<long> pSelected = GetXInterface()->getSelectedAccessibleRows();
+ long count = pSelected.getLength() ;
+ *nRows = count;
+
+ *rows = reinterpret_cast<long*>(CoTaskMemAlloc((count) * sizeof(long)));
+ // #CHECK Memory Allocation#
+ if(*rows == NULL)
+ {
+ return E_FAIL;
+ }
+ for(int i=0; i<count; i++)
+ (*rows)[i] = pSelected[i];
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets list of column indexes currently selected (0-based).
+ *
+ * @param maxColumns the max number of the columns.
+ * @param accessible the accessible object array of the selected columns.
+ * @param numColumns the actual size of accessible object array.
+ */
+STDMETHODIMP CAccTable::get_selectedColumns(long, long ** columns, long * numColumns)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(columns == NULL || numColumns == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Sequence<long> pSelected = GetXInterface()->getSelectedAccessibleColumns();
+ long count = pSelected.getLength() ;
+ *numColumns = count;
+
+ *columns = reinterpret_cast<long*>(CoTaskMemAlloc((count) * sizeof(long)));
+ // #CHECK Memory Allocation#
+ if(*columns == NULL)
+ {
+ return E_FAIL;
+ }
+ for(int i=0; i<count; i++)
+ (*columns)[i] = pSelected[i];
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets accessible table summary.
+ *
+ * @param accessible the accessible object of the summary.
+ */
+STDMETHODIMP CAccTable::get_summary(IUnknown * * accessible)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(accessible == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessible> pRAcc = GetXInterface()->getAccessibleSummary();
+
+ IAccessible* pRet = NULL;
+ BOOL isTRUE = CMAccessible::get_IAccessibleFromXAccessible((long)pRAcc.get(),&pRet);
+
+ if(pRet)
+ {
+ *accessible = (IAccessible2 *)pRet;
+ pRet->AddRef();
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Determines if table column is selected.
+ *
+ * @param column the column index.
+ * @param isSelected the result.
+ */
+STDMETHODIMP CAccTable::get_isColumnSelected(long column, unsigned char * isSelected)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(isSelected == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *isSelected = GetXInterface()->isAccessibleColumnSelected(column);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Determines if table row is selected.
+ *
+ * @param row the row index.
+ * @param isSelected the result.
+ */
+STDMETHODIMP CAccTable::get_isRowSelected(long row, unsigned char * isSelected)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(isSelected == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ {
+ return E_FAIL;
+ }
+ *isSelected = GetXInterface()->isAccessibleRowSelected(row);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Determines if table cell is selected.
+ *
+ * @param row the row index.
+ * @param column the column index.
+ * @param isSelected the result.
+ */
+STDMETHODIMP CAccTable::get_isSelected(long row, long column, unsigned char * isSelected)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(isSelected == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *isSelected = GetXInterface()->isAccessibleSelected(row,column);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Selects a row and unselect all previously selected rows.
+ *
+ * @param row the row index.
+ * @param success the result.
+ */
+STDMETHODIMP CAccTable::selectRow(long row)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // Check XAccessibleTable reference.
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTableSelection> pRTableExtent(pRXTable, UNO_QUERY);
+ if(pRTableExtent.is())
+ {
+ pRTableExtent.get()->selectRow(row);
+ return S_OK;
+ }
+ else
+ {
+ // Get XAccessibleSelection.
+ Reference<XAccessibleSelection> pRSelection(GetXInterface(), UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ // Select row.
+ long lCol, lColumnCount, lChildIndex;
+ lColumnCount = GetXInterface()->getAccessibleColumnCount();
+ for(lCol = 0; lCol < lColumnCount; lCol ++)
+ {
+ lChildIndex = GetXInterface()->getAccessibleIndex(row, lCol);
+ pRSelection.get()->selectAccessibleChild(lChildIndex);
+ }
+
+ return S_OK;
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Selects a column and unselect all previously selected columns.
+ *
+ * @param column the column index.
+ * @param success the result.
+ */
+STDMETHODIMP CAccTable::selectColumn(long column)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // Check XAccessibleTable reference.
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTableSelection> pRTableExtent(GetXInterface(), UNO_QUERY);
+ if(pRTableExtent.is())
+ {
+ pRTableExtent.get()->selectColumn(column);
+ return S_OK;
+ }
+ else
+ {
+ // Get XAccessibleSelection.
+ Reference<XAccessibleSelection> pRSelection(pRXTable, UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ // Select column.
+ long lRow, lRowCount, lChildIndex;
+ lRowCount = GetXInterface()->getAccessibleRowCount();
+ for(lRow = 0; lRow < lRowCount; lRow ++)
+ {
+ lChildIndex = GetXInterface()->getAccessibleIndex(lRow, column);
+ pRSelection.get()->selectAccessibleChild(lChildIndex);
+ }
+
+ return S_OK;
+ }
+ return S_OK;
+ // End of added.
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Unselects one row, leaving other selected rows selected (if any).
+ *
+ * @param row the row index.
+ * @param success the result.
+ */
+STDMETHODIMP CAccTable::unselectRow(long row)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // Check XAccessibleTable reference.
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTableSelection> pRTableExtent(GetXInterface(), UNO_QUERY);
+ if(pRTableExtent.is())
+ {
+ if(pRTableExtent.get()->unselectRow(row))
+ return S_OK;
+ else
+ return E_FAIL;
+ }
+ else
+ {
+ // Get XAccessibleSelection.
+ Reference<XAccessibleSelection> pRSelection(pRXTable, UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ // Select column.
+ long lColumn, lColumnCount, lChildIndex;
+ lColumnCount = GetXInterface()->getAccessibleColumnCount();
+ for(lColumn = 0; lColumn < lColumnCount; lColumn ++)
+ {
+ lChildIndex = GetXInterface()->getAccessibleIndex(row,lColumn);
+ pRSelection.get()->deselectAccessibleChild(lChildIndex);
+ }
+
+ return S_OK;
+ }
+ return S_OK;
+ // End of added.
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Unselects one column, leaving other selected columns selected (if any).
+ *
+ * @param column the column index.
+ * @param success the result.
+ */
+STDMETHODIMP CAccTable::unselectColumn(long column)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // Check XAccessibleTable reference.
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleTableSelection> pRTableExtent(GetXInterface(), UNO_QUERY);
+ if(pRTableExtent.is())
+ {
+ if(pRTableExtent.get()->unselectColumn(column))
+ return S_OK;
+ else
+ return E_FAIL;
+ }
+ else
+ {
+ // Get XAccessibleSelection.
+ Reference<XAccessibleSelection> pRSelection(pRXTable, UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ // Unselect columns.
+ long lRow, lRowCount, lChildIndex;
+ lRowCount = GetXInterface()->getAccessibleRowCount();
+
+ for(lRow = 0; lRow < lRowCount; lRow ++)
+ {
+ lChildIndex = GetXInterface()->getAccessibleIndex(lRow, column);
+ pRSelection.get()->deselectAccessibleChild(lChildIndex);
+ }
+ return S_OK;
+ }
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Overide of IUNOXWrapper.
+ *
+ * @param pXInterface the pointer of UNO interface.
+ */
+STDMETHODIMP CAccTable::put_XInterface(long pXInterface)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_INVALIDARG;
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ Reference<XAccessibleTable> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXTable = NULL;
+ else
+ pRXTable = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Gets columnIndex of childIndex.
+ *
+ * @param childIndex childIndex
+ */
+STDMETHODIMP CAccTable::get_columnIndex(long childIndex, long * columnIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(columnIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *columnIndex = GetXInterface()->getAccessibleColumn(childIndex);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+/**
+ * Gets rowIndex of childIndex.
+ *
+ * @param childIndex childIndex
+ */
+STDMETHODIMP CAccTable::get_rowIndex(long childIndex, long * rowIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(rowIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *rowIndex = GetXInterface()->getAccessibleRow(childIndex);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+/**
+ * Gets childIndex of childIndex.
+ *
+ * @param childIndex childIndex
+ */
+STDMETHODIMP CAccTable::get_childIndex(long RowIndex , long columnIndex, long * childIndex )
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(childIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ *childIndex = GetXInterface()->getAccessibleIndex(RowIndex, columnIndex);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CAccTable::get_rowColumnExtentsAtIndex(long,
+ long *,
+ long *,
+ long *,
+ long *,
+ boolean *)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CAccTable::get_modelChange(IA2TableModelChange *)
+{
+
+ return E_NOTIMPL;
+}
+
+// @brief Returns the total number of selected children
+// @param [out] childCount
+// Number of children currently selected
+STDMETHODIMP CAccTable::get_nSelectedChildren(long *childCount)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(childCount == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleSelection> pRSelection(GetXInterface(), UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ *childCount = pRSelection->getSelectedAccessibleChildCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+// @brief Returns a list of child indexes currently selected (0-based).
+// @param [in] maxChildren
+// Max children requested (possibly from IAccessibleTable::nSelectedChildren)
+// @param [out] children
+// array of indexes of selected children (each index is 0-based)
+// @param [out] nChildren
+// Length of array (not more than maxChildren)
+STDMETHODIMP CAccTable::get_selectedChildren(long, long **children, long *nChildren)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(children == NULL || nChildren == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if(!pRXTable.is())
+ return E_FAIL;
+
+ Reference<XAccessibleSelection> pRSelection(GetXInterface(), UNO_QUERY);
+ if(!pRSelection.is())
+ return E_FAIL;
+
+ long childCount = pRSelection->getSelectedAccessibleChildCount() ;
+
+ *nChildren = childCount;
+
+ *children = reinterpret_cast<long*>(CoTaskMemAlloc((childCount) * sizeof(long)));
+
+ for( long i = 0; i< childCount; i++)
+ {
+ Reference<XAccessible> pRAcc = pRSelection->getSelectedAccessibleChild(i);
+ if(pRAcc.is())
+ {
+ Reference<XAccessibleContext> pRContext(pRAcc, UNO_QUERY);
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ long childIndex = pRContext->getAccessibleIndexInParent();
+ (*children)[i] = childIndex;
+ }
+ }
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+
+}
diff --git a/winaccessibility/source/UAccCOM/AccTable.h b/winaccessibility/source/UAccCOM/AccTable.h
new file mode 100644
index 000000000000..245c54720550
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccTable.h
@@ -0,0 +1,175 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ACCTABLE_H_
+#define __ACCTABLE_H_
+
+#include "resource.h" // main symbols
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+#include "UNOXWrapper.h"
+
+/**
+ * CAccTable implements IAccessibleTable interface.
+ */
+class ATL_NO_VTABLE CAccTable :
+ public CComObjectRoot,
+ public CComCoClass<CAccTable, &CLSID_AccTable>,
+ public IAccessibleTable,
+ public CUNOXWrapper
+
+{
+public:
+ CAccTable()
+ {
+ }
+ virtual ~CAccTable()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccTable)
+ COM_INTERFACE_ENTRY(IAccessibleTable)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccTable*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_ACCTABLE)
+
+ // IAccessibleTable
+public:
+ // IAccessibleTable
+
+ // Gets accessible table cell.
+ STDMETHOD(get_accessibleAt)(long row, long column, IUnknown * * accessible);
+
+ // Gets accessible table caption.
+ STDMETHOD(get_caption)(IUnknown * * accessible);
+
+ // Gets accessible column description (as string).
+ STDMETHOD(get_columnDescription)(long column, BSTR * description);
+
+ // Gets number of columns spanned by table cell.
+ STDMETHOD(get_columnExtentAt)(long row, long column, long * nColumnsSpanned);
+
+ // Gets accessible column header.
+ STDMETHOD(get_columnHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex);
+
+ // Gets total number of columns in table.
+ STDMETHOD(get_nColumns)(long * columnCount);
+
+ // Gets total number of rows in table.
+ STDMETHOD(get_nRows)(long * rowCount);
+
+ // Gets total number of selected columns.
+ STDMETHOD(get_nSelectedColumns)(long * columnCount);
+
+ // Gets total number of selected rows.
+ STDMETHOD(get_nSelectedRows)(long * rowCount);
+
+ // Gets accessible row description (as string).
+ STDMETHOD(get_rowDescription)(long row, BSTR * description);
+
+ // Gets number of rows spanned by a table cell.
+ STDMETHOD(get_rowExtentAt)(long row, long column, long * nRowsSpanned);
+
+ // Gets accessible row header.
+ STDMETHOD(get_rowHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex);
+
+ // Gets list of row indexes currently selected (0-based).
+ STDMETHOD(get_selectedRows)(long maxRows, long **rows, long * nRows);
+
+ // Gets list of column indexes currently selected (0-based).
+ STDMETHOD(get_selectedColumns)(long maxColumns, long **columns, long * numColumns);
+
+ // Gets accessible table summary.
+ STDMETHOD(get_summary)(IUnknown * * accessible);
+
+ // Determines if table column is selected.
+ STDMETHOD(get_isColumnSelected)(long column, unsigned char * isSelected);
+
+ // Determines if table row is selected.
+ STDMETHOD(get_isRowSelected)(long row, unsigned char * isSelected);
+
+ // Determines if table cell is selected.
+ STDMETHOD(get_isSelected)(long row, long column, unsigned char * isSelected);
+
+ // Selects a row and unselect all previously selected rows.
+ STDMETHOD(selectRow)(long row );
+
+
+ // Selects a column and unselect all previously selected columns.
+
+ STDMETHOD(selectColumn)(long column);
+
+ // Unselects one row, leaving other selected rows selected (if any).
+ STDMETHOD(unselectRow)(long row);
+
+ // Unselects one column, leaving other selected columns selected (if any).
+ STDMETHOD(unselectColumn)(long column);
+
+ //get Column index
+ STDMETHOD(get_columnIndex)(long childIndex, long * columnIndex);
+
+ STDMETHOD(get_rowIndex)(long childIndex, long * rowIndex);
+
+ STDMETHOD(get_childIndex)(long rowIndex,long columnIndex, long * childIndex);
+
+ STDMETHOD(get_nSelectedChildren)(long *childCount);
+
+ STDMETHOD(get_selectedChildren)(long maxChildren, long **children, long *nChildren);
+
+ STDMETHOD(get_rowColumnExtentsAtIndex)( long index,
+ long *row,
+ long *column,
+ long *rowExtents,
+ long *columnExtents,
+ boolean *isSelected) ;
+
+ STDMETHOD(get_modelChange)(IA2TableModelChange *modelChange);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleTable> pRXTable;
+
+ inline com::sun::star::accessibility::XAccessibleTable* GetXInterface()
+ {
+ return pRXTable.get();
+ }
+};
+
+#endif //__ACCTABLE_H_
diff --git a/winaccessibility/source/UAccCOM/AccTable.rgs b/winaccessibility/source/UAccCOM/AccTable.rgs
new file mode 100644
index 000000000000..7117fe698934
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccTable.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccTable.1 = s 'AccTable Class'
+ {
+ CLSID = s '{92BAA62D-535A-4EAB-9ABB-BFA60B7A6DB6}'
+ }
+ UAccCOM.AccTable = s 'AccTable Class'
+ {
+ CLSID = s '{92BAA62D-535A-4EAB-9ABB-BFA60B7A6DB6}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {92BAA62D-535A-4EAB-9ABB-BFA60B7A6DB6} = s 'AccTable Class'
+ {
+ ProgID = s 'UAccCOM.AccTable.1'
+ VersionIndependentProgID = s 'UAccCOM.AccTable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccText.cxx b/winaccessibility/source/UAccCOM/AccText.cxx
new file mode 100644
index 000000000000..ab0702993615
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccText.cxx
@@ -0,0 +1,282 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccText.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * Get special selection.
+ * @param startOffset Start selection offset.
+ * @param endOffset End selection offset.
+ * @param success Variant to accept the result of if the method call is successful.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::addSelection(long startOffset, long endOffset)//, unsigned char * success)
+{
+
+ return CAccTextBase::get_addSelection(startOffset, endOffset);//, success);
+}
+
+/**
+ * Get special attributes.
+ * @param offset Offset.
+ * @param startOffset Variant to accept start offset.
+ * @param endOffset Variant to accept end offset.
+ * @param textAttributes Variant to accept attributes.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes)
+{
+
+ return CAccTextBase::get_attributes(offset, startOffset, endOffset, textAttributes);
+}
+
+/**
+ * Get caret position.
+ * @param offset Variant to accept caret offset.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_caretOffset(long * offset)
+{
+
+ return CAccTextBase::get_caretOffset(offset);
+}
+
+/**
+ * Get character count.
+ * @param nCharacters Variant to accept character count.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_characterCount(long * nCharacters)
+{
+
+ return CAccTextBase::get_characterCount(nCharacters);
+}
+
+/**
+ * Get character extents.
+ * @param offset Offset.
+ * @param x Variant to accpet x position.
+ * @param y Variant to accpet y position.
+ * @param width Variant to accpet width.
+ * @param Height Variant to accpet height.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height)
+{
+
+ return CAccTextBase::get_characterExtents(offset, coordType, x, y, width, height);
+}
+
+/**
+ * Get slections count.
+ * @param nSelections Variant to accpet slections count.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_nSelections(long * nSelections)
+{
+
+ return CAccTextBase::get_nSelections(nSelections);
+}
+
+/**
+ * Get offset of some special point.
+ * @param x X position of one point.
+ * @param x Y position of one point.
+ * @param coordType Type.
+ * @param offset Variant to accept offset.
+ * @return Result.
+*/
+
+STDMETHODIMP CAccText::get_offsetAtPoint(long x, long y, IA2CoordinateType coordType, long * offset)
+{
+
+ return CAccTextBase::get_offsetAtPoint(x, y, coordType, offset);
+}
+
+/**
+ * Get selection range.
+ * @param selection selection count.
+ * @param startOffset Variant to accept the start offset of special selection.
+ * @param endOffset Variant to accept the end offset of special selection.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_selection(long selection, long * startOffset, long * endOffset)
+{
+
+ return CAccTextBase::get_selection(selection, startOffset, endOffset);
+}
+
+/**
+ * Get special text.
+ * @param startOffset Start position of special range.
+ * @param endOffset End position of special range.
+ * @param text Variant to accept the text of special range.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_text(long startOffset, long endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_text(startOffset, endOffset, text);
+}
+
+/**
+ * Get special text before some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textBeforeOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Get special text after some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textAfterOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Get special text at some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ return CAccTextBase::get_textAtOffset(offset, boundaryType,
+ startOffset, endOffset, text);
+}
+
+/**
+ * Remove selection.
+ * @param selectionIndex Special selection index
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::removeSelection(long selectionIndex)//, unsigned char * success)
+{
+
+ return CAccTextBase::removeSelection(selectionIndex);//, success);
+}
+
+/**
+ * Set caret position.
+ * @param offset Special position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::setCaretOffset(long offset)
+{
+
+ return CAccTextBase::setCaretOffset(offset);
+}
+
+/**
+ * Set special selection.
+ * @param selectionIndex Special selection index.
+ * @param startOffset start position.
+ * @param endOffset end position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+
+STDMETHODIMP CAccText::setSelection(long selectionIndex, long startOffset, long endOffset)
+{
+
+ return CAccTextBase::setSelection(selectionIndex, startOffset,
+ endOffset);
+}
+
+/**
+ * Get characters count.
+ * @param nCharacters Variant to accept the characters count.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::get_nCharacters(long * nCharacters)
+{
+
+ return CAccTextBase::get_nCharacters(nCharacters);
+}
+
+STDMETHODIMP CAccText::get_newText( IA2TextSegment *newText)
+{
+ return CAccTextBase::get_newText(newText);
+}
+
+STDMETHODIMP CAccText::get_oldText( IA2TextSegment *oldText)
+{
+ return CAccTextBase::get_oldText(oldText);
+}
+
+/**
+ * Scroll to special sub-string .
+ * @param startIndex Start index of sub string.
+ * @param endIndex End index of sub string.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::scrollSubstringToPoint(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y )
+{
+
+ return CAccTextBase::scrollSubstringToPoint(startIndex, endIndex, coordinateType, x, y);
+}
+
+STDMETHODIMP CAccText::scrollSubstringTo(long startIndex, long endIndex,enum IA2ScrollType scrollType)
+{
+
+ return CAccTextBase::scrollSubstringTo(startIndex, endIndex,scrollType);
+}
+
+/**
+ * Put UNO interface.
+ * @param pXInterface UNO interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccText::put_XInterface(long pXInterface)
+{
+
+ return CAccTextBase::put_XInterface(pXInterface);
+}
+
diff --git a/winaccessibility/source/UAccCOM/AccText.h b/winaccessibility/source/UAccCOM/AccText.h
new file mode 100644
index 000000000000..7eb1c33f5086
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccText.h
@@ -0,0 +1,140 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCTEXT_H__F06C5496_9959_4C7C_873E_A8D50CFB290D__INCLUDED_)
+#define AFX_ACCTEXT_H__F06C5496_9959_4C7C_873E_A8D50CFB290D__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+#include "AccTextBase.h"
+
+/**
+ * CAccText implements IAccessibleText interface.
+ */
+class ATL_NO_VTABLE CAccText :
+ public CComObjectRoot,
+ public CComCoClass<CAccText,&CLSID_AccText>,
+ public IAccessibleText,
+ public CAccTextBase
+{
+public:
+ CAccText()
+ {
+ }
+ ~CAccText()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccText)
+ COM_INTERFACE_ENTRY(IAccessibleText)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccText*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccText)
+
+ // IAccessibleText
+public:
+ // IAccessibleText
+
+ // Adds a text selection.
+ STDMETHOD(addSelection)(long startOffset, long endOffset);//, unsigned char * success);
+
+ // Gets text attributes.
+ STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes);
+
+ // Gets caret offset.
+ STDMETHOD(get_caretOffset)(long * offset);
+
+ // Gets total number of characters.
+ STDMETHOD(get_characterCount)(long * nCharacters);
+
+ // Gets bounding rect containing the glyph(s) representing the character
+ // at the specified text offset
+ STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height);
+
+ // Gets number of active non-contiguous selections.
+ STDMETHOD(get_nSelections)(long * nSelections);
+
+ // Gets bounding rect for the glyph at a certain point.
+ STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset);
+
+ // Gets character offsets of N-th active text selection.
+ STDMETHOD(get_selection)(long selection, long * startOffset, long * endOffset);
+
+ // Gets a range of text by offset NOTE: returned string may be longer
+ // than endOffset-startOffset bytes if text contains multi-byte characters.
+ STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text);
+
+ // Gets a specified amount of text that ends before a specified offset.
+ STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that spans the specified offset.
+ STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that starts after a specified offset.
+ STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Unselects a range of text.
+ STDMETHOD(removeSelection)(long selectionIndex);//, unsigned char * success);
+
+ // Moves text caret.
+ STDMETHOD(setCaretOffset)(long offset);//, unsigned char * success);
+
+ // Changes the bounds of an existing selection.
+ STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset);//, unsigned char * success);
+
+ // Gets total number of characters.
+ // NOTE: this may be different than the total number of bytes required
+ // to store the text, if the text contains multi-byte characters.
+ STDMETHOD(get_nCharacters)(long * nCharacters);
+
+ // Makes specific part of string visible on screen.
+ STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType);
+ STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y );
+
+ STDMETHOD(get_newText)( IA2TextSegment *newText);
+
+ STDMETHOD(get_oldText)( IA2TextSegment *oldText);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+};
+
+#endif // !defined(AFX_ACCTEXT_H__F06C5496_9959_4C7C_873E_A8D50CFB290D__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccText.rgs b/winaccessibility/source/UAccCOM/AccText.rgs
new file mode 100644
index 000000000000..6cb3ebdcfa0a
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccText.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccText.1 = s 'AccText Class'
+ {
+ CLSID = s '{6D8AB08B-CCE9-471E-8A41-35773D5263F5}'
+ }
+ UAccCOM.AccText = s 'AccText Class'
+ {
+ CLSID = s '{6D8AB08B-CCE9-471E-8A41-35773D5263F5}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {6D8AB08B-CCE9-471E-8A41-35773D5263F5} = s 'AccText Class'
+ {
+ ProgID = s 'UAccCOM.AccText.1'
+ VersionIndependentProgID = s 'UAccCOM.AccText'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx
new file mode 100644
index 000000000000..6b7a38fba7aa
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -0,0 +1,995 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//////////////////////////////////////////////////////////////////////
+// AccTextBase.cpp: implementation of the CAccTextBase class.
+//////////////////////////////////////////////////////////////////////
+#include "stdafx.h"
+#include <string>
+#define WNT
+
+#include <com/sun/star/accessibility/AccessibleTextType.hpp>
+#include "AccTextBase.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleTextSelection.hpp>
+#include "MAccessible.h"
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+using namespace rtl;
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+OUString ReplaceFourChar(OUString oldOUString);
+
+CAccTextBase::CAccTextBase()
+{}
+
+CAccTextBase::~CAccTextBase()
+{}
+
+
+/**
+ * Get special selection.
+ * @param startOffset Start selection offset.
+ * @param endOffset End selection offset.
+ * @param success Variant to accept the result of if the method call is successful.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_addSelection(long startOffset, long endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK XInterface#
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+
+ Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
+
+ if( pRExtension.is() )
+ {
+ pRExtension->addSelection(0, startOffset, endOffset);
+ return S_OK;
+ }
+ else
+ {
+ GetXInterface()->setSelection(startOffset, endOffset);
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special attributes.
+ * @param offset Offset.
+ * @param startOffset Variant to accept start offset.
+ * @param endOffset Variant to accept end offset.
+ * @param textAttributes Variant to accept attributes.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (startOffset == NULL || endOffset == NULL || textAttributes == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ {
+ return E_FAIL;
+ }
+
+ if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
+ return E_FAIL;
+
+ std::wstring strAttrs;
+
+ strAttrs += L"Version:1;";
+
+ Sequence< ::com::sun::star::beans::PropertyValue > pValues = GetXInterface()->getCharacterAttributes(offset, Sequence< rtl::OUString >());
+ int nCount = pValues.getLength();
+
+ short numberingLevel = 0;
+ OUString numberingPrefix;
+ Any anyNumRule;
+ bool bHaveNumberingPrefixAttr = false;
+ bool bHaveNumberingLevel = false;
+ bool bHaveNumberingRules = false;
+ for(int i =0; i<nCount; i++)
+ {
+
+ ::com::sun::star::beans::PropertyValue &pValue = pValues[i];
+ if(pValue.Name.compareTo(OUString::createFromAscii("NumberingLevel"))==0)
+ {
+ if (pValue.Value != Any())
+ pValue.Value >>= numberingLevel;
+ else
+ numberingLevel = -1;
+ bHaveNumberingLevel = true;
+ continue;
+ }
+ if(pValue.Name.compareTo(OUString::createFromAscii("NumberingPrefix"))==0)
+ {
+ pValue.Value >>=numberingPrefix;
+ bHaveNumberingPrefixAttr = true;
+ continue;
+ }
+ if(pValue.Name.compareTo(OUString::createFromAscii("NumberingRules"))==0)
+ {
+ bHaveNumberingRules = true;
+ anyNumRule = pValue.Value;
+ continue;
+ }
+ if (bHaveNumberingLevel && bHaveNumberingRules && bHaveNumberingPrefixAttr)
+ {
+ OLECHAR numProps[512] = {0};
+ strAttrs+=L";";
+ numberingPrefix = ReplaceFourChar(numberingPrefix);
+ CMAccessible::get_OLECHAR4Numbering(anyNumRule,numberingLevel,numberingPrefix,numProps);
+ strAttrs += numProps;
+ bHaveNumberingLevel = 0;
+ bHaveNumberingRules = 0;
+ }
+ if( (bHaveNumberingPrefixAttr && i > 1 ) ||
+ (!bHaveNumberingPrefixAttr && i > 0 ) ) //element 0 is NumberingPrefix, not write alone
+ {
+ strAttrs+=L";";
+ }
+ strAttrs += pValue.Name.getStr();
+ strAttrs += L":";
+
+ OLECHAR pTemp[2048] = {0};
+
+ if (pValue.Name.compareTo(OUString::createFromAscii("CharBackColor"))==0 ||
+ pValue.Name.compareTo(OUString::createFromAscii("CharColor"))==0 ||
+ pValue.Name.compareTo(OUString::createFromAscii("CharUnderlineColor"))==0 )
+ {
+ unsigned long nColor;
+ pValue.Value >>= nColor;
+ OLECHAR pBuf[64];
+ swprintf( pBuf, L"%08X", nColor );
+ pTemp[0]=L'#';
+ wcscat( pTemp, pBuf );
+
+ }
+ else
+ {
+ CMAccessible::get_OLECHARFromAny(pValue.Value,pTemp);
+ }
+
+ strAttrs +=pTemp;
+ }
+ strAttrs +=L";";
+ // #CHECK#
+ if(*textAttributes)
+ SysFreeString(*textAttributes);
+ *textAttributes = SysAllocString(strAttrs.c_str());
+
+ if( offset < GetXInterface()->getCharacterCount() )
+ {
+ TextSegment textSeg = GetXInterface()->getTextAtIndex(offset, AccessibleTextType::ATTRIBUTE_RUN);
+ *startOffset = textSeg.SegmentStart;
+ *endOffset = textSeg.SegmentEnd;
+ }
+ else
+ {
+ *startOffset = offset;
+ *endOffset = offset;
+ }
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get caret position.
+ * @param offset Variant to accept caret offset.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_caretOffset(long * offset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (offset == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ {
+ *offset = 0;
+ return S_OK;
+ }
+
+ *offset = GetXInterface()->getCaretPosition();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get character count.
+ * @param nCharacters Variant to accept character count.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_characterCount(long * nCharacters)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (nCharacters == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ {
+ *nCharacters = 0;
+ return S_OK;
+ }
+
+ *nCharacters = GetXInterface()->getCharacterCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get character extents.
+ * @param offset Offset.
+ * @param x Variant to accept x position.
+ * @param y Variant to accept y position.
+ * @param width Variant to accept width.
+ * @param Height Variant to accept height.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (x == NULL || height == NULL || y == NULL || width == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ if(offset < 0 || offset > GetXInterface()->getCharacterCount() )
+ return E_FAIL;
+
+ com::sun::star::awt::Rectangle rectangle;
+ rectangle = GetXInterface()->getCharacterBounds(offset);
+
+ //IA2Point aPoint;
+ com::sun::star::awt::Point aPoint;
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleComponent> pRComp(pRContext,UNO_QUERY);
+ if( pRComp.is() )
+ {
+ if(coordType == IA2_COORDTYPE_SCREEN_RELATIVE)
+ {
+ ::com::sun::star::awt::Point pt = pRComp->getLocationOnScreen();
+ aPoint.X = pt.X;
+ aPoint.Y = pt.Y;
+ }
+ else if(coordType == IA2_COORDTYPE_PARENT_RELATIVE)
+ {
+ ::com::sun::star::awt::Point pt = pRComp->getLocation();
+ aPoint.X = pt.X;
+ aPoint.Y = pt.Y;
+ }
+ }
+ rectangle.X = rectangle.X + aPoint.X;
+ rectangle.Y = rectangle.Y + aPoint.Y;
+
+ *x = rectangle.X;
+ *y = rectangle.Y;
+
+ // GetXInterface()->getCharacterBounds() have different implement in different acc component
+ // But we need return the width/height == 1 for every component when offset == text length.
+ // So we ignore the return result of GetXInterface()->getCharacterBounds() when offset == text length.
+ if( offset == GetXInterface()->getCharacterCount() )
+ {
+ *width = 1;
+ *height = 1;
+ }
+ else
+ {
+ *width = rectangle.Width;
+ *height = rectangle.Height;
+ }
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get selections count.
+ * @param nSelections Variant to accept selections count.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_nSelections(long * nSelections)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (nSelections == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(pUNOInterface == NULL)
+ {
+ *nSelections = 0;
+ return S_OK;
+ }
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+
+ Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
+
+ if( pRExtension.is() )
+ {
+ *nSelections = pRExtension->getSelectedPortionCount();
+ return S_OK;
+ }
+
+ long iLength = GetXInterface()->getSelectedText().getLength();
+ if( iLength> 0)
+ {
+ *nSelections = 1;
+ return S_OK;
+ }
+
+ *nSelections = 0;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get offset of some special point.
+ * @param x X position of one point.
+ * @param x Y position of one point.
+ * @param coordType Type.
+ * @param offset Variant to accept offset.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y, IA2CoordinateType, long * offset)
+{
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+
+ if (offset == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ com::sun::star::awt::Point point;
+ point.X = x;
+ point.Y = y;
+ *offset = GetXInterface()->getIndexAtPoint(point);
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get selection range.
+ * @param selection selection count.
+ * @param startOffset Variant to accept the start offset of special selection.
+ * @param endOffset Variant to accept the end offset of special selection.
+ * @return Result.
+*/
+
+STDMETHODIMP CAccTextBase::get_selection(long selectionIndex, long * startOffset, long * endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (startOffset == NULL || endOffset == NULL )
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(pUNOInterface == NULL )
+ return E_FAIL;
+
+ long nSelection = 0;
+ get_nSelections(&nSelection);
+
+ if(selectionIndex >= nSelection || selectionIndex < 0 )
+ return E_FAIL;
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+
+ Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
+
+ if( pRExtension.is() )
+ {
+ *startOffset = pRExtension->getSeletedPositionStart(selectionIndex);
+ *endOffset = pRExtension->getSeletedPositionEnd(selectionIndex);
+ return S_OK;
+ }
+ else if(GetXInterface()->getSelectionEnd() > -1)
+ {
+ *startOffset = GetXInterface()->getSelectionStart();
+ *endOffset = GetXInterface()->getSelectionEnd();
+ return S_OK;
+ }
+
+ *startOffset = 0;
+ *endOffset = 0;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special text.
+ * @param startOffset Start position of special range.
+ * @param endOffset End position of special range.
+ * @param text Variant to accept the text of special range.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_text(long startOffset, long endOffset, BSTR * text)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (text == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ if (endOffset < -1 || endOffset < startOffset )
+ {
+ return E_FAIL;
+ }
+
+ ::rtl::OUString ouStr;
+ if (endOffset == -1 )
+ {
+ long nLen=0;
+ if(SUCCEEDED(get_characterCount(&nLen)))
+ {
+ ouStr = GetXInterface()->getTextRange( 0, nLen );
+ }
+ }
+ else
+ {
+ ouStr = GetXInterface()->getTextRange( startOffset, endOffset );
+ }
+
+ SysFreeString(*text);
+ *text = SysAllocString((OLECHAR*)ouStr.getStr());
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special text before some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if (startOffset == NULL || endOffset == NULL || text == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ // In New UNO IAccessibleText.idl these constant values are defined as follows:
+ //
+ // const long TEXT_BOUNDARY_CHAR = -1;
+ // const long TEXT_BOUNDARY_TO_CURSOR_POS = -2;
+ // const long TEXT_BOUNDARY_START_OF_WORD = -3;
+ // const long TEXT_BOUNDARY_END_OF_WORD = -4;
+ // const long TEXT_BOUNDARY_START_OF_SENTENCE = -5;
+ // const long TEXT_BOUNDARY_END_OF_SENTENCE = -6;
+ // const long TEXT_BOUNDARY_START_OF_LINE = -7;
+ // const long TEXT_BOUNDARY_END_OF_LINE = -8;
+ //
+ // In UNO, the corresponding values are as follows:
+ //
+ // const short CHARACTER = 1;
+ // const short WORD = 2;
+ // const short SENTENCE = 3;
+ // const short PARAGRAPH = 4;
+ // const short LINE = 5;
+ // const short GLYPH = 6;
+ // const short ATTRIBUTE_RUN = 7;
+ //
+
+ long lUnoBoundaryType;
+
+ switch(boundaryType)
+ {
+ case IA2_TEXT_BOUNDARY_CHAR:
+ lUnoBoundaryType = 1; // CHARACTER;
+ break;
+ case IA2_TEXT_BOUNDARY_WORD:
+ lUnoBoundaryType = 2; // WORD;
+ break;
+ case IA2_TEXT_BOUNDARY_SENTENCE:
+ lUnoBoundaryType = 3; // SENTENCE;
+ break;
+ case IA2_TEXT_BOUNDARY_LINE:
+ lUnoBoundaryType = 5; // LINE;
+ break;
+ case IA2_TEXT_BOUNDARY_PARAGRAPH:
+ lUnoBoundaryType = 4;
+ break;
+ case IA2_TEXT_BOUNDARY_ALL:
+ {
+ long nChar;
+ get_nCharacters( &nChar );
+ *startOffset = 0;
+ *endOffset = nChar;
+ return get_text(0, nChar, text);
+ }
+ break;
+ default:
+ return E_FAIL;
+ }
+
+ TextSegment segment = GetXInterface()->getTextBeforeIndex( offset, sal_Int16(lUnoBoundaryType));
+ ::rtl::OUString ouStr = segment.SegmentText;
+ SysFreeString(*text);
+ *text = SysAllocString((OLECHAR*)ouStr.getStr());
+ *startOffset = segment.SegmentStart;
+ *endOffset = segment.SegmentEnd;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special text after some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (startOffset == NULL || endOffset == NULL || text == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ // In New UNO IAccessibleText.idl these constant values are defined as follows:
+ //
+ // const long TEXT_BOUNDARY_CHAR = -1;
+ // const long TEXT_BOUNDARY_TO_CURSOR_POS = -2;
+ // const long TEXT_BOUNDARY_START_OF_WORD = -3;
+ // const long TEXT_BOUNDARY_END_OF_WORD = -4;
+ // const long TEXT_BOUNDARY_START_OF_SENTENCE = -5;
+ // const long TEXT_BOUNDARY_END_OF_SENTENCE = -6;
+ // const long TEXT_BOUNDARY_START_OF_LINE = -7;
+ // const long TEXT_BOUNDARY_END_OF_LINE = -8;
+ //
+ // In UNO, the corresponding values are as follows:
+ //
+ // const short CHARACTER = 1;
+ // const short WORD = 2;
+ // const short SENTENCE = 3;
+ // const short PARAGRAPH = 4;
+ // const short LINE = 5;
+ // const short GLYPH = 6;
+ // const short ATTRIBUTE_RUN = 7;
+ //
+
+ long lUnoBoundaryType;
+ switch(boundaryType)
+ {
+ case IA2_TEXT_BOUNDARY_CHAR:
+ lUnoBoundaryType = 1; // CHARACTER;
+ break;
+ case IA2_TEXT_BOUNDARY_WORD:
+ lUnoBoundaryType = 2; // WORD;
+ break;
+ case IA2_TEXT_BOUNDARY_SENTENCE:
+ lUnoBoundaryType = 3; // SENTENCE;
+ break;
+ case IA2_TEXT_BOUNDARY_LINE:
+ lUnoBoundaryType = 5; // LINE;
+ break;
+ case IA2_TEXT_BOUNDARY_PARAGRAPH:
+ lUnoBoundaryType = 4;
+ break;
+ case IA2_TEXT_BOUNDARY_ALL:
+ {
+ long nChar;
+ get_nCharacters( &nChar );
+ *startOffset = 0;
+ *endOffset = nChar;
+ return get_text(0, nChar, text);
+ }
+ break;
+ default:
+ return E_FAIL;
+ }
+
+ TextSegment segment = GetXInterface()->getTextBehindIndex( offset, sal_Int16(lUnoBoundaryType));
+ ::rtl::OUString ouStr = segment.SegmentText;
+ SysFreeString(*text);
+ *text = SysAllocString((OLECHAR*)ouStr.getStr());
+ *startOffset = segment.SegmentStart;
+ *endOffset = segment.SegmentEnd;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get special text at some position.
+ * @param offset Special position.
+ * @param boundaryType Boundary type.
+ * @param startOffset Variant to accept the start offset.
+ * @param endOffset Variant to accept the end offset.
+ * @param text Variant to accept the special text.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
+{
+
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (startOffset == NULL || text == NULL ||endOffset == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ // In New UNO IAccessibleText.idl these constant values are defined as follows:
+ //
+ // const long TEXT_BOUNDARY_CHAR = -1;
+ // const long TEXT_BOUNDARY_TO_CURSOR_POS = -2;
+ // const long TEXT_BOUNDARY_START_OF_WORD = -3;
+ // const long TEXT_BOUNDARY_END_OF_WORD = -4;
+ // const long TEXT_BOUNDARY_START_OF_SENTENCE = -5;
+ // const long TEXT_BOUNDARY_END_OF_SENTENCE = -6;
+ // const long TEXT_BOUNDARY_START_OF_LINE = -7;
+ // const long TEXT_BOUNDARY_END_OF_LINE = -8;
+ //
+ // In UNO, the corresponding values are as follows:
+ //
+ // const short CHARACTER = 1;
+ // const short WORD = 2;
+ // const short SENTENCE = 3;
+ // const short PARAGRAPH = 4;
+ // const short LINE = 5;
+ // const short GLYPH = 6;
+ // const short ATTRIBUTE_RUN = 7;
+ //
+
+ long lUnoBoundaryType;
+
+ switch(boundaryType)
+ {
+ case IA2_TEXT_BOUNDARY_CHAR:
+ lUnoBoundaryType = 1; // CHARACTER;
+ break;
+ case IA2_TEXT_BOUNDARY_WORD:
+ lUnoBoundaryType = 2; // WORD;
+ break;
+ case IA2_TEXT_BOUNDARY_SENTENCE:
+ lUnoBoundaryType = 3; // SENTENCE;
+ break;
+ case IA2_TEXT_BOUNDARY_LINE:
+ lUnoBoundaryType = 5; // LINE;
+ break;
+ case IA2_TEXT_BOUNDARY_PARAGRAPH:
+ lUnoBoundaryType = 4;
+ break;
+ case IA2_TEXT_BOUNDARY_ALL:
+ {
+ long nChar;
+ get_nCharacters( &nChar );
+ *startOffset = 0;
+ *endOffset = nChar;
+ return get_text(0, nChar, text);
+ }
+ break;
+ default:
+ return E_FAIL;
+ }
+
+ TextSegment segment = GetXInterface()->getTextAtIndex( offset, sal_Int16(lUnoBoundaryType));
+ ::rtl::OUString ouStr = segment.SegmentText;
+ SysFreeString(*text);
+ *text = SysAllocString((OLECHAR*)ouStr.getStr());
+ *startOffset = segment.SegmentStart;
+ *endOffset = segment.SegmentEnd;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Remove selection.
+ * @param selectionIndex Special selection index
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::removeSelection(long selectionIndex)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK XInterface#
+ if(pUNOInterface == NULL)
+ {
+ return E_FAIL;
+ }
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+
+ Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
+
+ if( pRExtension.is() )
+ {
+ pRExtension->removeSelection(selectionIndex);
+ return S_OK;
+ }
+ else
+ {
+ GetXInterface()->setSelection(0, 0);
+ return S_OK;
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Set caret position.
+ * @param offset Special position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::setCaretOffset(long offset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ return E_FAIL;
+
+ GetXInterface()->setCaretPosition( offset);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Set special selection.
+ * @param selectionIndex Special selection index.
+ * @param startOffset start position.
+ * @param endOffset end position.
+ * @param success Variant to accept the memthod called result.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::setSelection(long, long startOffset, long endOffset)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ {
+ return E_FAIL;
+ }
+
+ GetXInterface()->setSelection( startOffset, endOffset );
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get characters count.
+ * @param nCharacters Variant to accept the characters count.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::get_nCharacters(long * nCharacters)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (nCharacters == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+ if(!pRXText.is())
+ {
+ *nCharacters = 0;
+ return S_OK;
+ }
+
+ *nCharacters = GetXInterface()->getCharacterCount();
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+// added by qiuhd, 2006/07/03, for direver 07/11
+STDMETHODIMP CAccTextBase::get_newText( IA2TextSegment *)
+{
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP CAccTextBase::get_oldText( IA2TextSegment *)
+{
+ return E_NOTIMPL;
+}
+
+/**
+ * Scroll to special sub-string .
+ * @param startIndex Start index of sub string.
+ * @param endIndex End index of sub string.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::scrollSubstringToPoint(long, long, IA2CoordinateType, long, long )
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CAccTextBase::scrollSubstringTo(long, long, IA2ScrollType)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put UNO interface.
+ * @param pXInterface UNO interface.
+ * @return Result.
+*/
+STDMETHODIMP CAccTextBase::put_XInterface(long pXInterface)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleText> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXText = NULL;
+ else
+ pRXText = pRXI;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+OUString ReplaceOneChar(OUString oldOUString, OUString replacedChar, OUString replaceStr)
+{
+ int iReplace = -1;
+ iReplace = oldOUString.lastIndexOf(replacedChar);
+ if (iReplace > -1)
+ {
+ for(;iReplace>-1;)
+ {
+ oldOUString = oldOUString.replaceAt(iReplace,1, replaceStr);
+ iReplace=oldOUString.lastIndexOf(replacedChar,iReplace);
+ }
+ }
+ return oldOUString;
+
+}
+OUString ReplaceFourChar(OUString oldOUString)
+{
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii("\\"),OUString::createFromAscii("\\\\"));
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii(";"),OUString::createFromAscii("\\;"));
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii("="),OUString::createFromAscii("\\="));
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii(","),OUString::createFromAscii("\\,"));
+ oldOUString = ReplaceOneChar(oldOUString,OUString::createFromAscii(":"),OUString::createFromAscii("\\:"));
+ return oldOUString;
+}
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.h b/winaccessibility/source/UAccCOM/AccTextBase.h
new file mode 100644
index 000000000000..3e22ba013eaf
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccTextBase.h
@@ -0,0 +1,122 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// AccTextBase.h: interface for the CAccTextBase class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_)
+#define AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define WNT
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include "UNOXWrapper.h"
+
+class ATL_NO_VTABLE CAccTextBase : public CUNOXWrapper
+{
+public:
+ CAccTextBase();
+ virtual ~CAccTextBase();
+
+ // IAccessibleText
+public:
+ // IAccessibleText
+
+ // Adds a text selection.
+ STDMETHOD(get_addSelection)(long startOffset, long endOffset);
+
+ // Gets text attributes.
+ STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes);
+
+ // Gets caret offset.
+ STDMETHOD(get_caretOffset)(long * offset);
+
+ // Gets total number of characters.
+ STDMETHOD(get_characterCount)(long * nCharacters);
+
+ // Gets bounding rect containing the glyph(s) representing the character
+ // at the specified text offset
+ STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height);
+
+ // Gets number of active non-contiguous selections.
+ STDMETHOD(get_nSelections)(long * nSelections);
+
+ // Gets bounding rect for the glyph at a certain point.
+ STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset);
+
+ // Gets character offsets of N-th active text selection.
+ STDMETHOD(get_selection)(long selectionIndex, long * startOffset, long * endOffset);
+
+ // Gets a range of text by offset NOTE: returned string may be longer
+ // than endOffset-startOffset bytes if text contains multi-byte characters.
+ STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text);
+
+ // Gets a specified amount of text that ends before a specified offset.
+ STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that spans the specified offset.
+ STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Gets a specified amount of text that starts after a specified offset.
+ STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
+
+ // Unselects a range of text.
+ STDMETHOD(removeSelection)(long selectionIndex);
+
+ // Moves text caret.
+ STDMETHOD(setCaretOffset)(long offset);
+
+ // Changes the bounds of an existing selection.
+ STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset);
+
+ // Gets total number of characters.
+ // NOTE: this may be different than the total number of bytes required
+ // to store the text, if the text contains multi-byte characters.
+ STDMETHOD(get_nCharacters)(long * nCharacters);
+
+ STDMETHOD(get_newText)( IA2TextSegment *newText);
+
+ STDMETHOD(get_oldText)( IA2TextSegment *oldText);
+
+ // Makes specific part of string visible on screen.
+ STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType);
+ STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y );
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleText> pRXText;
+
+ inline com::sun::star::accessibility::XAccessibleText* GetXInterface()
+ {
+ return pRXText.get();
+ }
+};
+
+#endif // !defined(AFX_ACCTEXTBASE_H__B9AE05F6_E28B_4CF3_A8F2_EEE5D2E00B82__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccValue.cxx b/winaccessibility/source/UAccCOM/AccValue.cxx
new file mode 100644
index 000000000000..60c7af88cf20
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccValue.cxx
@@ -0,0 +1,224 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccValue.h"
+#include "MAccessible.h"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+/**
+ * Get current value.
+ * @param currentValue Variant that accepts current value.
+ * @return Result.
+ */
+
+STDMETHODIMP CAccValue::get_currentValue(VARIANT * currentValue)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (currentValue == NULL)
+ return E_INVALIDARG;
+ if ( !pRXVal.is() )
+ return E_FAIL;
+
+ // Get Any type value from UNO.
+ ::com::sun::star::uno::Any anyVal = GetXInterface()->getCurrentValue();
+ // Convert Any to VARIANT.
+ CMAccessible::ConvertAnyToVariant(anyVal, currentValue);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Set current value.
+ * @param Value New value should be set.
+ * @param success If the method is successfully called.
+ * @return Result.
+ */
+STDMETHODIMP CAccValue::setCurrentValue(VARIANT value)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if ( !pRXVal.is() )
+ return E_FAIL;
+
+ HRESULT hRet = S_OK;
+ ::com::sun::star::uno::Any anyVal;
+
+ // Set value according to value type.
+ switch(value.vt)
+ {
+ case VT_UI1:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_CHAR, (sal_Char *)"char");
+ anyVal.setValue(&value.bVal, typeInfo);
+ }
+ break;
+
+ case VT_BOOL:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_BOOLEAN, (sal_Char *)"bool");
+ anyVal.setValue(&value.boolVal, typeInfo);
+ }
+ break;
+
+ case VT_I2:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_SHORT, (sal_Char *)"short");
+ anyVal.setValue(&value.iVal, typeInfo);
+ }
+ break;
+
+ case VT_I4:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_LONG, (sal_Char *)"long");
+ anyVal.setValue(&value.lVal, typeInfo);
+ }
+ break;
+
+ case VT_R4:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_FLOAT, (sal_Char *)"float");
+ anyVal.setValue(&value.fltVal, typeInfo);
+ }
+ break;
+
+ case VT_R8:
+ {
+ ::com::sun::star::uno::Type typeInfo(TypeClass_DOUBLE, (sal_Char *)"double");
+ anyVal.setValue(&value.dblVal, typeInfo);
+ }
+ break;
+
+ default:
+ {
+ // Unsupport type conversion.
+ hRet = E_FAIL;
+ }
+ break;
+ }
+
+ if(hRet == S_OK)
+ {
+ hRet = pRXVal->setCurrentValue(anyVal) ? S_OK : E_FAIL ;
+ }
+
+ return hRet;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get maximum value.
+ * @param maximumValue Variant that accepts maximum value.
+ * @return Result.
+ */
+STDMETHODIMP CAccValue::get_maximumValue(VARIANT *maximumValue)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (maximumValue == NULL)
+ return E_INVALIDARG;
+ if ( !pRXVal.is() )
+ return E_FAIL;
+
+ // Get Any type value from UNO.
+ ::com::sun::star::uno::Any anyVal = GetXInterface()->getMaximumValue();
+ // Convert Any to VARIANT.
+ CMAccessible::ConvertAnyToVariant(anyVal, maximumValue);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Get minimum value.
+ * @param mininumValue Variant that accepts minimum value.
+ * @return Result.
+ */
+STDMETHODIMP CAccValue::get_minimumValue(VARIANT *mininumValue)
+{
+
+ CHECK_ENABLE_INF
+
+ ENTER_PROTECTED_BLOCK
+
+ if (mininumValue == NULL)
+ return E_FAIL;
+ if ( !pRXVal.is() )
+ return E_FAIL;
+
+ // Get Any type value from UNO.
+ ::com::sun::star::uno::Any anyVal = GetXInterface()->getMinimumValue();
+ // Convert Any to VARIANT.
+ CMAccessible::ConvertAnyToVariant(anyVal, mininumValue);
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+ * Put valid UNO interface into com class.
+ * @param pXInterface UNO interface.
+ * @return Result.
+ */
+STDMETHODIMP CAccValue::put_XInterface(long pXInterface)
+{
+
+
+ ENTER_PROTECTED_BLOCK
+
+ CUNOXWrapper::put_XInterface(pXInterface);
+ //special query.
+ if(pUNOInterface == NULL)
+ return E_FAIL;
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleValue> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ pRXVal = NULL;
+ else
+ pRXVal = pRXI.get();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
diff --git a/winaccessibility/source/UAccCOM/AccValue.h b/winaccessibility/source/UAccCOM/AccValue.h
new file mode 100644
index 000000000000..674f1e70d1e3
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccValue.h
@@ -0,0 +1,104 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#if !defined(AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_)
+#define AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/uno/reference.hxx>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#include "UNOXWrapper.h"
+
+/**
+ * CAccValue implements IAccessibleValue interface.
+ */
+class CAccValue :
+ public CComObjectRoot,
+ public CComCoClass<CAccValue,&CLSID_AccValue>,
+ public IAccessibleValue,
+ public CUNOXWrapper
+{
+public:
+ CAccValue()
+ {
+ }
+ virtual ~CAccValue()
+ {
+ }
+
+ BEGIN_COM_MAP(CAccValue)
+ COM_INTERFACE_ENTRY(IAccessibleValue)
+ COM_INTERFACE_ENTRY(IUNOXWrapper)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CAccValue*)pv)->SmartQI(iid,ppvObject);
+ }
+
+ HRESULT SmartQI(REFIID iid, void** ppvObject)
+ {
+ if( m_pOuterUnknown )
+ return OuterQueryInterface(iid,ppvObject);
+ return E_FAIL;
+ }
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_AccValue)
+
+ // IAccessibleValue
+public:
+ // IAccessibleValue
+
+ // Returns the value of this object as a number.
+ STDMETHOD(get_currentValue)(VARIANT *currentValue);
+
+ // Sets the value of this object to the given number.
+ STDMETHOD(setCurrentValue)(VARIANT value);
+
+ // Returns the maximal value that can be represented by this object.
+ STDMETHOD(get_maximumValue)(VARIANT *maximumValue);
+
+ // Returns the minimal value that can be represented by this object.
+ STDMETHOD(get_minimumValue)(VARIANT *mininumValue);
+
+ // Overide of IUNOXWrapper.
+ STDMETHOD(put_XInterface)(long pXInterface);
+
+private:
+
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleValue> pRXVal;
+
+ inline com::sun::star::accessibility::XAccessibleValue* GetXInterface()
+ {
+ return pRXVal.get();
+ }
+
+};
+
+#endif // !defined(AFX_ACCVALUE_H__CBA4972C_4188_4A18_A3CD_4A1FA3DDED38__INCLUDED_)
diff --git a/winaccessibility/source/UAccCOM/AccValue.rgs b/winaccessibility/source/UAccCOM/AccValue.rgs
new file mode 100644
index 000000000000..f57f318379ec
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccValue.rgs
@@ -0,0 +1,23 @@
+HKCR
+{
+ UAccCOM.AccValue.1 = s 'AccValue Class'
+ {
+ CLSID = s '{730A561B-1AF6-49E1-9C04-9A2F48CD8512}'
+ }
+ UAccCOM.AccValue = s 'AccValue Class'
+ {
+ CLSID = s '{730A561B-1AF6-49E1-9C04-9A2F48CD8512}'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {730A561B-1AF6-49E1-9C04-9A2F48CD8512} = s 'AccValue Class'
+ {
+ ProgID = s 'UAccCOM.AccValue.1'
+ VersionIndependentProgID = s 'UAccCOM.AccValue'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'both'
+ }
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/AccessibleKeyStroke.h b/winaccessibility/source/UAccCOM/AccessibleKeyStroke.h
new file mode 100644
index 000000000000..f29b116571f1
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/AccessibleKeyStroke.h
@@ -0,0 +1,157 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ACCESSIBLEKEYSTROKE_H_
+#define __ACCESSIBLEKEYSTROKE_H_
+
+#pragma once
+
+typedef struct _ACCESSIBLE_KEYSTROKE {
+ short modifiers;
+ short keyCode;
+ char keyChar;
+ short keyFunc;
+} ACCESSIBLE_KEYSTROKE;
+
+const short MODIFIER_SHIFT = 1;
+const short MODIFIER_CTRL = 2;
+const short MODIFIER_ALT = 4;
+
+const short KEYCODE_NUM0 = 256;
+const short KEYCODE_NUM1 = 257;
+const short KEYCODE_NUM2 = 258;
+const short KEYCODE_NUM3 = 259;
+const short KEYCODE_NUM4 = 260;
+const short KEYCODE_NUM5 = 261;
+const short KEYCODE_NUM6 = 262;
+const short KEYCODE_NUM7 = 263;
+const short KEYCODE_NUM8 = 264;
+const short KEYCODE_NUM9 = 265;
+const short KEYCODE_A = 512;
+const short KEYCODE_B = 513;
+const short KEYCODE_C = 514;
+const short KEYCODE_D = 515;
+const short KEYCODE_E = 516;
+const short KEYCODE_F = 517;
+const short KEYCODE_G = 518;
+const short KEYCODE_H = 519;
+const short KEYCODE_I = 520;
+const short KEYCODE_J = 521;
+const short KEYCODE_K = 522;
+const short KEYCODE_L = 523;
+const short KEYCODE_M = 524;
+const short KEYCODE_N = 525;
+const short KEYCODE_O = 526;
+const short KEYCODE_P = 527;
+const short KEYCODE_Q = 528;
+const short KEYCODE_R = 529;
+const short KEYCODE_S = 530;
+const short KEYCODE_T = 531;
+const short KEYCODE_U = 532;
+const short KEYCODE_V = 533;
+const short KEYCODE_W = 534;
+const short KEYCODE_X = 535;
+const short KEYCODE_Y = 536;
+const short KEYCODE_Z = 537;
+const short KEYCODE_F1 = 768;
+const short KEYCODE_F2 = 769;
+const short KEYCODE_F3 = 770;
+const short KEYCODE_F4 = 771;
+const short KEYCODE_F5 = 772;
+const short KEYCODE_F6 = 773;
+const short KEYCODE_F7 = 774;
+const short KEYCODE_F8 = 775;
+const short KEYCODE_F9 = 776;
+const short KEYCODE_F10 = 777;
+const short KEYCODE_F11 = 778;
+const short KEYCODE_F12 = 779;
+const short KEYCODE_F13 = 780;
+const short KEYCODE_F14 = 781;
+const short KEYCODE_F15 = 782;
+const short KEYCODE_F16 = 783;
+const short KEYCODE_F17 = 784;
+const short KEYCODE_F18 = 785;
+const short KEYCODE_F19 = 786;
+const short KEYCODE_F20 = 787;
+const short KEYCODE_F21 = 788;
+const short KEYCODE_F22 = 789;
+const short KEYCODE_F23 = 790;
+const short KEYCODE_F24 = 791;
+const short KEYCODE_F25 = 792;
+const short KEYCODE_F26 = 793;
+const short KEYCODE_DOWN = 1024;
+const short KEYCODE_UP = 1025;
+const short KEYCODE_LEFT = 1026;
+const short KEYCODE_RIGHT = 1027;
+const short KEYCODE_HOME = 1028;
+const short KEYCODE_END = 1029;
+const short KEYCODE_PAGEUP = 1030;
+const short KEYCODE_PAGEDOWN = 1031;
+const short KEYCODE_RETURN = 1280;
+const short KEYCODE_ESCAPE = 1281;
+const short KEYCODE_TAB = 1282;
+const short KEYCODE_BACKSPACE = 1283;
+const short KEYCODE_SPACE = 1284;
+const short KEYCODE_INSERT = 1285;
+const short KEYCODE_DELETE = 1286;
+const short KEYCODE_ADD = 1287;
+const short KEYCODE_SUBTRACT = 1288;
+const short KEYCODE_MULTIPLY = 1289;
+const short KEYCODE_DIVIDE = 1290;
+const short KEYCODE_POINT = 1291;
+const short KEYCODE_COMMA = 1292;
+const short KEYCODE_LESS = 1293;
+const short KEYCODE_GREATER = 1294;
+const short KEYCODE_EQUAL = 1295;
+const short KEYCODE_OPEN = 1296;
+const short KEYCODE_CUT = 1297;
+const short KEYCODE_COPY = 1298;
+const short KEYCODE_PASTE = 1299;
+const short KEYCODE_UNDO = 1300;
+const short KEYCODE_REPEAT = 1301;
+const short KEYCODE_FIND = 1302;
+const short KEYCODE_PROPERTIES = 1303;
+const short KEYCODE_FRONT = 1304;
+const short KEYCODE_CONTEXTMENU = 1305;
+const short KEYCODE_HELP = 1306;
+
+const short SHORTCUT_DONTKNOW = 0;
+const short NEW = 1;
+const short OPEN = 2;
+const short SAVE = 3;
+const short SAVEAS = 4;
+const short PRINT = 5;
+const short CLOSE = 6;
+const short QUIT = 7;
+const short CUT = 8;
+const short COPY = 9;
+const short PASTE = 10;
+const short UNDO = 11;
+const short REDO = 12;
+const short UNODELETE = 13;
+const short REPEAT = 14;
+const short FIND = 15;
+const short FINDBACKWARD = 16;
+const short PROPERTIES = 17;
+const short FRONT = 18;
+
+
+#endif //#define __ACCESSIBLEKEYSTROKE_H_
diff --git a/winaccessibility/source/UAccCOM/CheckEnableAccessible.cxx b/winaccessibility/source/UAccCOM/CheckEnableAccessible.cxx
new file mode 100644
index 000000000000..fa61021c388c
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/CheckEnableAccessible.cxx
@@ -0,0 +1,35 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#define WNT
+#define _USE_NAMESPACE
+
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+#include "CheckEnableAccessible.h"
+
+
+bool IsEnableAccessibleInterface()
+{
+ return Application::IsEnableAccessInterface();
+}
diff --git a/winaccessibility/source/UAccCOM/CheckEnableAccessible.h b/winaccessibility/source/UAccCOM/CheckEnableAccessible.h
new file mode 100644
index 000000000000..729817dc6f86
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/CheckEnableAccessible.h
@@ -0,0 +1,30 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef _CHECKENABLEACCESSIBLE_HXX
+#define _CHECKENABLEACCESSIBLE_HXX
+
+bool IsEnableAccessibleInterface();
+
+#define CHECK_ENABLE_INF if(!IsEnableAccessibleInterface()){ return S_FALSE; }
+#define CHECK_ENABLE_INF_ZERO if(!IsEnableAccessibleInterface()){ return 0; }
+
+#endif //_CHECKENABLEACCESSIBLE_HXX
diff --git a/winaccessibility/source/UAccCOM/EnumVariant.cxx b/winaccessibility/source/UAccCOM/EnumVariant.cxx
new file mode 100644
index 000000000000..271b288df42b
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/EnumVariant.cxx
@@ -0,0 +1,227 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "EnumVariant.h"
+#include "MAccessible.h"
+
+#include "act.hxx"
+
+/////////////////////////////////////////////////////////////////////////////
+// CEnumVariant
+
+
+
+/**
+ * enumarate method,get next element
+ * @param cElements The number of elements to be returned.
+ * @param pvar An array of at least size celt in which the elements are to be returned.
+ * @param pcElementFetched Pointer to the number of elements returned in rgVar, or NullĄŁ
+ * @return Result.
+ */
+HRESULT STDMETHODCALLTYPE CEnumVariant::Next(ULONG cElements,VARIANT __RPC_FAR *pvar,ULONG __RPC_FAR *pcElementFetched)
+{
+ long l1;
+ ULONG l2;
+
+ if (pvar == NULL)
+ return E_INVALIDARG;
+
+ CHECK_ENABLE_INF
+ if (pcElementFetched != NULL)
+ *pcElementFetched = 0;
+
+ // Retrieve the next cElements.
+ for (l1=m_lCurrent, l2=0; l1<m_pXAccessibleSelection->getSelectedAccessibleChildCount() &&
+ l2<cElements; l1++, l2++)
+ {
+ Reference< XAccessible > pRXAcc = m_pXAccessibleSelection->getSelectedAccessibleChild(l1);
+ IAccessible* pChild = NULL;
+ BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild);
+ if(isGet)
+ {
+ pvar[l2].vt = VT_I4;
+ ((IMAccessible*)pChild)->Get_XAccChildID(&pvar[l2].lVal);
+ }
+ else if(pRXAcc.is())
+ {
+ if(CMAccessible::g_pAgent)
+ CMAccessible::g_pAgent->InsertAccObj(pRXAcc.get(),pUNOInterface,NULL);
+ BOOL isGet = CMAccessible::get_IAccessibleFromXAccessible((long)pRXAcc.get(),&pChild);
+ if(isGet)
+ {
+ pvar[l2].vt = VT_I4;
+ ((IMAccessible*)pChild)->Get_XAccChildID(&pvar[l2].lVal);
+ }
+ }
+ }
+ // Set count of elements retrieved.
+ if (pcElementFetched != NULL)
+ *pcElementFetched = l2;
+ m_lCurrent = l1;
+
+ return (l2 < cElements) ? S_FALSE : NOERROR;
+}
+
+/**
+ * skip the elements in the given range when enumarate elements
+ * @param cElements The number of elements to skip.
+ * @return Result.
+ */
+HRESULT STDMETHODCALLTYPE CEnumVariant::Skip(ULONG cElements)
+{
+ CHECK_ENABLE_INF
+ m_lCurrent += cElements;
+ if (m_lCurrent > (long)(m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount()))
+ {
+ m_lCurrent = m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount();
+ return E_FAIL;
+ }
+ else
+ return NOERROR;
+}
+
+
+/**
+ * reset the enumaration position to initial value
+ * @param
+ * @return Result.
+ */
+HRESULT STDMETHODCALLTYPE CEnumVariant::Reset( void)
+{
+ m_lCurrent = m_lLBound;
+ return NOERROR;
+}
+
+
+/**
+ *create a new IEnumVariant object,
+ *copy current enumaration container and its state to
+ *the new object
+ *AT will use the copy object to get elements
+ * @param ppenum On return, pointer to the location of the clone enumeratorĄŁ
+ * @return Result.
+ */
+HRESULT STDMETHODCALLTYPE CEnumVariant::Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR *ppenum)
+{
+ CEnumVariant * penum = NULL;
+ HRESULT hr;
+ if (ppenum == NULL)
+ return E_INVALIDARG;
+
+ *ppenum = NULL;
+
+ hr = Create(&penum);
+ if( hr == S_OK )
+ {
+ penum->PutSelection((long)pUNOInterface);
+ *ppenum = penum;
+ }
+ else
+ {
+ if (penum)
+ penum->Release();
+ }
+ return hr;
+}
+
+/**
+ *Static public method to create a CLSID_EnumVariant com object.
+ * @param ppenum Pointer to accept com object.
+ * @return Result.
+ */
+HRESULT STDMETHODCALLTYPE CEnumVariant::Create(CEnumVariant __RPC_FAR *__RPC_FAR *ppenum)
+{
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance(CLSID_EnumVariant,NULL,
+ CLSCTX_SERVER,IID_IEnumVariant,(void **)ppenum);
+ DeactivateActContext();
+ if (S_OK != hr)
+ {
+ return E_FAIL;
+ }
+
+ return S_OK;
+}
+
+/**
+ *Return count of elements in current container
+ * @param.
+ * @return count of elements in current container.
+ */
+long CEnumVariant::GetCountOfElements()
+{
+ CHECK_ENABLE_INF_ZERO
+
+ if(m_pXAccessibleSelection.is())
+ return m_pXAccessibleSelection->getSelectedAccessibleChildCount();
+ return 0;
+}
+
+/**
+ * Set memeber m_pXAccessibleSelection to NULL and m_lCurrent to m_lLBound.
+ * @param.
+ * @return Result
+ */
+STDMETHODIMP CEnumVariant::ClearEnumeration()
+{
+ pUNOInterface = NULL;
+ m_pXAccessibleSelection = NULL;
+ m_lCurrent = m_lLBound;
+ return S_OK;
+}
+
+/**
+ *Static method to fetch XAccessibleSelection
+ * @param pXAcc XAccessible interface.
+ * @return XAccessibleSelection interface.
+ */
+static Reference<XAccessibleSelection> GetXAccessibleSelection(XAccessible* pXAcc)
+{
+ XAccessibleSelection* pSelection = NULL;
+ Reference< XAccessibleContext > pRContext;
+
+ if( pXAcc == NULL)
+ return NULL;
+
+ pRContext = pXAcc->getAccessibleContext();
+ if( !pRContext.is() )
+ return NULL;
+
+ Reference< XAccessibleSelection > pRSelection(pRContext,UNO_QUERY);
+ if( !pRSelection.is() )
+ return NULL;
+
+ return pRSelection;
+}
+
+/**
+ * Put valid UNO XAccessible interface.
+ * @param pXSelection XAccessible interface.
+ * @return Result..
+ */
+STDMETHODIMP CEnumVariant::PutSelection(long pXSelection)
+{
+ pUNOInterface = (XAccessible*)pXSelection;
+ m_pXAccessibleSelection = GetXAccessibleSelection(pUNOInterface);
+ return S_OK;
+}
diff --git a/winaccessibility/source/UAccCOM/EnumVariant.h b/winaccessibility/source/UAccCOM/EnumVariant.h
new file mode 100644
index 000000000000..1089abdf6415
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/EnumVariant.h
@@ -0,0 +1,106 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ENUMVARIANT_H_
+#define __ENUMVARIANT_H_
+
+#define WNT
+
+#include "resource.h" // main symbols
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include "UAccCOM2.h"
+#include <AccObjectManagerAgent.hxx>
+
+using namespace com::sun::star::accessibility;
+using namespace com::sun::star::uno;
+
+#include <vector>
+#include <algorithm>
+using namespace std;
+
+/**
+ * CEnumVariant implements IEnumVARIANT interface.
+ */
+class ATL_NO_VTABLE CEnumVariant :
+ public CComObjectRootEx<CComMultiThreadModel>,
+ public CComCoClass<CEnumVariant, &CLSID_EnumVariant>,
+ public IDispatchImpl<IEnumVariant, &IID_IEnumVariant, &LIBID_UACCCOMLib>
+{
+public:
+ CEnumVariant()
+ :m_lLBound(0),
+ pUNOInterface(NULL),
+ m_pXAccessibleSelection(NULL)
+ {
+ m_lCurrent = m_lLBound;
+ }
+
+ virtual ~CEnumVariant() {};
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_ENUMVARIANT)
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CEnumVariant)
+ COM_INTERFACE_ENTRY(IEnumVariant)
+ COM_INTERFACE_ENTRY(IEnumVARIANT)
+ END_COM_MAP()
+
+ // IEnumVariant
+public:
+
+ STDMETHOD(ClearEnumeration)();
+
+ // IEnumVARIANT
+
+ //
+ HRESULT STDMETHODCALLTYPE Next(ULONG cElements,VARIANT __RPC_FAR *pvar,ULONG __RPC_FAR *pcElementFetched);
+
+ //
+ HRESULT STDMETHODCALLTYPE Skip(ULONG cElements);
+
+ //
+ HRESULT STDMETHODCALLTYPE Reset( void);
+
+ //
+ HRESULT STDMETHODCALLTYPE Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR *ppenum);
+
+ // IEnumVariant
+
+ //
+ HRESULT STDMETHODCALLTYPE PutSelection(long pXSelection);
+
+ //
+ static HRESULT STDMETHODCALLTYPE Create(CEnumVariant __RPC_FAR *__RPC_FAR *ppenum);
+
+ //
+ long GetCountOfElements();
+
+private:
+
+ long m_lCurrent;
+ long m_lLBound;
+ XAccessible* pUNOInterface; // XAccessible.
+ Reference<XAccessibleSelection> m_pXAccessibleSelection; // Selection.
+};
+
+#endif //__ENUMVARIANT_H_
diff --git a/winaccessibility/source/UAccCOM/EnumVariant.rgs b/winaccessibility/source/UAccCOM/EnumVariant.rgs
new file mode 100644
index 000000000000..c5decdc4728f
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/EnumVariant.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ UAccCOM.EnumVariant.1 = s 'EnumVariant Class'
+ {
+ CLSID = s '{152884E0-268B-4481-9AE7-1B372D3AA97F}'
+ }
+ UAccCOM.EnumVariant = s 'EnumVariant Class'
+ {
+ CLSID = s '{152884E0-268B-4481-9AE7-1B372D3AA97F}'
+ CurVer = s 'UAccCOM.EnumVariant.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {152884E0-268B-4481-9AE7-1B372D3AA97F} = s 'EnumVariant Class'
+ {
+ ProgID = s 'UAccCOM.EnumVariant.1'
+ VersionIndependentProgID = s 'UAccCOM.EnumVariant'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Both'
+ }
+ 'TypeLib' = s '{19ECB1B0-9376-4FF9-B580-223FC9C200B8}'
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
new file mode 100644
index 000000000000..155c3afe70d8
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -0,0 +1,3267 @@
+/**************************************************************
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "MAccessible.h"
+
+#include <algorithm>
+#include "AccAction.h"
+
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
+#include <com/sun/star/accessibility/XAccessibleHyperText.hpp>
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/TabStop.hpp>
+#include <com/sun/star/container/XIndexReplace.hpp>
+
+#include "act.hxx"
+
+using namespace com::sun::star::accessibility::AccessibleStateType;
+
+// IA2 states mapping, and name
+// maintenance the consistency, change one array, change the three all
+long IA2_STATES[] =
+{
+ IA2_STATE_ACTIVE, // = 0x1;
+ IA2_STATE_ARMED, // = 0x2;
+ IA2_STATE_DEFUNCT, // = 0x4;
+ IA2_STATE_EDITABLE, // = 0x8;
+ IA2_STATE_HORIZONTAL, // = 0x10;
+ IA2_STATE_ICONIFIED, // = 0x20;
+ IA2_STATE_INVALID_ENTRY, // = 0x80;
+ IA2_STATE_MANAGES_DESCENDANTS, // = 0x100;
+ IA2_STATE_MODAL, // = 0x200;
+ IA2_STATE_MULTI_LINE, // = 0x400;
+ IA2_STATE_OPAQUE, // = 0x800;
+ IA2_STATE_REQUIRED, // = 0x2000;
+ IA2_STATE_SELECTABLE_TEXT, // = 0x3000;
+ IA2_STATE_SINGLE_LINE, // = 0x4000;
+ IA2_STATE_STALE, // = 0x8000;
+ IA2_STATE_SUPPORTS_AUTOCOMPLETION, // = 0x10000;
+ IA2_STATE_TRANSIENT, //= 0x20000;
+ IA2_STATE_VERTICAL // = 0x40000;
+};
+/*
+
+<=== map ===>
+
+*/
+short UNO_STATES[] =
+{
+ ACTIVE, // = (sal_Int16)1;
+ ARMED, // = (sal_Int16)2;
+ DEFUNC, // = (sal_Int16)5;
+ EDITABLE, // = (sal_Int16)6;
+ HORIZONTAL, // = (sal_Int16)12;
+ ICONIFIED, // = (sal_Int16)13;
+ -1, //IA2_STATE_INVALID_ENTRY
+ MANAGES_DESCENDANTS, // = (sal_Int16)15;
+ MODAL, // = (sal_Int16)16;
+ MULTI_LINE, // = (sal_Int16)17;
+ OPAQUE, // = (sal_Int16)19;
+ -1, //IA2_STATE_REQUIRED
+ -1, //IA2_STATE_SELECTABLE_TEXT
+ SINGLE_LINE, // = (sal_Int16)26;
+ STALE, // = (sal_Int16)27;
+ -1, //IA2_STATE_SUPPORTS_AUTOCOMPLETION
+ TRANSIENT, //IA2_STATE_TRANSIENT
+ VERTICAL // = (sal_Int16)29;
+};
+
+// <=== map ===>
+
+BSTR IA2_STATES_NAME[] =
+{
+ _T("Active"),
+ _T("Armed"),
+ _T("Defunct"),
+ _T("Editable"),
+ _T("Horizontal"),
+ _T("Iconified"),
+ _T("Invalid Entry"),
+ _T("Manages Decendents"),
+ _T("Modal"),
+ _T("Multi Line"),
+ _T("Opaque"),
+ _T("Required"),
+ _T("Selectable Text"),
+ _T("Single Line"),
+ _T("Stale"),
+ _T("Supports Autocompletion"),
+ _T("Transient"),
+ _T("Vertical")
+};
+
+// IA2 states mapping, and name
+// maintenance the consistency. change one, change them all
+
+BSTR UNO_ALL_STATES[] =
+{
+ _T("INVALID"), // INVALID ( 0 )
+ _T("ACTIVE"), // ACTIVE ( 1 )
+ _T("ARMED"), // ARMED ( 2 )
+ _T("BUSY"), // BUSY ( 3 )
+ _T("CHECKED"), // CHECKED ( 4 )
+ _T("DEFUNC"), // DEFUNC ( 5 )
+ _T("EDITABLE"), // EDITABLE ( 6 )
+ _T("ENABLED"), // ENABLED ( 7 )
+ _T("EXPANDABLE"), // EXPANDABLE ( 8 )
+ _T("EXPANDED"), // EXPANDED ( 9 )
+ _T("FOCUSABLE"), // FOCUSABLE ( 10 )
+ _T("FOCUSED"), // FOCUSED ( 11 )
+ _T("HORIZONTAL"), // HORIZONTAL ( 12 )
+ _T("ICONIFIED"), // ICONIFIED ( 13 )
+ _T("INDETERMINATE"), // INDETERMINATE ( 14 )
+ _T("MANAGES_DESCENDANTS"),// MANAGES_DESCENDANTS ( 15 )
+ _T("MODAL"), // MODAL ( 16 )
+ _T("MULTI_LINE"), // MULTI_LINE ( 17 )
+ _T("MULTI_SELECTABLE"), // MULTI_SELECTABLE ( 18 )
+ _T("OPAQUE"), // OPAQUE ( 19 )
+ _T("PRESSED"), // PRESSED ( 20 )
+ _T("RESIZABLE"), // RESIZABLE ( 21 )
+ _T("SELECTABLE"), // SELECTABLE ( 22 )
+ _T("SELECTED"), // SELECTED ( 23 )
+ _T("SENSITIVE"), // SENSITIVE ( 24 )
+ _T("SHOWING"), // SHOWING ( 25 )
+ _T("SINGLE_LINE"), // SINGLE_LINE ( 26 )
+ _T("STALE"), // STALE ( 27 )
+ _T("TRANSIENT"), // TRANSIENT ( 28 )
+ _T("VERTICAL"), // VERTICAL ( 29 )
+ _T("VISIBLE"), // VISIBLE ( 30 )
+ _T("MOVEABLE"), // MOVEABLE ( 31 )
+ _T("OFFSCREEN"), // OFFSCREEN ( 32 )
+ _T("COLLAPSE"), // COLLAPSE ( 33 )
+ _T("DEFAULT") // DEFAULT ( 34 )
+};
+
+
+using namespace com::sun::star::accessibility::AccessibleRole;
+
+
+
+#define QUERYXINTERFACE(ainterface) \
+{ \
+ if(pXAcc == NULL) \
+ return FALSE; \
+ pRContext = pXAcc->getAccessibleContext(); \
+ if( !pRContext.is() ) \
+{ \
+ return FALSE; \
+} \
+ Reference<X##ainterface> pRXI(pRContext,UNO_QUERY);\
+ if( !pRXI.is() ) \
+{ \
+ return FALSE; \
+} \
+ *ppXI = (XInterface*)pRXI.get(); \
+ return TRUE; \
+}
+
+#define ISDESTROY() \
+ if(m_isDestroy) \
+ return S_FALSE;
+
+
+AccObjectManagerAgent* CMAccessible::g_pAgent = NULL;
+
+CMAccessible::CMAccessible():
+m_iRole(0x00),
+m_dState(0x00),
+m_dChildID(0x00),
+m_dFocusChildID(UACC_NO_FOCUS),
+m_hwnd(NULL),
+m_pIParent(NULL),
+m_pszName(NULL),
+m_pszValue(NULL),
+m_pszDescription(NULL),
+m_isDestroy(FALSE),
+m_pszActionDescription(NULL),
+m_pXAction(NULL),
+m_bRequiresSave(FALSE),
+pUNOInterface(NULL)
+{
+ m_sLocation.m_dLeft=0;
+ m_sLocation.m_dTop = 0;
+ m_sLocation.m_dWidth=0;
+ m_sLocation.m_dHeight=0;
+ CEnumVariant::Create(&m_pEnumVar);
+}
+
+CMAccessible::~CMAccessible()
+{
+ if(m_pszName!=NULL)
+ {
+ SAFE_SYSFREESTRING(m_pszName);
+ m_pszName=NULL;
+ }
+ if(m_pszValue!=NULL)
+ {
+ SAFE_SYSFREESTRING(m_pszValue);
+ m_pszValue=NULL;
+ }
+ if(m_pszDescription!=NULL)
+ {
+ SAFE_SYSFREESTRING(m_pszDescription);
+ m_pszDescription=NULL;
+ }
+
+ if(m_pszActionDescription!=NULL)
+ {
+ SAFE_SYSFREESTRING(m_pszActionDescription);
+ m_pszActionDescription=NULL;
+ }
+
+ if(m_pIParent)
+ {
+ m_pIParent->Release();
+ m_pIParent=NULL;
+ }
+ pRef = NULL;
+ m_pEnumVar->Release();
+ m_containedObjects.clear();
+ pRContext = NULL;
+}
+
+/**
+* Returns the Parent IAccessible interface pointer to AT.
+* It should add reference, and the client should release the component.
+* It should return E_FAIL when the parent point is null.
+* @param ppdispParent [in,out] used to return the parent interface point.
+* when the point is null, should return null.
+* @return S_OK if successful and E_FAIL if the m_pIParent is NULL.
+*/
+STDMETHODIMP CMAccessible::get_accParent(IDispatch **ppdispParent)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(ppdispParent == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ if(m_pIParent)
+ {
+ *ppdispParent = m_pIParent;
+ (*ppdispParent)->AddRef();
+ return S_OK;
+ }
+ else if(m_hwnd)
+ {
+ HRESULT hr = AccessibleObjectFromWindow(m_hwnd, OBJID_WINDOW, IID_IAccessible, (void**)ppdispParent);
+ if( ! SUCCEEDED( hr ) || ! ppdispParent )
+ {
+ return S_FALSE;
+ }
+ return S_OK;
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns child count of current COM object.
+* @param pcountChildren [in,out] used to return the children count.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::get_accChildCount(long *pcountChildren)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pcountChildren == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ if(!pUNOInterface)
+ return S_FALSE;
+
+ Reference< XAccessibleContext > pRContext = pUNOInterface->getAccessibleContext();
+ if( pRContext.is() )
+ {
+ *pcountChildren = pRContext->getAccessibleChildCount();
+ }
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns child interface pointer for AT according to input child ID.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param ppdispChild, [in,out] use to return the child interface point.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChild)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(ppdispChild == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt==VT_I4)
+ {
+ //get child interface pointer due to child ID
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ AddRef();
+ *ppdispChild = this;
+ return S_OK;
+ }
+ *ppdispChild = GetChildInterface(varChild.lVal);
+ (*ppdispChild)->AddRef();
+ return (*ppdispChild)?S_OK:S_FALSE;
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible name of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszName, [in,out] use to return the name of the proper object.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accName(VARIANT varChild, BSTR *pszName)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszName == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ SAFE_SYSFREESTRING(*pszName);
+ *pszName = SysAllocString(m_pszName);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accName(varChild,pszName);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible value of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszValue, [in,out] use to return the value of the proper object.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accValue(VARIANT varChild, BSTR *pszValue)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if( pszValue == NULL )
+ {
+ return E_INVALIDARG;
+ }
+ if( varChild.vt==VT_I4 )
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ if(m_dState & STATE_SYSTEM_PROTECTED)
+ return E_ACCESSDENIED;
+
+ if ( m_pszValue !=NULL && wcslen(m_pszValue) == 0 )
+ return S_OK;
+
+ SAFE_SYSFREESTRING(*pszValue);
+ *pszValue = SysAllocString(m_pszValue);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accValue(varChild,pszValue);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible description of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszDescription, [in,out] use to return the description of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::get_accDescription(VARIANT varChild, BSTR *pszDescription)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszDescription == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ SAFE_SYSFREESTRING(*pszDescription);
+ *pszDescription = SysAllocString(m_pszDescription);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accDescription(varChild,pszDescription);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible role of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pvarRole, [in,out] use to return the role of the proper object.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accRole(VARIANT varChild, VARIANT *pvarRole)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarRole == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt == VT_I4)
+ {
+
+ if(varChild.lVal == CHILDID_SELF)
+ {
+ if( m_iRole < IA2_ROLE_CAPTION )
+ {
+ VariantInit(pvarRole);
+ pvarRole->vt = VT_I4;
+ pvarRole->lVal = m_iRole;
+ }
+ else
+ {
+ VariantInit(pvarRole);
+ pvarRole->vt = VT_I4;
+ pvarRole->lVal = ROLE_SYSTEM_CLIENT;
+ }
+ return S_OK;
+ }
+
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accRole(varChild,pvarRole);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible state of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pvarState, [in,out] use to return the state of the proper object.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accState(VARIANT varChild, VARIANT *pvarState)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarState == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal == CHILDID_SELF)
+ {
+ if(pUNOInterface)
+ {
+ Reference< XAccessibleContext > pContext = pUNOInterface->getAccessibleContext();
+ if(pContext.is())
+ {
+ // add the STATE_SYSTEM_LINKED state
+ Reference< XAccessibleHypertext > pRHypertext(pContext,UNO_QUERY);
+ if(pRHypertext.is())
+ {
+ if( pRHypertext->getHyperLinkCount() > 0 )
+ m_dState |= STATE_SYSTEM_LINKED;
+ else
+ m_dState &= ~STATE_SYSTEM_LINKED;
+ }
+ else
+ m_dState &= ~STATE_SYSTEM_LINKED;
+ }
+ }
+
+ VariantInit(pvarState);
+ pvarState->vt = VT_I4;
+ pvarState->lVal = m_dState;
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accState(varChild,pvarState);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the accessible helpString of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszHelp, [in,out] use to return the helpString of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::get_accHelp(VARIANT, BSTR *)
+{
+ return E_NOTIMPL;
+}
+
+/**
+* Returns the accessible HelpTopic of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszHelpFile, [in,out] use to return the HelpTopic of the proper object.
+* @param pidTopic, use to return the HelpTopic ID of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+* Not implemented yet
+*/
+STDMETHODIMP CMAccessible::get_accHelpTopic(BSTR *, VARIANT, long *)
+{
+ return E_NOTIMPL;
+}
+
+static void GetMnemonicChar( const ::rtl::OUString& aStr, WCHAR* wStr)
+{
+ int nLen = aStr.pData->length;
+ int i = 0;
+ WCHAR* text = aStr.pData->buffer;
+
+ while ( i < nLen )
+ {
+ if ( text[i] == L'~' )
+ if ( text[i+1] != L'~' )
+ {
+ wStr[0] = text[i+1];
+ break;
+ }
+ i++;
+ }
+}
+
+/**
+* Returns the accessible keyboard shortcut of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pszKeyboardShortcut, [in,out] use to return the kbshortcut of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKeyboardShortcut)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+
+ ISDESTROY()
+ // #CHECK#
+ if(pszKeyboardShortcut == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal == CHILDID_SELF)
+ {
+ if( pUNOInterface )
+ {
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ return S_FALSE;
+
+ Reference<XAccessibleAction> pRXI(pRContext,UNO_QUERY);
+
+ OLECHAR wString[64]={0};
+
+ if( pRXI.is() && pRXI->getAccessibleActionCount() >= 1)
+ {
+ Reference< XAccessibleKeyBinding > binding = pRXI->getAccessibleActionKeyBinding(0);
+ if( binding.is() )
+ {
+ long nCount = binding->getAccessibleKeyBindingCount();
+ if(nCount >= 1)
+ {
+ CAccAction::GetkeyBindingStrByXkeyBinding( binding->getAccessibleKeyBinding(0),wString );
+ }
+ }
+ }
+ if(wString[0] == 0)
+ {
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext->getAccessibleRelationSet();
+ if(!pRrelationSet.is())
+ {
+ return S_FALSE;
+ }
+
+ long nRelCount = pRrelationSet->getRelationCount();
+
+ // Modified by Steve Yin, for SODC_1552
+ if( /*nRelCount <= 0 &&*/ m_iRole == ROLE_SYSTEM_TEXT )
+ {
+ VARIANT varParentRole;
+ VariantInit( &varParentRole );
+
+ m_pIParent->get_accRole(varChild, &varParentRole);
+
+ if( m_pIParent && varParentRole.lVal == ROLE_SYSTEM_COMBOBOX ) // edit in comoboBox
+ {
+ m_pIParent->get_accKeyboardShortcut(varChild, pszKeyboardShortcut);
+ return S_OK;
+ }
+ }
+
+ AccessibleRelation *paccRelation = NULL;
+ AccessibleRelation accRelation;
+ for(int i=0; i<nRelCount ; i++)
+ {
+ if( pRrelationSet->getRelation(i).RelationType == 6 )
+ {
+ accRelation = pRrelationSet->getRelation(i);
+ paccRelation = &accRelation;
+ }
+ }
+
+ if(paccRelation == NULL)
+ return S_FALSE;
+
+ Sequence< Reference< XInterface > > xTargets = paccRelation->TargetSet;
+ Reference<XInterface> pRAcc = xTargets[0];
+
+ XAccessible* pXAcc = (XAccessible*)pRAcc.get();
+
+ Reference<XAccessibleContext> pRLebelContext = pXAcc->getAccessibleContext();
+ if(!pRLebelContext.is())
+ return S_FALSE;
+
+ pRrelationSet = pRLebelContext->getAccessibleRelationSet();
+ nRelCount = pRrelationSet->getRelationCount();
+
+ paccRelation = NULL;
+ for(int j=0; j<nRelCount ; j++)
+ {
+ if( pRrelationSet->getRelation(j).RelationType == 5 )
+ {
+ accRelation = pRrelationSet->getRelation(j);
+ paccRelation = &accRelation;
+ }
+ }
+
+ if(paccRelation)
+ {
+ xTargets = paccRelation->TargetSet;
+ pRAcc = xTargets[0];
+ if(pUNOInterface != (XAccessible*)pRAcc.get())
+ return S_FALSE;
+ }
+
+ Reference<XAccessibleExtendedComponent> pRXIE(pRLebelContext,UNO_QUERY);
+ if(!pRXIE.is())
+ return S_FALSE;
+
+ ::rtl::OUString ouStr = pRXIE->getTitledBorderText();
+ WCHAR key[2] = {NULL};
+ GetMnemonicChar(ouStr, key);
+ if(key[0] != 0)
+ {
+ wcscat(wString, L"Alt+");
+ wcscat(wString, key);
+ }
+ else
+ return S_FALSE;
+ }
+
+ SAFE_SYSFREESTRING(*pszKeyboardShortcut);
+ *pszKeyboardShortcut = SysAllocString(wString);
+
+ return S_OK;
+ }
+ else
+ {
+ return S_FALSE;
+ }
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+
+ return pChild->get_accKeyboardShortcut(varChild,pszKeyboardShortcut);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the current focused child to AT.
+* @param pvarChild, [in,out] vt member of pvarChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarChild == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if( m_dFocusChildID==UACC_NO_FOCUS )
+ {
+ pvarChild->vt = VT_EMPTY;//no focus on the object and its children
+ return S_OK;
+ }
+ //if the descendant of current object has focus indicated by m_dFocusChildID, return the IDispatch of this focused object
+ else
+ {
+ IMAccessible* pIMAcc = NULL;
+ g_pAgent->GetIAccessibleFromResID(m_dFocusChildID,&pIMAcc);
+ pIMAcc->AddRef();
+ pvarChild->vt = VT_DISPATCH;
+ pvarChild->pdispVal = pIMAcc;
+
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the selection of the current COM object to AT.
+* @param pvarChildren,[in,out]
+* if selection num is 0,return VT_EMPTY for vt,
+* if selection num is 1,return VT_I4 for vt,and child index for lVal
+* if selection num >1,return VT_UNKNOWN for vt, and IEnumVariant* for punkVal
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarChildren)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarChildren == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ switch(m_pEnumVar->GetCountOfElements())
+ {
+ case 0:
+ pvarChildren->vt = VT_EMPTY;
+ break;
+ case 1:
+ VARIANT varTmp[1];
+ ULONG count;
+ VariantInit(&varTmp[0]);
+ m_pEnumVar->Next(1,varTmp,&count);
+ if(count!=1)
+ return S_FALSE;
+ pvarChildren->vt = VT_I4;
+ pvarChildren->lVal = varTmp[0].lVal;
+ VariantClear(&varTmp[0]);
+ m_pEnumVar->Reset();
+ break;
+ default:
+ pvarChildren->vt = VT_UNKNOWN;
+ m_pEnumVar->AddRef();
+ pvarChildren->punkVal = m_pEnumVar;
+ break;
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the location of the current COM object self or its one child to AT.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param pxLeft, [in,out] use to return the x-coordination of the proper object.
+* @param pyTop, [in,out] use to return the y-coordination of the proper object.
+* @param pcxWidth, [in,out] use to return the x-coordination width of the proper object.
+* @param pcyHeight, [in,out] use to return the y-coordination height of the proper object.
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varChild)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pxLeft == NULL || pyTop == NULL || pcxWidth == NULL || pcyHeight == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+
+ if(pUNOInterface)
+ {
+ Reference< XAccessibleContext > pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ return S_FALSE;
+ Reference< XAccessibleComponent > pRComponent(pRContext,UNO_QUERY);
+ if( !pRComponent.is() )
+ return S_FALSE;
+
+ ::com::sun::star::awt::Point pCPoint = pRComponent->getLocationOnScreen();
+ ::com::sun::star::awt::Size pCSize = pRComponent->getSize();
+ *pxLeft = pCPoint.X;
+ *pyTop = pCPoint.Y;
+ *pcxWidth = pCSize.Width;
+ *pcyHeight = pCSize.Height;
+ return S_OK;
+ }
+ else
+ {
+ *pxLeft = m_sLocation.m_dLeft;
+ *pyTop = m_sLocation.m_dTop;
+ *pcxWidth = m_sLocation.m_dWidth;
+ *pcyHeight = m_sLocation.m_dHeight;
+ return S_OK;
+ }
+ }
+
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Returns the current focused child to AT.
+* @param navDir, the direction flag of the navigation.
+* @param varStart, the start child id of this navigation action.
+* @param pvarEndUpAt, [in,out] the end up child of this navigation action.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEndUpAt)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarEndUpAt == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ HRESULT ret = E_FAIL;
+ switch (navDir)
+ {
+ case NAVDIR_FIRSTCHILD:
+ ret = GetFirstChild(varStart,pvarEndUpAt);
+ break;
+ case NAVDIR_LASTCHILD:
+ ret = GetLastChild(varStart,pvarEndUpAt);
+ break;
+ case NAVDIR_NEXT:
+ ret = GetNextSibling(varStart,pvarEndUpAt);
+ break;
+ case NAVDIR_PREVIOUS:
+ ret = GetPreSibling(varStart,pvarEndUpAt);
+ break;
+ case NAVDIR_DOWN://do not implement temporarily
+ break;
+ case NAVDIR_UP://do not implement temporarily
+ break;
+ case NAVDIR_LEFT://do not implement temporarily
+ break;
+ case NAVDIR_RIGHT://do not implement temporarily
+ break;
+ default:
+ break;
+ };
+ return ret;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible::accHitTest(long xLeft, long yTop, VARIANT *pvarChild)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarChild == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ long x, y, w, h;
+ VARIANT varSelf;
+ VariantInit(&varSelf);
+ varSelf.vt = VT_I4;
+ varSelf.lVal = CHILDID_SELF;
+ accLocation(&x,&y,&w,&h,varSelf);
+ if( (x < xLeft && (x + w) >xLeft) && (y < yTop && (y + h) >yTop) )
+ {
+ int i, nCount;
+ pvarChild->vt = VT_EMPTY;
+ Reference< XAccessibleContext > pRContext = GetContextByXAcc(pUNOInterface);
+ nCount = pRContext->getAccessibleChildCount();
+ if(nCount > 256)
+ return E_FAIL;
+ IMAccessible* child = NULL;
+ for( i = 0; i<nCount; i++)
+ {
+
+ child = GetChildInterface(i + 1);
+ if(child && child->accHitTest(xLeft,yTop,pvarChild) == S_OK)
+ break;
+ }
+
+ if(pvarChild->vt == VT_DISPATCH)
+ return S_OK;
+
+ if( i < nCount)
+ {
+ pvarChild->vt = VT_DISPATCH;
+ pvarChild->pdispVal = child;
+ child->AddRef();
+ }
+ else
+ {
+ pvarChild->vt = VT_I4;
+ pvarChild->lVal = CHILDID_SELF;
+ }
+ return S_OK;
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Get The other Interface from CMAccessible.
+* @param guidService, must be IID_IAccessible here.
+* @param riid, the IID interface .
+* @return S_OK if successful and S_FALSE if failure.
+*/
+STDMETHODIMP CMAccessible::QueryService(REFGUID guidService, REFIID riid, void** ppvObject)
+{
+ if( InlineIsEqualGUID(guidService, IID_IAccessible) )
+ return QueryInterface(riid, ppvObject);
+ return S_FALSE;
+}
+
+/**
+* Set the accessible name of the current COM object self or its one child from UNO.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param szName, the name used to set the name of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::put_accName(VARIANT varChild, BSTR szName)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ SAFE_SYSFREESTRING(m_pszName);
+ m_pszName=SysAllocString(szName);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->put_accName(varChild,szName);
+ }
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set the accessible value of the current COM object self or its one child from UNO.
+* @param varChild, vt member of varChild must be VT_I4,and lVal member stores the child ID,
+* the child ID specify child index from 0 to children count, 0 stands for object self.
+* @param szValue, the value used to set the value of the proper object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::put_accValue(VARIANT varChild, BSTR szValue)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ SysAllocString(m_pszValue);
+ m_pszValue=SysAllocString(szValue);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->put_accValue(varChild,szValue);
+ }
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set the accessible name of the current COM object self from UNO.
+* @param pszName, the name value used to set the name of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccName(const OLECHAR __RPC_FAR *pszName)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszName == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ SAFE_SYSFREESTRING(m_pszName);//??
+ m_pszName = SysAllocString(pszName);
+ if(m_pszName==NULL)
+ return E_FAIL;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set the accessible role of the current COM object self from UNO.
+* @param pRole, the role value used to set the role of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccRole(unsigned short pRole)
+{
+ m_iRole = pRole;
+ return S_OK;
+}
+
+/**
+* Add one state into the current state set for the current COM object from UNO.
+* @param pXSate, the state used to set the name of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::DecreaseState(DWORD pXSate)
+{
+ m_dState &= (~pXSate);
+ return S_OK;
+}
+
+/**
+* Delete one state into the current state set for the current COM object from UNO.
+* @param pXSate, the state used to set the name of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::IncreaseState(DWORD pXSate)
+{
+ m_dState |= pXSate;
+ return S_OK;
+}
+
+/**
+* Set state into the current state set for the current COM object from UNO.
+* @param pXSate, the state used to set the name of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::SetState(DWORD pXSate)
+{
+ m_dState = pXSate;
+ return S_OK;
+}
+
+
+
+/**
+* Set the accessible description of the current COM object self from UNO.
+* @param pszDescription, the name used to set the description of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccDescription(const OLECHAR __RPC_FAR *pszDescription)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszDescription == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ SAFE_SYSFREESTRING(m_pszDescription);
+ m_pszDescription = SysAllocString(pszDescription);
+
+ if(m_pszDescription==NULL)
+ return E_FAIL;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set the accessible value of the current COM object self from UNO.
+* @param pszAccValue, the name used to set the value of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccValue(const OLECHAR __RPC_FAR *pszAccValue)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszAccValue == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ SAFE_SYSFREESTRING(m_pszValue);
+ m_pszValue = SysAllocString(pszAccValue);
+ if(m_pszValue==NULL)
+ return E_FAIL;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set the HWND value of the current COM object self from UNO. It should set the parent IAccessible
+* Object through the method AccessibleObjectFromWindow(...).
+* @param hwnd, the HWND used to set the value of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccWindowHandle(HWND hwnd)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ m_hwnd = hwnd;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Set accessible focus by specifying child ID
+* @param dChildID, the child id identifies the focus child.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccFocus(long dChildID)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+
+ if(dChildID==CHILDID_SELF)
+ {
+ if(m_pIParent)
+ {
+ m_pIParent->Put_XAccFocus(m_dChildID);
+ }
+ }
+ else
+ {
+ m_dFocusChildID = dChildID;
+ //traverse all ancestors to set the focused child ID so that when the get_accFocus is called on
+ //any of the ancestors, this id can be used to get the IAccessible of focused object.
+ if(m_pIParent)
+ {
+ m_pIParent->Put_XAccFocus(dChildID);
+ }
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+*Set accessible object location for the current COM object
+* @param sLocation, the location of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccLocation(const Location sLocation)
+{
+
+ this->m_sLocation = sLocation;
+ return S_OK;
+}
+
+/**
+* Set accessible parent object for the current COM object if
+* the current object is a child of some COM object
+* @param pIParent, the parent of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccParent(IMAccessible __RPC_FAR *pIParent)
+{
+ this->m_pIParent = pIParent;
+
+ if(pIParent)
+ m_pIParent->AddRef();
+
+ return S_OK;
+}
+
+/**
+* Set unique child id to COM
+* @param dChildID, the id of the current object.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccChildID(long dChildID)
+{
+
+ this->m_dChildID = dChildID;
+ return S_OK;
+}
+
+/**
+* Set AccObjectManagerAgent object pointer to COM
+* @param pAgent, the AccObjectManagerAgent point.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::Put_XAccAgent(long pAgent)
+{
+ g_pAgent = (AccObjectManagerAgent*)pAgent;
+ return S_OK;
+}
+
+/**
+* When a UNO control disposing, it disposes its listeners,
+* then notify AccObject in bridge management, then notify
+* COM that the XAccessible is invalid,so set pUNOInterface as NULL
+* @param isDestroy, true is it need to be destroyed.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+STDMETHODIMP CMAccessible::NotifyDestroy(BOOL isDestroy)
+{
+
+ m_isDestroy = isDestroy;
+ pUNOInterface = NULL;
+ return S_OK;
+}
+
+/**
+*private methods that help implement public functions
+*/
+
+/**
+* Return child interface pointer by child ID,note: need to call AddRef()
+* @param lChildID, specify child index,which AT(such as Inspect32) gives.
+* @return IMAccessible*, pointer to the corresponding child object.
+*/
+IMAccessible* CMAccessible::GetChildInterface(long dChildID)//for test
+{
+
+ long dChildIndex = 0;
+ if(dChildID<0)
+ {
+ if(g_pAgent)
+ {
+ IMAccessible* pIMAcc = NULL;
+ g_pAgent->GetIAccessibleFromResID(dChildID,&pIMAcc);
+ return pIMAcc;
+ }
+ return NULL;
+ }
+ else
+ {
+ Reference< XAccessibleContext > pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ return NULL;
+
+ if(dChildID<1 || dChildID>pRContext->getAccessibleChildCount())
+ return NULL;
+
+ IAccessible* pChild = NULL;
+ Reference< XAccessible > pXChild = pRContext->getAccessibleChild(dChildID-1);
+ BOOL isGet = get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild);
+
+ if(!isGet)
+ {
+ g_pAgent->InsertAccObj(pXChild.get(),pUNOInterface,(long)m_hwnd);
+ isGet = get_IAccessibleFromXAccessible((long)pXChild.get(),&pChild);
+ }
+
+ if(isGet)
+ {
+ IMAccessible* pIMAcc = (IMAccessible*)pChild;
+ return pIMAcc;
+ }
+ }
+
+ return NULL;
+}
+
+/**
+* For List, tree and table,these roles belong to manage_decendant in UNO,
+* need to process specifically when navigate
+* @return BOOL, if it is decendantmanager, return true.
+*/
+BOOL CMAccessible::IsDecendantManage()
+{
+
+ return (m_iRole==ROLE_SYSTEM_LIST)||(m_iRole==ROLE_SYSTEM_OUTLINE)||(m_iRole==ROLE_SYSTEM_TABLE);
+}
+
+/**
+* for decendantmanager circumstance,provide child interface when navigate
+* @param varCur, the current child.
+* @param flags, the navigation direction.
+* @return IMAccessible*, the child of the end up node.
+*/
+IMAccessible* CMAccessible::GetNavigateChildForDM(VARIANT varCur, short flags)
+{
+
+ XAccessibleContext* pXContext = GetContextByXAcc(pUNOInterface);
+ if(pXContext==NULL)
+ {
+ return NULL;
+ }
+
+ int count = pXContext->getAccessibleChildCount();
+ if(count<1)
+ {
+ return NULL;
+ }
+
+ IMAccessible* pCurChild = NULL;
+ XAccessible* pChildXAcc = NULL;
+ Reference<XAccessible> pRChildXAcc;
+ XAccessibleContext* pChildContext = NULL;
+ int index = 0,delta=0;
+ switch(flags)
+ {
+ case DM_FIRSTCHILD:
+ pRChildXAcc = pXContext->getAccessibleChild(0);
+ break;
+ case DM_LASTCHILD:
+ pRChildXAcc = pXContext->getAccessibleChild(count-1);
+ break;
+ case DM_NEXTCHILD:
+ case DM_PREVCHILD:
+ pCurChild = GetChildInterface(varCur.lVal);
+ if(pCurChild==NULL)
+ {
+ return NULL;
+ }
+ pCurChild->GetUNOInterface((long*)&pChildXAcc);
+ if(pChildXAcc==NULL)
+ {
+ return NULL;
+ }
+ pChildContext = GetContextByXAcc(pChildXAcc);
+ if(pChildContext == NULL)
+ {
+ return NULL;
+ }
+ delta = (flags==DM_NEXTCHILD)?1:-1;
+ //currently, getAccessibleIndexInParent is error in UNO for
+ //some kind of List,such as ValueSet, the index will be less 1 than
+ //what should be, need to fix UNO code
+ index = pChildContext->getAccessibleIndexInParent()+delta;
+ if((index>=0)&&(index<=count-1))
+ {
+ pRChildXAcc = pXContext->getAccessibleChild(index);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if(!pRChildXAcc.is())
+ {
+ return NULL;
+ }
+ pChildXAcc = pRChildXAcc.get();
+ g_pAgent->InsertAccObj(pChildXAcc,pUNOInterface);
+ return g_pAgent->GetIMAccByXAcc(pChildXAcc);
+}
+
+/**
+*the following 4 private methods are for accNavigate implementation
+*/
+
+/**
+* Return first child for parent container, process differently according
+* to whether it is decendant manage
+* @param varStart, the start child id of this navigation action.
+* @param pvarEndUpAt, [in,out] the end up child of this navigation action.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+HRESULT CMAccessible::GetFirstChild(VARIANT varStart,VARIANT* pvarEndUpAt)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarEndUpAt == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varStart.vt != VT_I4)
+ {
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_INVALIDARG;
+ }
+
+ pvarEndUpAt->pdispVal = GetNavigateChildForDM(varStart, DM_FIRSTCHILD);
+ if(pvarEndUpAt->pdispVal)
+ {
+ pvarEndUpAt->pdispVal->AddRef();
+ pvarEndUpAt->vt = VT_DISPATCH;
+ return S_OK;
+ }
+
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Return last child for parent container, process differently according
+* to whether it is decendant manage
+* @param varStart, the start child id of this navigation action.
+* @param pvarEndUpAt, [in,out] the end up child of this navigation action.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+HRESULT CMAccessible::GetLastChild(VARIANT varStart,VARIANT* pvarEndUpAt)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarEndUpAt == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varStart.vt != VT_I4)
+ {
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_INVALIDARG;
+ }
+
+ pvarEndUpAt->pdispVal = GetNavigateChildForDM(varStart, DM_LASTCHILD);
+ if(pvarEndUpAt->pdispVal)
+ {
+ pvarEndUpAt->pdispVal->AddRef();
+ pvarEndUpAt->vt = VT_DISPATCH;
+ return S_OK;
+ }
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* The method GetNextSibling is general, whatever it is decendant manage or not
+* Get the next sibling object.
+* @param varStart, the start child id of this navigation action.
+* @param pvarEndUpAt, [in,out] the end up child of this navigation action.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+HRESULT CMAccessible::GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(varStart.vt != VT_I4)
+ {
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_INVALIDARG;
+ }
+
+ Reference< XAccessibleContext > pRContext = GetContextByXAcc(pUNOInterface);
+ if(pRContext.is())
+ {
+ varStart.iVal = sal_Int16(pRContext->getAccessibleIndexInParent() + 2);
+ if(m_pIParent)
+ if( m_pIParent->get_accChild(varStart,&pvarEndUpAt->pdispVal) == S_OK)
+ {
+ pvarEndUpAt->vt = VT_DISPATCH;
+ return S_OK;
+ }
+ }
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+*the method GetPreSibling is general, whatever it is decendant manage or not
+* @param varStart, the start child id of this navigation action.
+* @param pvarEndUpAt, [in,out] the end up child of this navigation action.
+* @return S_OK if successful and E_FAIL if failure.
+*/
+HRESULT CMAccessible::GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pvarEndUpAt == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varStart.vt != VT_I4)
+ {
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_INVALIDARG;
+ }
+
+ Reference< XAccessibleContext > pRContext = GetContextByXAcc(pUNOInterface);
+ if(pRContext.is())
+ {
+ varStart.iVal = sal_Int16(pRContext->getAccessibleIndexInParent());
+ if(m_pIParent && varStart.iVal > 0)
+ if( m_pIParent->get_accChild(varStart,&pvarEndUpAt->pdispVal) == S_OK)
+ {
+ pvarEndUpAt->vt = VT_DISPATCH;
+ return S_OK;
+ }
+ }
+ pvarEndUpAt->vt = VT_EMPTY;
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* For IAccessible2 implementation methods
+*/
+STDMETHODIMP CMAccessible::get_nRelations( long __RPC_FAR *nRelations)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(nRelations == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ *nRelations = 0;
+
+ if( !pRContext.is() )
+ return E_FAIL;
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet();
+ if(!pRrelationSet.is())
+ {
+ *nRelations = 0;
+ return S_OK;
+ }
+
+ *nRelations = pRrelationSet->getRelationCount();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible::get_relation( long relationIndex, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(relation == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ if( !pRContext.is() )
+ return E_FAIL;
+
+
+ long nMax = 0;
+ long nReal = 0;
+ get_nRelations(&nMax);
+
+ *relation = (IAccessibleRelation*)::CoTaskMemAlloc(sizeof(IAccessibleRelation));
+
+ // #CHECK Memory Allocation#
+ if(*relation == NULL)
+ {
+ return E_FAIL;
+ }
+
+ if( relationIndex < nMax )
+ {
+
+
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet();
+ if(!pRrelationSet.is())
+ {
+
+ return E_FAIL;
+ }
+
+ IAccessibleRelation* pRelation = NULL;
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance( CLSID_AccRelation, NULL, CLSCTX_SERVER ,
+ IID_IAccessibleRelation,
+ (void **)&pRelation);
+ DeactivateActContext();
+ if(SUCCEEDED(hr))
+ {
+ IUNOXWrapper* wrapper = NULL;
+ hr = pRelation->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
+ if(SUCCEEDED(hr))
+ {
+ AccessibleRelation accRelation = pRrelationSet->getRelation(relationIndex);
+ wrapper->put_XSubInterface((long)&accRelation);
+ wrapper->Release();
+ *relation = pRelation;
+ return S_OK;
+ }
+
+ }
+ }
+
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible::get_relations( long, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation, long __RPC_FAR *nRelations)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(relation == NULL || nRelations == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ // #CHECK XInterface#
+
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext.get()->getAccessibleRelationSet();
+ if(!pRrelationSet.is())
+ {
+ *nRelations = 0;
+ return S_OK;
+ }
+
+ long nCount = pRrelationSet->getRelationCount();
+
+ *relation = (IAccessibleRelation*)::CoTaskMemAlloc(nCount*sizeof(IAccessibleRelation));
+
+ // #CHECK Memory Allocation#
+ if(*relation == NULL)
+ {
+ return E_FAIL;
+ }
+
+ for(int i=0; i<nCount ; i++)
+ {
+ IAccessibleRelation* pRelation = NULL;
+ ActivateActContext();
+ HRESULT hr = CoCreateInstance( CLSID_AccRelation, NULL, CLSCTX_SERVER ,
+ IID_IAccessibleRelation,
+ (void **)&pRelation);
+ DeactivateActContext();
+ if(SUCCEEDED(hr))
+ {
+ IUNOXWrapper* wrapper = NULL;
+ hr = pRelation->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
+ if(SUCCEEDED(hr))
+ {
+ AccessibleRelation accRelation = pRrelationSet->getRelation(i);
+ wrapper->put_XSubInterface((long)&accRelation);
+ wrapper->Release();
+ }
+ (relation)[i] = pRelation;
+ }
+ }
+
+ *nRelations = nCount;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible::role(long __RPC_FAR *role)
+{
+ ENTER_PROTECTED_BLOCK
+
+ (*role) = m_iRole;
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+STDMETHODIMP CMAccessible:: get_nActions(long __RPC_FAR *nActions)
+{
+
+ try
+ {
+ ISDESTROY()
+ // #CHECK#
+ if(nActions == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ *nActions = 0L;
+ IAccessibleAction* pAcc = NULL;
+ HRESULT hr = QueryInterface(IID_IAccessibleAction, (void**)&pAcc);
+ if( hr == S_OK )
+ {
+ pAcc->nActions(nActions);
+ pAcc->Release();
+ }
+
+ return S_OK;
+ }
+ catch(...)
+ {
+ *nActions = 0L;
+ return S_OK;
+ }
+}
+
+
+STDMETHODIMP CMAccessible:: scrollToPoint(enum IA2CoordinateType, long, long)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ return E_NOTIMPL;
+ LEAVE_PROTECTED_BLOCK
+
+}
+STDMETHODIMP CMAccessible:: scrollTo(enum IA2ScrollType)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+static XAccessible* getTheParentOfMember(XAccessible* pXAcc)
+{
+ // #CHECK#
+ if(pXAcc == NULL)
+ {
+ return NULL;
+ }
+ Reference<XAccessibleContext> pRContext = pXAcc->getAccessibleContext();
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext->getAccessibleRelationSet();
+ long nRelations = pRrelationSet->getRelationCount();
+ for(int i=0 ; i<nRelations ; i++)
+ {
+ AccessibleRelation accRelation = pRrelationSet->getRelation(i);
+ if(accRelation.RelationType == 7)
+ {
+ Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet;
+ return (XAccessible*)xTargets[0].get();
+ }
+ }
+ return NULL;
+}
+
+STDMETHODIMP CMAccessible:: get_groupPosition(long __RPC_FAR *groupLevel,long __RPC_FAR *similarItemsInGroup,long __RPC_FAR *positionInGroup)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(groupLevel == NULL || similarItemsInGroup == NULL || positionInGroup == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if(!pRContext.is())
+ return E_FAIL;
+ long Role = pRContext->getAccessibleRole();
+
+ *groupLevel = 0;
+ *similarItemsInGroup = 0;
+ *positionInGroup = 0;
+
+ if (Role != AccessibleRole::DOCUMENT)
+ {
+ Reference< XAccessibleGroupPosition > xGroupPosition( pRContext, UNO_QUERY );
+ if ( xGroupPosition.is() )
+ {
+ Sequence< sal_Int32 > rSeq = xGroupPosition->getGroupPosition( makeAny( pRContext ) );
+ sal_Int32* pSeq = rSeq.getArray();
+ if ( pSeq )
+ {
+ *groupLevel = pSeq[0];
+ *similarItemsInGroup = pSeq[1];
+ *positionInGroup = pSeq[2];
+ return S_OK;
+ }
+ return S_OK;
+ }
+ }
+
+ Reference< XAccessible> pParentAcc = pRContext->getAccessibleParent();
+ if( !pParentAcc.is() )
+ {
+ return S_OK;
+ }
+
+ Reference<XAccessibleContext> pRParentContext = pParentAcc->getAccessibleContext();
+
+ int level = 0;
+ int index = 0;
+ int number = 0;
+
+ if( Role == RADIO_BUTTON )
+ {
+ Reference<XAccessibleRelationSet> pRrelationSet = pRContext->getAccessibleRelationSet();
+ long nRel = pRrelationSet->getRelationCount();
+ for(int i=0 ; i<nRel ; i++)
+ {
+ AccessibleRelation accRelation = pRrelationSet->getRelation(i);
+ if(accRelation.RelationType == 7)
+ {
+ Sequence< Reference< XInterface > > xTargets = accRelation.TargetSet;
+ int nCount = xTargets.getLength();
+
+ Reference<XInterface> pRAcc = xTargets[0];
+ for(int j=0; j<pRParentContext->getAccessibleChildCount(); j++)
+ {
+ if( getTheParentOfMember(pRParentContext->getAccessibleChild(j).get())
+ == (XAccessible*)pRAcc.get() &&
+ pRParentContext->getAccessibleChild(j)->getAccessibleContext()->getAccessibleRole() == RADIO_BUTTON)
+ number++;
+ if(pRParentContext->getAccessibleChild(j).get() == pUNOInterface)
+ index = number;
+ }
+ }
+ }
+ *groupLevel = 1;
+ *similarItemsInGroup = number;
+ *positionInGroup = index;
+ return S_OK;
+ }
+
+ else if ( COMBO_BOX == Role )
+ {
+ *groupLevel = 1;
+ *similarItemsInGroup = 0;
+ *positionInGroup = -1;
+
+ long nCount = pRContext->getAccessibleChildCount();
+ if( 2 != nCount)
+ {
+ return S_OK;
+ }
+ Reference<XAccessible> xList=pRContext->getAccessibleChild(1);
+ if (!xList.is())
+ {
+ return S_OK;
+ }
+ Reference<XAccessibleContext> xListContext(xList,UNO_QUERY);
+ if (!xListContext.is())
+ {
+ return S_OK;
+ }
+ Reference<XAccessibleSelection> xListSel(xList,UNO_QUERY);
+ if (!xListSel.is())
+ {
+ return S_OK;
+ }
+ *similarItemsInGroup = xListContext->getAccessibleChildCount();
+ if (*similarItemsInGroup > 0 )
+ {
+ try
+ {
+ Reference<XAccessible> xChild = xListSel->getSelectedAccessibleChild(0);
+ if (xChild.is())
+ {
+ Reference<XAccessibleContext> xChildContext(xChild,UNO_QUERY);
+ if (xChildContext.is())
+ {
+ *positionInGroup=xChildContext->getAccessibleIndexInParent() + 1 ;
+ return S_OK;
+ }
+ }
+ }
+ catch(...)
+ {}
+ }
+ return S_OK;
+ }
+ else if ( PAGE_TAB == Role )
+ {
+ *groupLevel = 1;
+ *similarItemsInGroup = pRParentContext->getAccessibleChildCount();
+
+ if (*similarItemsInGroup > 0 )
+ {
+ *positionInGroup=pRContext->getAccessibleIndexInParent() + 1 ;
+ }
+ else
+ {
+ *positionInGroup = -1;
+ }
+ return S_OK;
+ }
+
+
+ BOOL isFound = FALSE;
+ while( pParentAcc.is() && !isFound)
+ {
+ level++;
+ pRParentContext = pParentAcc->getAccessibleContext();
+ Role = pRParentContext->getAccessibleRole();
+ if( (Role == TREE) || (Role == LIST) )
+ isFound = TRUE;
+ pParentAcc = pRParentContext->getAccessibleParent();
+ }
+
+ if( isFound )
+ {
+ Reference< XAccessible> pTempAcc = pRContext->getAccessibleParent();
+ pRParentContext = pTempAcc->getAccessibleContext();
+ *groupLevel = level;
+ *similarItemsInGroup = pRParentContext->getAccessibleChildCount();
+ *positionInGroup = pRContext->getAccessibleIndexInParent() + 1;
+ }
+ else
+ {
+ *groupLevel = 0;
+ *similarItemsInGroup = 0;
+ *positionInGroup = 0;
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible:: get_extendedStates( long, BSTR __RPC_FAR *__RPC_FAR *, long __RPC_FAR *)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+STDMETHODIMP CMAccessible:: get_uniqueID(long __RPC_FAR *uniqueID)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(uniqueID == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ *uniqueID = m_dChildID;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible:: get_windowHandle(HWND __RPC_FAR *windowHandle)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(windowHandle == NULL)
+ {
+ return E_INVALIDARG;
+ }
+
+ HWND nHwnd = m_hwnd;
+ IAccessible* pParent = m_pIParent;
+ CMAccessible* pChild = this;
+ while((nHwnd==0) && pParent)
+ {
+ pChild = (CMAccessible*)pParent;
+ if(pChild)
+ {
+ pParent = (IAccessible*)pChild->m_pIParent;
+ nHwnd = (HWND)pChild->m_hwnd;
+ }
+ else
+ pParent = NULL;
+ }
+
+ *windowHandle = nHwnd;
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Get XAccessibleContext directly from UNO by the stored XAccessible pointer
+* @param pXAcc, UNO XAccessible object point.
+* @return XAccessibleContext*, the context of the pXAcc.
+*/
+XAccessibleContext* CMAccessible::GetContextByXAcc( XAccessible* pXAcc )
+{
+ Reference< XAccessibleContext > pRContext;
+ if( pXAcc == NULL)
+ return NULL;
+
+ pRContext = pXAcc->getAccessibleContext();
+ if( !pRContext.is() )
+ return NULL;
+ return pRContext.get();
+}
+
+/**
+* Return the member variable m_pXAccessibleSelection, instead of
+* get XAccessibleSelection according to XAccessibleContext because if so,it will
+* depend on the UNO implementation code,so when COM is created, put XAccessibleSelection
+* by bridge management system
+* @return XAccessibleSelection*, the selection of the current object.
+*/
+Reference< XAccessibleSelection > CMAccessible::GetSelection()
+{
+ if( pUNOInterface == NULL )
+ return NULL;
+ Reference< XAccessibleContext > pRContext = pUNOInterface->getAccessibleContext();
+ if(pRContext.is())
+ {
+ Reference< XAccessibleSelection > pRSelection(pRContext,UNO_QUERY);
+ return pRSelection;
+ }
+ return NULL;
+}
+
+/**
+* Select one XAccessible item, for accSelect implementation
+* @param pItem, the item should be selected.
+* @return S_OK if successful.
+*/
+HRESULT CMAccessible::SelectChild(XAccessible* pItem)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ XAccessibleContext* pParentContext = GetContextByXAcc( pUNOInterface );
+ XAccessibleContext* pContext = GetContextByXAcc( pItem );
+ if( pParentContext == NULL || pContext == NULL )
+ return E_FAIL;
+
+ Reference< XAccessibleSelection > pRSelection = GetSelection();
+ if( !pRSelection.is() )
+ return E_FAIL;
+ long Index = pContext->getAccessibleIndexInParent();
+ pRSelection->selectAccessibleChild( Index );
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Deselect one XAccessible item, for accSelect implimentation
+* @param pItem, the item should be deselected.
+* @return S_OK if successful.
+*/
+HRESULT CMAccessible::DeSelectChild(XAccessible* pItem)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ XAccessibleContext* pParentContext = GetContextByXAcc( pUNOInterface );
+ ;
+ XAccessibleContext* pContext = GetContextByXAcc( pItem );
+ if( pParentContext == NULL || pContext == NULL )
+ return E_INVALIDARG;
+
+ Reference< XAccessibleSelection > pRSelection = GetSelection();
+ if( !pRSelection.is() )
+ return E_FAIL;
+ long Index = pContext->getAccessibleIndexInParent();
+ pRSelection->deselectAccessibleChild( Index );
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Select multiple XAccessible items,for implementation of accSelect
+* @param pItem, the items should be selected.
+* @param size, the size of the items.
+* @return S_OK if successful.
+*/
+HRESULT CMAccessible::SelectMutipleChidren( XAccessible** pItem,int size )
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pItem == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ for(int index = 0;index < size;index++)
+ {
+ SelectChild( pItem[index] );
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Deselect multiple XAccessible items,for implementation of accSelect
+* @param pItem, the items should be selected.
+* @param size, the size of the items.
+* @return S_OK if successful.
+*/
+HRESULT CMAccessible::DeSelectMutipleChildren( XAccessible** pItem,int size )
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pItem == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ for(int index = 0;index < size;index++)
+ {
+ DeSelectChild( pItem[index] );
+ }
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* When COM is created, UNO set XAccessible pointer to it
+* in order to COM can operate UNO information
+* @param pXAcc, the XAccessible object of current object.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::SetXAccessible(long pXAcc)
+{
+ pUNOInterface = (XAccessible*)pXAcc;
+ pRef = pUNOInterface;
+ m_pEnumVar->PutSelection(/*XAccessibleSelection*/(long)pUNOInterface);
+
+ pRContext = pUNOInterface->getAccessibleContext();
+ pRContextInterface = (XAccessibleContext*)pRContext.is();
+
+ return S_OK;
+}
+
+/**
+* accSelect method has many optional flags, needs to process comprehensively
+* Mozilla and Microsoft do not implement SELFLAG_EXTENDSELECTION flag.
+* The implementation of this flag is a little trouble-shooting,so we also
+* do not implement it now
+* @param flagsSelect, the selection flag of the select action.
+* @param varChild, the child object pointer of current action.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::accSelect(long flagsSelect, VARIANT varChild)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if( (flagsSelect&SELFLAG_ADDSELECTION) &&
+ (SELFLAG_REMOVESELECTION&flagsSelect) )
+ return E_INVALIDARG;
+
+ if ( (flagsSelect&SELFLAG_TAKESELECTION) &&
+ (
+ (flagsSelect&SELFLAG_ADDSELECTION) ||
+ (flagsSelect&SELFLAG_REMOVESELECTION) ||
+ (flagsSelect&SELFLAG_EXTENDSELECTION )
+ )
+ )
+ return E_INVALIDARG;
+
+ if ( varChild.vt != VT_I4 )
+ return E_INVALIDARG;
+
+ IMAccessible* pSelectAcc;
+ if( varChild.lVal == CHILDID_SELF )
+ {
+ pSelectAcc = this;
+ pSelectAcc->AddRef();
+ }
+ else
+ {
+ pSelectAcc = GetChildInterface(varChild.lVal);
+ }
+
+ if( pSelectAcc == NULL )
+ return E_INVALIDARG;
+
+ if( flagsSelect&SELFLAG_TAKEFOCUS )
+ {
+ long pTempUNO = 0;
+ pSelectAcc->GetUNOInterface( &pTempUNO);
+
+ if( pTempUNO == NULL )
+ return NULL;
+
+ Reference< XAccessibleContext > pRContext = ( (XAccessible*)pTempUNO)->getAccessibleContext();
+ Reference< XAccessibleComponent > pRComponent(pRContext,UNO_QUERY);
+ Reference< XAccessible > pRParentXAcc = pRContext->getAccessibleParent();
+ Reference< XAccessibleContext > pRParentContext = pRParentXAcc->getAccessibleContext();
+ Reference< XAccessibleComponent > pRParentComponent(pRParentContext,UNO_QUERY);
+ Reference< XAccessibleSelection > pRParentSelection(pRParentContext,UNO_QUERY);
+
+
+ pRComponent->grabFocus();
+
+ if( flagsSelect & SELFLAG_TAKESELECTION )
+ {
+ pRParentSelection->clearAccessibleSelection();
+ pRParentSelection->selectAccessibleChild( pRContext->getAccessibleIndexInParent() );
+ }
+
+ if( flagsSelect & SELFLAG_ADDSELECTION )
+ {
+ pRParentSelection->selectAccessibleChild( pRContext->getAccessibleIndexInParent() );
+ }
+
+ if( flagsSelect & SELFLAG_REMOVESELECTION )
+ {
+ pRParentSelection->deselectAccessibleChild( pRContext->getAccessibleIndexInParent() );
+ }
+
+ if( flagsSelect & SELFLAG_EXTENDSELECTION )
+ {
+ long indexInParrent = pRContext->getAccessibleIndexInParent();
+
+ if( pRParentSelection->isAccessibleChildSelected( indexInParrent + 1 ) ||
+ pRParentSelection->isAccessibleChildSelected( indexInParrent - 1 ) )
+ {
+ pRParentSelection->selectAccessibleChild( indexInParrent );
+ }
+ }
+
+ }
+
+ pSelectAcc->Release();
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* Return XAccessible interface pointer when needed
+* @param pXAcc, [in, out] the Uno interface of the current object.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::GetUNOInterface(long* pXAcc)
+{
+ // #CHECK#
+ if(pXAcc == NULL)
+ return E_INVALIDARG;
+
+ *pXAcc = (long)pUNOInterface;
+ return S_OK;
+}
+
+/**
+* Helper method for Implementation of get_accDefaultAction
+* @param pAction, the default action point of the current object.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::SetDefaultAction(long pAction)
+{
+ m_pXAction = (XAccessibleAction*)pAction;
+ return S_OK;
+}
+
+/**
+* This method is called when AT open some UI elements initially
+* the UI element takes the default action defined here
+* @param varChild, the child id of the defaultaction.
+* @param pszDefaultAction,[in/out] the description of the current action.
+* @return S_OK if successful.
+*/
+HRESULT STDMETHODCALLTYPE CMAccessible::get_accDefaultAction(VARIANT varChild, BSTR *pszDefaultAction)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(pszDefaultAction == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ if(varChild.vt==VT_I4)
+ {
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ if( m_pXAction == NULL )
+ return DISP_E_MEMBERNOTFOUND;
+ SAFE_SYSFREESTRING(*pszDefaultAction);
+ *pszDefaultAction = SysAllocString(m_pszActionDescription);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->get_accDefaultAction(varChild,pszDefaultAction);
+ }
+ return S_FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* AT call this method to operate application
+* @param varChild, the child id of the action object.
+* @return S_OK if successful.
+*/
+HRESULT STDMETHODCALLTYPE CMAccessible::accDoDefaultAction(VARIANT varChild)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if( varChild.vt != VT_I4 )
+ return E_INVALIDARG;
+ if( m_pXAction == NULL )
+ return E_FAIL;
+ if( m_pXAction->getAccessibleActionCount() == 0 )
+ return E_FAIL;
+
+ if(varChild.lVal==CHILDID_SELF)
+ {
+ if(m_pXAction->getAccessibleActionCount() > 0)
+ m_pXAction->doAccessibleAction(0);
+ return S_OK;
+ }
+
+ long lVal = varChild.lVal;
+ varChild.lVal = CHILDID_SELF;
+ IMAccessible *pChild = this->GetChildInterface(lVal);
+ if(!pChild)
+ return E_FAIL;
+ return pChild->accDoDefaultAction( varChild );
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+/**
+* UNO set description information for action to COM.
+* @param szAction, the action description of the current object.
+* @return S_OK if successful.
+*/
+STDMETHODIMP CMAccessible::Put_ActionDescription( const OLECHAR* szAction)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(szAction == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ SAFE_SYSFREESTRING(m_pszActionDescription );
+ m_pszActionDescription = SysAllocString( szAction );
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+BOOL CMAccessible::GetXInterfaceFromXAccessible(XAccessible* pXAcc, XInterface** ppXI, int index)
+{
+ Reference< XAccessibleContext > pRContext;
+
+ switch(index)
+ {
+ case XI_COMPONENT:
+ QUERYXINTERFACE(AccessibleComponent)
+ break;
+ case XI_TEXT:
+ QUERYXINTERFACE(AccessibleText)
+ break;
+ case XI_EDITABLETEXT:
+ QUERYXINTERFACE(AccessibleEditableText)
+ break;
+ case XI_TABLE:
+ QUERYXINTERFACE(AccessibleTable)
+ break;
+ case XI_SELECTION:
+ QUERYXINTERFACE(AccessibleSelection)
+ break;
+ case XI_EXTENDEDCOMP:
+ QUERYXINTERFACE(AccessibleExtendedComponent)
+ break;
+ case XI_KEYBINDING:
+ QUERYXINTERFACE(AccessibleKeyBinding)
+ break;
+ case XI_ACTION:
+ QUERYXINTERFACE(AccessibleAction)
+ break;
+ case XI_VALUE:
+ QUERYXINTERFACE(AccessibleValue)
+ break;
+ case XI_HYPERTEXT:
+ QUERYXINTERFACE(AccessibleHypertext)
+ break;
+ case XI_HYPERLINK:
+ QUERYXINTERFACE(AccessibleHyperlink)
+ break;
+ case XI_IMAGE:
+ QUERYXINTERFACE(AccessibleImage)
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+HRESULT WINAPI CMAccessible::SmartQI(void* pv, REFIID iid, void** ppvObject)
+{
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if( ImplIsEqualGUID(iid,IID_IAccIdentity) ||
+ ImplIsEqualGUID(iid,IID_IStdMarshalInfo) ||
+ ImplIsEqualGUID(iid,IID_IMarshal) ||
+ ImplIsEqualGUID(iid,IID_IExternalConnection)||
+ ImplIsEqualGUID(iid,IID_IOleWindow))
+ return E_FAIL;
+
+
+ _UNO_AGGMAP_ENTRY* pMap = _GetAggEntries();
+ while(pMap && pMap->piid)
+ {
+ if(ImplIsEqualGUID(iid, *pMap->piid))
+ {
+ XInterface* pXI = NULL;
+ BOOL bFound = GetXInterfaceFromXAccessible(pUNOInterface,&pXI,pMap->XIFIndex);
+ if(!bFound)
+ {
+ return E_FAIL;
+ }
+
+ XGUIDToComObjHash::iterator pIndTemp = m_containedObjects.find( iid );
+ if ( pIndTemp != m_containedObjects.end() )
+ {
+ return pIndTemp->second.p->QueryInterface( iid, ppvObject );
+ }
+ else
+ {
+ ActivateActContext();
+ HRESULT hr = pMap->pfnCreateInstance(pv, iid, ppvObject);
+ DeactivateActContext();
+ if(hr == S_OK)
+ {
+ m_containedObjects.insert(XGUIDToComObjHash::value_type(*pMap->piid,(IUnknown*)*ppvObject));
+ IUNOXWrapper* wrapper = NULL;
+ ((IUnknown*)*ppvObject)->QueryInterface(IID_IUNOXWrapper, (void**)&wrapper);
+ if(wrapper)
+ {
+ wrapper->put_XInterface((long)pUNOInterface);
+ wrapper->Release();
+ }
+ return S_OK;
+ }
+ }
+ return E_FAIL;
+ }
+ pMap++;
+ }
+ return E_FAIL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+BOOL CMAccessible::get_IAccessibleFromXAccessible(long pXAcc, IAccessible **ppIA)
+{
+
+ ENTER_PROTECTED_BLOCK
+
+ // #CHECK#
+ if(ppIA == NULL)
+ {
+ return E_INVALIDARG;
+ }
+ BOOL isGet = FALSE;
+ if(g_pAgent)
+ isGet = g_pAgent->GetIAccessibleFromXAccessible((XAccessible*)pXAcc,ppIA);
+
+ if(isGet)
+ return TRUE;
+ else
+ return FALSE;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+void CMAccessible::get_OLECHARFromAny(Any& pAny, OLECHAR* pChar)
+{
+ // #CHECK#
+ if(pChar == NULL)
+ return;
+
+ switch(pAny.getValueTypeClass())
+ {
+ case TypeClass_CHAR:
+ {
+ sal_Int8 val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ break;
+ }
+ case TypeClass_BOOLEAN:
+ {
+ sal_Bool val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ break;
+ }
+ case TypeClass_BYTE:
+ {
+ sal_Int8 val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ break;
+ }
+ case TypeClass_SHORT:
+ {
+ SHORT val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ break;
+ }
+ case TypeClass_UNSIGNED_SHORT:
+ {
+ USHORT val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ break;
+ }
+ case TypeClass_LONG:
+ {
+ LONG val;
+ pAny >>= val;
+ swprintf( pChar, L"%ld", val);
+ break;
+ }
+ case TypeClass_UNSIGNED_LONG:
+ {
+ ULONG val;
+ pAny >>= val;
+ swprintf( pChar, L"%ld", val);
+ break;
+ }
+ case TypeClass_FLOAT:
+ {
+ FLOAT val;
+ pAny >>= val;
+ swprintf( pChar, L"%.3f", val);
+ break;
+ }
+ case TypeClass_DOUBLE:
+ {
+ DOUBLE val;
+ pAny >>= val;
+ swprintf( pChar, L"%.6lf", val);
+ break;
+ }
+ case TypeClass_STRING:
+ {
+ ::rtl::OUString val;
+ pAny >>= val;
+ wcscpy(pChar, val.getStr());
+ break;
+ }
+ case TypeClass_SEQUENCE:
+ {
+ if(pAny.getValueType() == getCppuType( (Sequence< ::rtl::OUString > *)0 ) )
+ {
+ Sequence < ::rtl::OUString > val;
+ pAny >>= val;
+
+ ::rtl::OUString pString;
+
+ int count = val.getLength();
+
+ for( int iIndex = 0;iIndex < count;iIndex++ )
+ {
+ pString += val[iIndex];
+ }
+ wcscpy(pChar, pString.getStr());
+ }
+ else if (pAny.getValueType() == getCppuType( (Sequence< ::com::sun::star::style::TabStop >* )0 ) )
+ {
+ Sequence < ::com::sun::star::style::TabStop > val;
+ pAny >>= val;
+ int count = val.getLength();
+
+ for( int iIndex = 0;iIndex < count;iIndex++ )
+ {
+ OLECHAR pAttrs[512] = {NULL};
+
+ OLECHAR pAttrsPosition[512] = {NULL};
+ OLECHAR pAttrsDescimalChar[512] = {NULL};
+ OLECHAR pAttrsFillChar[512] = {NULL};
+
+ ::com::sun::star::style::TabStop sigleVal = val[iIndex];
+
+ swprintf( pAttrsPosition, L"Position=%ld,TabAlign=%ld",
+ sigleVal.Position, sigleVal.Alignment);
+
+ if(sigleVal.DecimalChar==';' || sigleVal.DecimalChar == ':' || sigleVal.DecimalChar == ',' ||
+ sigleVal.DecimalChar == '=' || sigleVal.DecimalChar == '\\')
+ swprintf( pAttrsDescimalChar, L"DecimalChar=\\%c",sigleVal.DecimalChar);
+ else
+ swprintf( pAttrsDescimalChar, L"DecimalChar=%c",sigleVal.DecimalChar);
+
+ if(sigleVal.FillChar==';' || sigleVal.FillChar == ':' || sigleVal.FillChar == ',' ||
+ sigleVal.FillChar == '=' || sigleVal.FillChar == '\\')
+ swprintf( pAttrsFillChar, L"FillChar=\\%c",sigleVal.FillChar);
+ else
+ swprintf( pAttrsFillChar, L"FillChar=%c",sigleVal.FillChar);
+
+ swprintf( pAttrs, L"%s,%s,%s,",pAttrsPosition,pAttrsDescimalChar,pAttrsFillChar);
+
+ wcscat(pChar,pAttrs);
+ }
+ }
+ break;
+ }
+ case TypeClass_ENUM:
+ {
+ if (pAny.getValueType() == getCppuType( (::com::sun::star::awt::FontSlant* )0 ) )
+ {
+ com::sun::star::awt::FontSlant val;
+ pAny >>= val;
+ swprintf( pChar, L"%d", val);
+ }
+ }
+ case TypeClass_STRUCT:
+ {
+ if (pAny.getValueType() == getCppuType( (::com::sun::star::style::LineSpacing* )0 ) )
+ {
+ com::sun::star::style::LineSpacing val;
+ pAny >>= val;
+ swprintf( pChar, L"Mode=%ld,Height=%ld,", val.Mode, val.Height);
+ }
+ else if (pAny.getValueType() == getCppuType( (com::sun::star::accessibility::TextSegment *)0 ) )
+ {
+ com::sun::star::accessibility::TextSegment val;
+ pAny >>= val;
+ ::rtl::OUString realVal(val.SegmentText);
+ wcscpy(pChar, realVal.getStr());
+ }
+ break;
+ }
+ case TypeClass_VOID:
+ case TypeClass_HYPER:
+ case TypeClass_UNSIGNED_HYPER:
+ case TypeClass_TYPE:
+ case TypeClass_ANY:
+ case TypeClass_TYPEDEF:
+ case TypeClass_UNION:
+ case TypeClass_EXCEPTION:
+ case TypeClass_ARRAY:
+ case TypeClass_INTERFACE:
+ case TypeClass_SERVICE:
+ case TypeClass_MODULE:
+ case TypeClass_INTERFACE_METHOD:
+ case TypeClass_INTERFACE_ATTRIBUTE:
+ case TypeClass_UNKNOWN:
+ case TypeClass_PROPERTY:
+ case TypeClass_CONSTANT:
+ case TypeClass_CONSTANTS:
+ case TypeClass_SINGLETON:
+ case TypeClass_MAKE_FIXED_SIZE:
+ break;
+ default:
+ break;
+ }
+}
+
+void CMAccessible::get_OLECHAR4Numbering(const Any& pAny, short numberingLevel,const OUString& numberingPrefix,OLECHAR* pChar)
+{
+ if(pChar == NULL)
+ return;
+ Reference< ::com::sun::star::container::XIndexReplace > pXIndex;
+ if((pAny>>=pXIndex) && (numberingLevel !=-1))//numbering level is -1,means invalid value
+ {
+ Any aAny = pXIndex->getByIndex(numberingLevel);
+ Sequence< ::com::sun::star::beans::PropertyValue > aProps;
+ aAny >>= aProps;
+ const ::com::sun::star::beans::PropertyValue* pPropArray = aProps.getConstArray();
+ sal_Int32 nCount = aProps.getLength();
+ swprintf(pChar,L"Numbering:NumberingLevel=%d,",numberingLevel);
+ for( sal_Int32 i=0; i<nCount; i++ )
+ {
+ ::com::sun::star::beans::PropertyValue rProp = pPropArray[i];
+ if( (rProp.Name.compareTo(OUString::createFromAscii("BulletChar"))==0)||
+ (rProp.Name.compareTo(OUString::createFromAscii("GraphicURL"))==0)||
+ (rProp.Name.compareTo(OUString::createFromAscii("NumberingType"))==0))
+ {
+ OLECHAR propStr[512] = {NULL};
+ swprintf(propStr,L"%s=",rProp.Name.getStr());
+ OLECHAR pTemp[256] = {NULL};
+ CMAccessible::get_OLECHARFromAny(rProp.Value,pTemp);
+ if(rProp.Name.compareTo(OUString::createFromAscii("GraphicURL"))==0)
+ {
+ OLECHAR* pOccur = wcschr(pTemp,':');
+ if(pOccur)
+ *pOccur = '.';
+ }
+ wcscat(propStr,pTemp);
+ wcscat(pChar,propStr);
+ wcscat(pChar,L",");
+
+ if(rProp.Name.compareTo(OUString::createFromAscii("NumberingType"))==0)
+ {
+ if(numberingPrefix.getLength()!=0)
+ {
+ swprintf(pTemp,L"NumberingPrefix=%s,",numberingPrefix.getStr());
+ wcscat(pChar,pTemp);
+ }
+ }
+ }
+ }
+ }
+
+ //Because now have three types numbering level:
+ //1.real numbering list,numbering level>=0 and numbering Rule !=NULL;
+ //2.common paragraph, numbering level >=0, and numbering Rule == NULL;
+ //3.TOC paragraph, numbering level >0, and numbering Rule ==NULL;
+ // IAText:numberinglevel base on 0, but TOC's level base on 1,
+ // so NumberingLevel value will be decreased 1 in bridge code.
+ else if(numberingLevel >0)
+ {
+ swprintf(pChar,L"Numbering:NumberingLevel=%d,NumberingType=4,NumberingPrefix=,",numberingLevel-1);
+ }
+ else
+ {
+ swprintf(pChar,L"Numbering:");
+ }
+}
+
+void CMAccessible::ConvertAnyToVariant(const ::com::sun::star::uno::Any &rAnyVal, VARIANT *pvData)
+{
+ if(rAnyVal.hasValue())
+ {
+ // Clear VARIANT variable.
+ VariantClear(pvData);
+
+ // Set value according to value type.
+ switch(rAnyVal.getValueTypeClass())
+ {
+ case TypeClass_CHAR:
+ pvData->vt = VT_UI1;
+ memcpy(&pvData->bVal, rAnyVal.getValue(), sizeof(sal_Char));
+ break;
+
+ case TypeClass_BOOLEAN:
+ pvData->vt = VT_BOOL;
+ memcpy(&pvData->boolVal, rAnyVal.getValue(), sizeof(sal_Bool));
+ break;
+
+ case TypeClass_BYTE:
+ pvData->vt = VT_UI1;
+ memcpy(&pvData->bVal, rAnyVal.getValue(), sizeof(sal_Int8));
+ break;
+
+ case TypeClass_SHORT:
+ pvData->vt = VT_I2;
+ memcpy(&pvData->iVal, rAnyVal.getValue(), sizeof(sal_Int16));
+ break;
+
+ case TypeClass_UNSIGNED_SHORT:
+ pvData->vt = VT_I2;
+ memcpy(&pvData->iVal, rAnyVal.getValue(), sizeof(sal_uInt16));
+ break;
+
+ case TypeClass_LONG:
+ pvData->vt = VT_I4;
+ memcpy(&pvData->lVal, rAnyVal.getValue(), sizeof(sal_Int32));
+ break;
+
+ case TypeClass_UNSIGNED_LONG:
+ pvData->vt = VT_I4;
+ memcpy(&pvData->lVal, rAnyVal.getValue(), sizeof(sal_uInt32));
+ break;
+
+ case TypeClass_FLOAT:
+ pvData->vt = VT_R4;
+ memcpy(&pvData->fltVal, rAnyVal.getValue(), sizeof(float));
+ break;
+
+ case TypeClass_DOUBLE:
+ pvData->vt = VT_R8;
+ memcpy(&pvData->dblVal, rAnyVal.getValue(), sizeof(double));
+ break;
+
+ case TypeClass_STRING:
+ {
+ pvData->vt = VT_BSTR;
+ ::rtl::OUString val;
+ rAnyVal >>= val;
+ pvData->bstrVal = SysAllocString((OLECHAR *)val.getStr());
+ break;
+ }
+
+ case TypeClass_VOID:
+ case TypeClass_HYPER:
+ case TypeClass_UNSIGNED_HYPER:
+ case TypeClass_TYPE:
+ case TypeClass_ANY:
+ case TypeClass_ENUM:
+ case TypeClass_TYPEDEF:
+ case TypeClass_STRUCT:
+ case TypeClass_UNION:
+ case TypeClass_EXCEPTION:
+ case TypeClass_SEQUENCE:
+ case TypeClass_ARRAY:
+ case TypeClass_INTERFACE:
+ {
+ Reference< XAccessible > pXAcc;
+ if(rAnyVal >>= pXAcc)
+ {
+ if(pXAcc.is())
+ {
+ IAccessible* pIAcc = NULL;
+ get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc);
+ if(pIAcc == NULL)
+ {
+ Reference< XAccessibleContext > pXAccContext = pXAcc->getAccessibleContext();
+ g_pAgent->InsertAccObj(pXAcc.get(),pXAccContext->getAccessibleParent().get());
+ get_IAccessibleFromXAccessible((long)pXAcc.get(), &pIAcc);
+ }
+ if(pIAcc)
+ {
+ pIAcc->AddRef();
+
+ pvData->vt = VT_UNKNOWN;
+ pvData->pdispVal = (IAccessible2*)pIAcc;
+ break;
+ }
+ }
+ }
+ }
+ case TypeClass_SERVICE:
+ case TypeClass_MODULE:
+ case TypeClass_INTERFACE_METHOD:
+ case TypeClass_INTERFACE_ATTRIBUTE:
+ case TypeClass_UNKNOWN:
+ case TypeClass_PROPERTY:
+ case TypeClass_CONSTANT:
+ case TypeClass_CONSTANTS:
+ case TypeClass_SINGLETON:
+ case TypeClass_MAKE_FIXED_SIZE:
+ // Output the type string, if there is other uno value type.
+ pvData->vt = VT_BSTR;
+ pvData->bstrVal = SysAllocString(rAnyVal.getValueTypeName().getStr());
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ VariantClear(pvData);
+ }
+}
+
+STDMETHODIMP CMAccessible::Get_XAccChildID(long* childID)
+{
+ // #CHECK#
+ if(childID == NULL)
+ {
+ return E_FAIL;
+ }
+ *childID = m_dChildID;
+ return S_OK;
+}
+STDMETHODIMP CMAccessible:: get_states(AccessibleStates __RPC_FAR *states )
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK XInterface#
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ Reference<XAccessibleStateSet> pRStateSet = pRContext.get()->getAccessibleStateSet();
+ if(!pRStateSet.is())
+ {
+ return S_OK;
+ }
+ Sequence<short> pStates = pRStateSet->getStates();
+
+
+ long count = pStates.getLength() ;
+ *states = 0x0;
+ for( int i = 0; i < count; i++ )
+ {
+ for( int j = 0; j < sizeof(UNO_STATES) / sizeof(UNO_STATES[0]); j++ )
+ {
+ if( pStates[i] == UNO_STATES[j] )
+ {
+ *states |= IA2_STATES[j];
+ break;
+ }
+ }
+ }
+ return S_OK;
+
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+// return the UNO roles
+STDMETHODIMP CMAccessible:: get_extendedRole( BSTR __RPC_FAR * )
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+STDMETHODIMP CMAccessible:: get_localizedExtendedRole( BSTR __RPC_FAR * )
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+STDMETHODIMP CMAccessible:: get_nExtendedStates( long __RPC_FAR * )
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+STDMETHODIMP CMAccessible:: get_localizedExtendedStates( long, BSTR __RPC_FAR *__RPC_FAR *, long __RPC_FAR *)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ return E_NOTIMPL;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+STDMETHODIMP CMAccessible:: get_indexInParent( long __RPC_FAR *accParentIndex)
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ // #CHECK#
+ if(accParentIndex == NULL)
+ return E_INVALIDARG;
+
+ // #CHECK XInterface#
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ *accParentIndex = pRContext.get()->getAccessibleIndexInParent();
+ return S_OK;
+
+
+ LEAVE_PROTECTED_BLOCK
+}
+STDMETHODIMP CMAccessible:: get_locale( IA2Locale __RPC_FAR *locale )
+{
+
+ CHECK_ENABLE_INF
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(locale == NULL)
+ return E_INVALIDARG;
+ // #CHECK XInterface#
+
+ if( !pRContext.is() )
+ return E_FAIL;
+
+ ::com::sun::star::lang::Locale unoLoc = pRContext.get()->getLocale();
+ locale->language = SysAllocString((OLECHAR*)unoLoc.Language.getStr());
+ locale->country = SysAllocString((OLECHAR*)unoLoc.Country.getStr());
+ locale->variant = SysAllocString((OLECHAR*)unoLoc.Variant.getStr());
+
+ return S_OK;
+
+ LEAVE_PROTECTED_BLOCK
+}
+
+DWORD GetMSAAStateFromUNO(short xState)
+{
+ DWORD IState = STATE_SYSTEM_UNAVAILABLE;
+ switch( xState )
+ {
+ case /*AccessibleStateType::*/AccessibleStateType::BUSY:
+ IState = STATE_SYSTEM_BUSY;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::CHECKED:
+ IState = STATE_SYSTEM_CHECKED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::DEFUNC:
+ IState = STATE_SYSTEM_UNAVAILABLE;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::EXPANDED:
+ IState = STATE_SYSTEM_EXPANDED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::FOCUSABLE:
+ IState = STATE_SYSTEM_FOCUSABLE;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::FOCUSED:
+ IState = STATE_SYSTEM_FOCUSED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::INDETERMINATE:
+ IState = STATE_SYSTEM_MIXED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::MULTI_SELECTABLE:
+ IState = STATE_SYSTEM_MULTISELECTABLE;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::PRESSED:
+ IState = STATE_SYSTEM_PRESSED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::RESIZABLE:
+ IState = STATE_SYSTEM_SIZEABLE;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::SELECTABLE:
+ IState = STATE_SYSTEM_SELECTABLE;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::SELECTED:
+ IState = STATE_SYSTEM_SELECTED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::ARMED:
+ IState = STATE_SYSTEM_FOCUSED;
+ break;
+ case /*AccessibleStateType::*/AccessibleStateType::EXPANDABLE:
+ IState = STATE_SYSTEM_COLLAPSED;
+ break;
+ default:
+ break;
+ }
+ return IState;
+}
+
+STDMETHODIMP CMAccessible:: get_appName( BSTR __RPC_FAR *name)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(name == NULL)
+ return E_INVALIDARG;
+
+ *name = SysAllocString(OLESTR("Hannover"));
+ return S_OK;
+ LEAVE_PROTECTED_BLOCK
+}
+STDMETHODIMP CMAccessible:: get_appVersion(BSTR __RPC_FAR *version)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(version == NULL)
+ return E_INVALIDARG;
+ *version=SysAllocString(OLESTR("3.0"));
+ return S_OK;
+ LEAVE_PROTECTED_BLOCK
+}
+STDMETHODIMP CMAccessible:: get_toolkitName(BSTR __RPC_FAR *name)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(name == NULL)
+ return E_INVALIDARG;
+ *name = SysAllocString(OLESTR(" "));
+ return S_OK;
+ LEAVE_PROTECTED_BLOCK
+}
+STDMETHODIMP CMAccessible:: get_toolkitVersion(BSTR __RPC_FAR *version)
+{
+
+ ENTER_PROTECTED_BLOCK
+ ISDESTROY()
+ if(version == NULL)
+ return E_INVALIDARG;
+ *version = SysAllocString(OLESTR(" "));
+ return S_OK;
+ LEAVE_PROTECTED_BLOCK
+}
+
+
+STDMETHODIMP CMAccessible::get_attributes(/*[out]*/ BSTR *pAttr)
+{
+ CHECK_ENABLE_INF
+ Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
+ if( !pRContext.is() )
+ {
+ return E_FAIL;
+ }
+ Reference<XAccessibleExtendedAttributes> pRXI(pRContext,UNO_QUERY);
+ if( !pRXI.is() )
+ return E_FAIL;
+ else
+ {
+ com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleExtendedAttributes> pRXAttr;
+ pRXAttr = pRXI.get();
+ ::com::sun::star::uno::Any anyVal = pRXAttr->getExtendedAttributes();
+
+ ::rtl::OUString val;
+ anyVal >>= val;
+
+ if(*pAttr)
+ SAFE_SYSFREESTRING(*pAttr);
+ *pAttr = SysAllocString((OLECHAR *)val.getStr());
+
+ return S_OK;
+ }
+}
+
diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h
new file mode 100644
index 000000000000..5e298e257f6a
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/MAccessible.h
@@ -0,0 +1,294 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __MACCESSIBLE_H_
+#define __MACCESSIBLE_H_
+
+#include <Windows.h>
+#include "resource.h" // main symbols
+#include <vector>
+#include <map>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <AccObjectManagerAgent.hxx>
+#include "EnumVariant.h"
+#ifndef __ACCCOMMON_H_
+#include "acccommon.h"
+#endif
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+#define CHILDID_SELF 0
+#define OBJID_WINDOW ((LONG)0x00000000)
+#define OBJID_SYSMENU ((LONG)0xFFFFFFFF)
+#define OBJID_TITLEBAR ((LONG)0xFFFFFFFE)
+#define OBJID_MENU ((LONG)0xFFFFFFFD)
+#define OBJID_CLIENT ((LONG)0xFFFFFFFC)
+#define OBJID_VSCROLL ((LONG)0xFFFFFFFB)
+#define OBJID_HSCROLL ((LONG)0xFFFFFFFA)
+#define OBJID_SIZEGRIP ((LONG)0xFFFFFFF9)
+#define OBJID_CARET ((LONG)0xFFFFFFF8)
+#define OBJID_CURSOR ((LONG)0xFFFFFFF7)
+#define OBJID_ALERT ((LONG)0xFFFFFFF6)
+#define OBJID_SOUND ((LONG)0xFFFFFFF5)
+#define OBJID_QUERYCLASSNAMEIDX ((LONG)0xFFFFFFF4)
+#define OBJID_NATIVEOM ((LONG)0xFFFFFFF0)
+
+using namespace rtl;
+/**
+ *This class implements IMAccessible interface, which inherits from IAccessible2, and
+ *in turn inherits from IAccessible. So its methods include the methods defined only in
+ *IAccessible, plus the methods defined only in IAccessible2, plus the methods defined
+ *only in IMAccessible.
+ */
+class ATL_NO_VTABLE CMAccessible :
+ public CComObjectRoot,
+ public CComCoClass<CMAccessible, &CLSID_MAccessible>,
+ public IDispatchImpl<IMAccessible, &IID_IMAccessible, &LIBID_UACCCOMLib>,
+ public IServiceProvider,
+ public IAccessibleApplication
+{
+ typedef map< const GUID, CComPtr<IUnknown> ,ltComp > XGUIDToComObjHash;
+
+ typedef HRESULT (WINAPI _UNO_AGGCREATORFUNC)(void*, REFIID, LPVOID*);
+
+ struct _UNO_AGGMAP_ENTRY
+ {
+ const IID* piid;
+ _UNO_AGGCREATORFUNC* pfnCreateInstance;
+ int XIFIndex;
+ };
+
+ enum XInterfaceIndex {
+ XI_COMPONENT = 0x01,
+ XI_TEXT = 0x02,
+ XI_TABLE = 0x03,
+ XI_EDITABLETEXT = 0x04,
+ XI_IMAGE = 0x05,
+ XI_SELECTION = 0x06,
+ XI_EXTENDEDCOMP = 0x07,
+ XI_VALUE = 0x08,
+ XI_KEYBINDING = 0x09,
+ XI_ACTION = 0x0A,
+ XI_HYPERTEXT = 0x0B,
+ XI_HYPERLINK = 0x0C,
+ XI_ATTRIBUTE = 0x0D,
+ XI_NULL = -1
+ };
+
+public:
+ CMAccessible();
+ virtual ~CMAccessible();
+ DECLARE_REGISTRY_RESOURCEID(IDR_MACCESSIBLE)
+
+ DECLARE_GET_CONTROLLING_UNKNOWN()
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CMAccessible)
+ COM_INTERFACE_ENTRY(IMAccessible)
+ COM_INTERFACE_ENTRY(IAccessible)
+ COM_INTERFACE_ENTRY(IAccessible2)
+ COM_INTERFACE_ENTRY(IDispatch)
+ COM_INTERFACE_ENTRY(IAccessibleApplication)
+ COM_INTERFACE_ENTRY(IServiceProvider)
+ COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
+ END_COM_MAP()
+
+ // AGGREGATE OBJECT MAP
+ BEGIN_AGGOBJECT_MAP(CMAccessible)
+ AGGOBJECT_ENTRY(IID_IAccessibleComponent, CLSID_AccComponent, COMPONENT)
+ AGGOBJECT_ENTRY(IID_IAccessibleText, CLSID_AccText, TEXT)
+ AGGOBJECT_ENTRY(IID_IAccessibleEditableText, CLSID_AccEditableText, EDITABLETEXT)
+ AGGOBJECT_ENTRY(IID_IAccessibleImage, CLSID_AccImage, IMAGE)
+ AGGOBJECT_ENTRY(IID_IAccessibleTable, CLSID_AccTable, TABLE)
+ AGGOBJECT_ENTRY(IID_IAccessibleAction, CLSID_AccAction, ACTION)
+ AGGOBJECT_ENTRY(IID_IAccessibleValue, CLSID_AccValue, VALUE)
+ AGGOBJECT_ENTRY(IID_IAccessibleHypertext, CLSID_AccHypertext, HYPERTEXT)
+ AGGOBJECT_ENTRY(IID_IAccessibleHyperlink, CLSID_AccHyperLink, HYPERLINK)
+
+
+ END_AGGOBJECT_MAP()
+
+ // IMAccessible
+ STDMETHOD(put_accValue)(VARIANT varChild,BSTR szValue);
+ STDMETHOD(put_accName)(VARIANT varChild,BSTR szName);
+ STDMETHOD(accDoDefaultAction)(VARIANT varChild);
+ STDMETHOD(accHitTest)(long xLeft,long yTop,VARIANT *pvarChild);
+ STDMETHOD(accNavigate)(long navDir,VARIANT varStart,VARIANT *pvarEndUpAt);
+ STDMETHOD(accLocation)(long *pxLeft,long *pyTop,long *pcxWidth,long *pcyHeight,VARIANT varChild);
+ STDMETHOD(accSelect)(long flagsSelect,VARIANT varChild);
+ STDMETHOD(get_accDefaultAction)( VARIANT varChild,BSTR *pszDefaultAction);
+ STDMETHOD(get_accSelection)(VARIANT *pvarChildren);
+ STDMETHOD(get_accFocus)(VARIANT *pvarChild);
+ STDMETHOD(get_accKeyboardShortcut)( VARIANT varChild,BSTR *pszKeyboardShortcut);
+ STDMETHOD(get_accHelpTopic)(BSTR *pszHelpFile,VARIANT varChild,long *pidTopic);
+ STDMETHOD(get_accHelp)(VARIANT varChild,BSTR *pszHelp);
+ STDMETHOD(get_accState)(VARIANT varChild,VARIANT *pvarState);
+ STDMETHOD(get_accRole)(VARIANT varChild,VARIANT *pvarRole);
+ STDMETHOD(get_accDescription)(VARIANT varChild,BSTR *pszDescription);
+ STDMETHOD(get_accValue)( VARIANT varChild,BSTR *pszValue);
+ STDMETHOD(get_accName)(VARIANT varChild,BSTR *pszName);
+ STDMETHOD(get_accChild)(VARIANT varChild,IDispatch **ppdispChild);
+ STDMETHOD(get_accChildCount)(long *pcountChildren);
+ STDMETHOD(get_accParent)( IDispatch **ppdispParent);
+
+ // methods which are defined only in the IAccessible2
+ // These methods only declare here, and their implementation bodies are empty now.
+ STDMETHOD(get_nRelations)( long __RPC_FAR *nRelations) ;
+ STDMETHOD(get_relation)( long relationIndex, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation) ;
+ STDMETHOD(get_relations)( long maxRelations, IAccessibleRelation __RPC_FAR *__RPC_FAR *relation, long __RPC_FAR *nRelations) ;
+ STDMETHOD(role)(long __RPC_FAR *role);
+ STDMETHOD(get_nActions)(long __RPC_FAR *nActions);
+ STDMETHOD(scrollTo)(enum IA2ScrollType scrollType);
+ STDMETHOD(scrollToPoint)(enum IA2CoordinateType coordinateType, long x, long y);
+ STDMETHOD(get_groupPosition)(long __RPC_FAR *groupLevel,long __RPC_FAR *similarItemsInGroup,long __RPC_FAR *positionInGroup);
+ STDMETHOD(get_states)( AccessibleStates __RPC_FAR *states );
+ STDMETHOD(get_extendedRole)( BSTR __RPC_FAR *extendedRole );
+ STDMETHOD(get_localizedExtendedRole)( BSTR __RPC_FAR *localizedExtendedRole );
+ STDMETHOD(get_nExtendedStates)( long __RPC_FAR *nExtendedStates);
+ STDMETHOD(get_extendedStates)( long maxExtendedStates, BSTR __RPC_FAR *__RPC_FAR *extendedStates, long __RPC_FAR *nExtendedStates);
+ STDMETHOD(get_localizedExtendedStates)(long maxLocalizedExtendedStates,BSTR __RPC_FAR *__RPC_FAR *localizedExtendedStates,long __RPC_FAR *nLocalizedExtendedStates);
+ STDMETHOD(get_uniqueID)(long __RPC_FAR *uniqueID);
+ STDMETHOD(get_windowHandle)(HWND __RPC_FAR *windowHandle);
+ STDMETHOD(get_indexInParent)( long __RPC_FAR *accParentIndex );
+ STDMETHOD(get_locale)( IA2Locale __RPC_FAR *locale );
+ STDMETHOD(get_attributes)(/*[out]*/ BSTR *pAttr);
+
+ //IServiceProvider.
+ STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void** ppvObject);
+
+ //IAccessibleApplication
+ STDMETHOD(get_appName)(BSTR __RPC_FAR *name);
+ STDMETHOD(get_appVersion)(BSTR __RPC_FAR *version);
+ STDMETHOD(get_toolkitName)(BSTR __RPC_FAR *name);
+ STDMETHOD(get_toolkitVersion)(BSTR __RPC_FAR *version);
+
+ // methods which are defined only in IMAccessible
+ // These methods are provided for UNO management system.
+ // The UNO management system use these methods to put Accessibility
+ // information to COM.
+ STDMETHOD(Put_XAccName)(const OLECHAR __RPC_FAR *pszName);
+ STDMETHOD(Put_XAccRole)(unsigned short pRole);
+ STDMETHOD(DecreaseState)(DWORD pXSate);
+ STDMETHOD(IncreaseState)(DWORD pXSate);
+ STDMETHOD(SetState)(DWORD pXSate);
+ STDMETHOD(Put_XAccDescription)(const OLECHAR __RPC_FAR *pszDescription);
+ STDMETHOD(Put_XAccValue)(const OLECHAR __RPC_FAR *pszAccValue);
+ STDMETHOD(Put_XAccLocation)(const Location sLocation);
+ STDMETHOD(Put_XAccFocus)(long dChildID);
+ STDMETHOD(Put_XAccParent)(IMAccessible __RPC_FAR *pIParent);
+ STDMETHOD(Put_XAccWindowHandle)(HWND hwnd);
+ STDMETHOD(Put_XAccChildID)(long dChildID);
+ STDMETHOD(Put_XAccAgent)(long pAgent);
+ STDMETHOD(NotifyDestroy)(BOOL isDestroy);
+ STDMETHOD(Put_ActionDescription)( const OLECHAR* szAction);
+ STDMETHOD(SetDefaultAction)(long pAction);
+ STDMETHOD(GetUNOInterface)(long*);
+ STDMETHOD(SetXAccessible)(long);
+
+private:
+ OLECHAR* m_pszName;
+ OLECHAR* m_pszValue;
+ OLECHAR* m_pszActionDescription;
+ unsigned short m_iRole;
+ DWORD m_dState;
+ OLECHAR* m_pszDescription;
+ IMAccessible* m_pIParent;
+ Location m_sLocation;
+
+ // identify a COM object/Acc object uniquely
+ long m_dChildID;
+ // specify the focus child ID in object self and its direct children
+
+ long m_dFocusChildID;
+ // parent window handle,will be used in the future application, its value comes from UNO
+
+ HWND m_hwnd;
+
+ // the COM class which implements IEnumVARIANT interface,currently only used in
+ // the implementation of get_accSelection
+ CEnumVariant* m_pEnumVar;
+
+ // specify if the XAccessible is invalid
+ BOOL m_isDestroy;
+
+ XAccessible* pUNOInterface;
+ Reference< XAccessible > pRef;
+ XAccessible* pAchorUNOInterface;
+ XAccessibleAction* m_pXAction;
+ XAccessibleContext* pRContextInterface;
+ Reference<XAccessibleContext> pRContext;
+
+private:
+
+ // the helper methods in order to implement the above public methods
+ IMAccessible* GetChildInterface(long dChildIndex);//notice here the parameter is child index,not child id
+ IMAccessible* GetNavigateChildForDM(VARIANT varCur,short flags);//for decendant manage
+ HRESULT GetFirstChild(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation
+ HRESULT GetLastChild(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation
+ HRESULT GetNextSibling(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation
+ HRESULT GetPreSibling(VARIANT varStart,VARIANT* pvarEndUpAt);//for accNavigate implementation
+ BOOL IsDecendantManage();//identify whether the current COM belongs to manage_decendant roles
+
+ // the following private methods are used to implement accSelect method
+ HRESULT SelectChild(XAccessible* pItem);
+ HRESULT DeSelectChild(XAccessible* pItem);
+ HRESULT SelectMutipleChidren( XAccessible** pItem,int size );
+ HRESULT DeSelectMutipleChildren( XAccessible** pItem,int size );
+ XAccessibleContext* GetContextByXAcc( XAccessible* pXAcc );
+ Reference< XAccessibleSelection > GetSelection();
+ // end accSelect implementation methods
+ BOOL GetXInterfaceFromXAccessible(XAccessible*, XInterface**, int);
+ HRESULT WINAPI SmartQI(void* pv, REFIID iid, void** ppvObject);
+
+public:
+ STDMETHOD(Get_XAccChildID)(/*[out,retval]*/ long* childID);
+ // AccObjectManagerAgent is a management object in UNO, here keep its pointer for
+ // the implementation of accNavigate when decendant manage happens for List,Tree, or Table
+ // AccObjectManagerAgent and the following UNO objects XAccessble,XAccessibleSelection,
+ // XAccessibleAction are all used to operate UNO accessiblility information directly when
+ // implement some specific MSAA methods,such as accSelection,accNavigate
+ static AccObjectManagerAgent* g_pAgent;
+
+ static BOOL get_IAccessibleFromXAccessible(long pXAcc,IAccessible** ppIA);
+ BOOL m_bRequiresSave;
+ XGUIDToComObjHash m_containedObjects;
+
+ static HRESULT WINAPI _SmartQI(void* pv,
+ REFIID iid, void** ppvObject, DWORD)
+ {
+ return ((CMAccessible*)pv)->SmartQI(pv,iid,ppvObject);
+ }
+
+ static void get_OLECHARFromAny(Any& pAny, OLECHAR* pChar);
+
+ static void get_OLECHAR4Numbering(const Any& pAny, short numberingLevel, const OUString& numberingPrefix,OLECHAR* pChar);
+
+ // Helper function for data conversion.
+ static void ConvertAnyToVariant(const ::com::sun::star::uno::Any &rAnyVal, VARIANT *pvData);
+};
+
+
+
+#endif //__MACCESSIBLE_H_
diff --git a/winaccessibility/source/UAccCOM/MAccessible.rgs b/winaccessibility/source/UAccCOM/MAccessible.rgs
new file mode 100644
index 000000000000..10bd2c02eb94
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/MAccessible.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ UAccCOM.MAccessible.1 = s 'MAccessible Class'
+ {
+ CLSID = s '{CF8DF8BA-44FE-4B10-BD2E-8C8CB322485F}'
+ }
+ UAccCOM.MAccessible = s 'MAccessible Class'
+ {
+ CLSID = s '{CF8DF8BA-44FE-4B10-BD2E-8C8CB322485F}'
+ CurVer = s 'UAccCOM.MAccessible.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {CF8DF8BA-44FE-4B10-BD2E-8C8CB322485F} = s 'MAccessible Class'
+ {
+ ProgID = s 'UAccCOM.MAccessible.1'
+ VersionIndependentProgID = s 'UAccCOM.MAccessible'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Both'
+ }
+ 'TypeLib' = s '{19ECB1B0-9376-4FF9-B580-223FC9C200B8}'
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/Resource.h b/winaccessibility/source/UAccCOM/Resource.h
new file mode 100644
index 000000000000..a4df8cde4aee
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/Resource.h
@@ -0,0 +1,70 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by UAccCOM.rc
+//
+#define WNT
+
+#define IDS_PROJNAME 100
+#define IDR_MACCESSIBLE 101
+#define IDR_ENUMVARIANT 106
+#define IDR_UNOXWRAPPER 107
+#define IDS_ACCCOMPONENT_DESC 108
+#define IDR_AccComponent 109
+#define IDS_ACCCONTEXT_DESC 110
+#define IDR_AccContext 111
+#define IDR_ACCRELATION 112
+#define IDR_ACCACTION 113
+#define IDS_ACCFONT_DESC 114
+#define IDR_AccFont 115
+#define IDS_ACCSELECTION_DESC 116
+#define IDR_AccSelection 117
+#define IDS_ACCEXTENDEDCOMPONENT_DESC 118
+#define IDR_AccExtendedComponent 119
+#define IDS_ACCTEXT_DESC 120
+#define IDR_AccText 121
+#define IDS_ACCEDITABLETEXT_DESC 122
+#define IDR_AccEditableText 123
+#define IDS_ACCHYPERTEXT_DESC 124
+#define IDR_AccHypertext 125
+#define IDS_ACCIMAGE_DESC 126
+#define IDR_AccImage 127
+#define IDS_ACCVALUE_DESC 128
+#define IDR_AccValue 129
+#define IDS_ACCTABLE_DESC 130
+#define IDR_ACCTABLE 131
+#define IDS_ACCHYPERLINK_DESC 132
+#define IDR_AccHyperLink 133
+#define IDS_ACCKEYBINDING_DESC 134
+#define IDR_AccKeyBinding 135
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 203
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 201
+#define _APS_NEXT_SYMED_VALUE 137
+#endif
+#endif
diff --git a/winaccessibility/source/UAccCOM/StdAfx.cxx b/winaccessibility/source/UAccCOM/StdAfx.cxx
new file mode 100644
index 000000000000..20fae718d15a
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/StdAfx.cxx
@@ -0,0 +1,29 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+
+#ifdef _ATL_STATIC_REGISTRY
+#include <statreg.h>
+#include <statreg.cpp>
+#endif
+
+#include <atlimpl.cpp>
diff --git a/winaccessibility/source/UAccCOM/UAccCOM.cxx b/winaccessibility/source/UAccCOM/UAccCOM.cxx
new file mode 100644
index 000000000000..85471d13158b
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UAccCOM.cxx
@@ -0,0 +1,109 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "resource.h"
+#include <initguid.h>
+#include "UAccCOM2.h"
+
+#include "UAccCOM_i.c"
+#include "ia2_api_all_i.c"
+
+#include "MAccessible.h"
+#include "EnumVariant.h"
+#include "UNOXWrapper.h"
+#include "AccComponent.h"
+#include "AccRelation.h"
+#include "AccAction.h"
+#include "AccText.h"
+#include "AccEditableText.h"
+#include "AccImage.h"
+#include "AccValue.h"
+#include "AccTable.h"
+#include "AccHyperLink.h"
+#include "AccHyperText.h"
+
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+OBJECT_ENTRY(CLSID_MAccessible, CMAccessible)
+OBJECT_ENTRY(CLSID_EnumVariant, CEnumVariant)
+OBJECT_ENTRY(CLSID_AccComponent, CAccComponent)
+OBJECT_ENTRY(CLSID_AccRelation, CAccRelation)
+OBJECT_ENTRY(CLSID_AccAction, CAccAction)
+OBJECT_ENTRY(CLSID_AccText, CAccText)
+OBJECT_ENTRY(CLSID_AccEditableText, CAccEditableText)
+OBJECT_ENTRY(CLSID_AccImage, CAccImage)
+OBJECT_ENTRY(CLSID_AccValue, CAccValue)
+OBJECT_ENTRY(CLSID_AccTable, CAccTable)
+OBJECT_ENTRY(CLSID_AccHyperLink, CAccHyperLink)
+OBJECT_ENTRY(CLSID_AccHypertext, CAccHypertext)
+END_OBJECT_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// DLL Entry Point
+
+extern "C"
+ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ _Module.Init(ObjectMap, hInstance, &LIBID_UACCCOMLib);
+ DisableThreadLibraryCalls(hInstance);
+ }
+ else if (dwReason == DLL_PROCESS_DETACH)
+ _Module.Term();
+ return TRUE; // ok
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+{
+ return (_Module.GetLockCount()==0) ? S_OK : E_FAIL;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+{
+ return _Module.GetClassObject(rclsid, riid, ppv);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+ // registers object, typelib and all interfaces in typelib
+ return _Module.RegisterServer(TRUE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+ return _Module.UnregisterServer(TRUE);
+}
diff --git a/winaccessibility/source/UAccCOM/UAccCOM.def b/winaccessibility/source/UAccCOM/UAccCOM.def
new file mode 100644
index 000000000000..575a28143316
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UAccCOM.def
@@ -0,0 +1,7 @@
+LIBRARY "UAccCOM.DLL"
+
+EXPORTS
+ DllCanUnloadNow PRIVATE
+ DllGetClassObject PRIVATE
+ DllRegisterServer PRIVATE
+ DllUnregisterServer PRIVATE
diff --git a/winaccessibility/source/UAccCOM/UAccCOM.rc b/winaccessibility/source/UAccCOM/UAccCOM.rc
new file mode 100644
index 000000000000..f49903d777d6
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UAccCOM.rc
@@ -0,0 +1,149 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Chinese (P.R.C.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
+#ifdef _WIN32
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+#pragma code_page(936)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// REGISTRY
+//
+
+IDR_MACCESSIBLE REGISTRY DISCARDABLE "MAccessible.rgs"
+IDR_ENUMVARIANT REGISTRY DISCARDABLE "EnumVariant.rgs"
+IDR_UNOXWRAPPER REGISTRY DISCARDABLE "UNOXWrapper.rgs"
+IDR_AccComponent REGISTRY DISCARDABLE "AccComponent.rgs"
+IDR_AccExtendedComponent REGISTRY DISCARDABLE "AccExtendedComponent.rgs"
+IDR_ACCRELATION REGISTRY DISCARDABLE "AccRelation.rgs"
+IDR_ACCACTION REGISTRY DISCARDABLE "AccAction.rgs"
+IDR_AccFont REGISTRY DISCARDABLE "AccFont.rgs"
+IDR_AccSelection REGISTRY DISCARDABLE "AccSelection.rgs"
+IDR_AccText REGISTRY DISCARDABLE "AccText.rgs"
+IDR_AccEditableText REGISTRY DISCARDABLE "AccEditableText.rgs"
+IDR_AccImage REGISTRY DISCARDABLE "AccImage.rgs"
+IDR_AccValue REGISTRY DISCARDABLE "AccValue.rgs"
+IDR_ACCTABLE REGISTRY DISCARDABLE "AccTable.rgs"
+IDR_AccHyperLink REGISTRY DISCARDABLE "AccHyperLink.rgs"
+IDR_AccHypertext REGISTRY DISCARDABLE "AccHypertext.rgs"
+IDR_AccKeyBinding REGISTRY DISCARDABLE "AccKeyBinding.rgs"
+#endif // Chinese (P.R.C.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""winres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "1 TYPELIB ""UAccCOM.tlb""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROJNAME "UAccCOM"
+ IDS_ACCCOMPONENT_DESC "AccComponent Class"
+ IDS_ACCCONTEXT_DESC "AccContext Class"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_ACCFONT_DESC "AccFont Class"
+ IDS_ACCSELECTION_DESC "AccSelection Class"
+ IDS_ACCEXTENDEDCOMPONENT_DESC "AccExtendedComponent Class"
+ IDS_ACCTEXT_DESC "AccText Class"
+ IDS_ACCEDITABLETEXT_DESC "AccEditableText Class"
+ IDS_ACCHYPERTEXT_DESC "AccHypertext Class"
+ IDS_ACCIMAGE_DESC "AccImage Class"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_ACCVALUE_DESC "AccValue Class"
+ IDS_ACCTABLE_DESC "AccTable Class"
+ IDS_ACCHYPERLINK_DESC "AccHyperLink Class"
+ IDS_ACCKEYBINDING_DESC "AccKeyBinding Class"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+1 TYPELIB "UAccCOM.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/winaccessibility/source/UAccCOM/UNOXWrapper.cxx b/winaccessibility/source/UAccCOM/UNOXWrapper.cxx
new file mode 100644
index 000000000000..80427ca20049
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UNOXWrapper.cxx
@@ -0,0 +1,27 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "UNOXWrapper.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CUNOXWrapper
diff --git a/winaccessibility/source/UAccCOM/UNOXWrapper.h b/winaccessibility/source/UAccCOM/UNOXWrapper.h
new file mode 100644
index 000000000000..c80eb203df70
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UNOXWrapper.h
@@ -0,0 +1,72 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __UNOXWRAPPER_H_
+#define __UNOXWRAPPER_H_
+
+#define WNT
+
+#include "resource.h" // main symbols
+
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include "UAccCOM2.h"
+
+/**
+ * CUNOXWrapper implements IUNOXWrapper interface.
+ */
+class ATL_NO_VTABLE CUNOXWrapper : public IUNOXWrapper
+{
+public:
+ CUNOXWrapper()
+ { }
+
+public:
+ // IUNOXWrapper
+
+ STDMETHOD(put_XInterface)(long pXInterface)
+ {
+ pUNOInterface = (com::sun::star::accessibility::XAccessible*)pXInterface;
+ return S_OK;
+ }
+
+ STDMETHOD(put_XSubInterface)(long)
+ {
+ return S_OK;
+ }
+
+ STDMETHOD(get_XInterface)(/*[out,retval]*/long *pXInterface)
+ {
+ *pXInterface = (long)pUNOInterface;//.get();
+ return S_OK;
+ }
+
+ STDMETHOD(get_XSubInterface)(/*[out,retval]*/long *)
+ {
+ return S_OK;
+ }
+
+protected:
+
+ com::sun::star::accessibility::XAccessible* pUNOInterface;
+};
+
+#endif //__UNOXWRAPPER_H_
diff --git a/winaccessibility/source/UAccCOM/UNOXWrapper.rgs b/winaccessibility/source/UAccCOM/UNOXWrapper.rgs
new file mode 100644
index 000000000000..8a52b08ae7f9
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/UNOXWrapper.rgs
@@ -0,0 +1,26 @@
+HKCR
+{
+ UAccCOM.UNOXWrapper.1 = s 'UNOXWrapper Class'
+ {
+ CLSID = s '{AA360FB0-BC98-41C1-A885-BB921F5ED601}'
+ }
+ UAccCOM.UNOXWrapper = s 'UNOXWrapper Class'
+ {
+ CLSID = s '{AA360FB0-BC98-41C1-A885-BB921F5ED601}'
+ CurVer = s 'UAccCOM.UNOXWrapper.1'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove {AA360FB0-BC98-41C1-A885-BB921F5ED601} = s 'UNOXWrapper Class'
+ {
+ ProgID = s 'UAccCOM.UNOXWrapper.1'
+ VersionIndependentProgID = s 'UAccCOM.UNOXWrapper'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ 'TypeLib' = s '{19ECB1B0-9376-4FF9-B580-223FC9C200B8}'
+ }
+ }
+}
diff --git a/winaccessibility/source/UAccCOM/acccommon.h b/winaccessibility/source/UAccCOM/acccommon.h
new file mode 100644
index 000000000000..4c0451a65b0e
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/acccommon.h
@@ -0,0 +1,95 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef __ACCCOMMON_H_
+#define __ACCCOMMON_H_
+
+
+//using namespace com::sun::star::accessibility;
+//using namespace com::sun::star::uno;
+
+
+//for MAccessible.cxx
+struct ltComp
+{
+ bool operator()(REFGUID rguid1, REFGUID rguid2) const
+ {
+ if(((PLONG) &rguid1)[0] < ((PLONG) &rguid2)[0])
+ return TRUE;
+ else if(((PLONG) &rguid1)[0] > ((PLONG) &rguid2)[0])
+ return FALSE;
+ if(((PLONG) &rguid1)[1] < ((PLONG) &rguid2)[1])
+ return TRUE;
+ else if(((PLONG) &rguid1)[1] > ((PLONG) &rguid2)[1])
+ return FALSE;
+ if(((PLONG) &rguid1)[2] < ((PLONG) &rguid2)[2])
+ return TRUE;
+ else if(((PLONG) &rguid1)[2] > ((PLONG) &rguid2)[2])
+ return FALSE;
+ if(((PLONG) &rguid1)[3] < ((PLONG) &rguid2)[3])
+ return TRUE;
+ else if(((PLONG) &rguid1)[3] > ((PLONG) &rguid2)[3])
+ return FALSE;
+ return FALSE;
+ }
+};
+
+#define BEGIN_AGGOBJECT_MAP(x) \
+ static _UNO_AGGMAP_ENTRY* WINAPI _GetAggEntries() { \
+ static _UNO_AGGMAP_ENTRY _aggentries[] = {
+#define END_AGGOBJECT_MAP() {NULL, NULL,NULL}}; \
+ return _aggentries;}
+#define AGGOBJECT_ENTRY(iid, clsid, ifindex) {&iid, \
+ CComAggregateCreator< CComObject<CMAccessible>, &clsid >::CreateInstance,\
+ XI_##ifindex},
+
+enum DM_NIR {
+ DM_FIRSTCHILD = 0x00,
+ DM_LASTCHILD = 0x01,
+ DM_NEXTCHILD = 0x02,
+ DM_PREVCHILD = 0x03
+};
+
+inline BOOL ImplIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
+{
+ return (
+ ((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] &&
+ ((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] &&
+ ((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] &&
+ ((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]);
+}
+#define InlineIsEqualGUID ImplIsEqualGUID
+//End
+
+//for AccAction.cxx
+#define CODEENTRY(key) \
+ {KEYCODE_##key, L#key}
+#define countof(x) (sizeof(x)/sizeof(x[0]))
+
+#define SELECT L"Select"
+#define PRESS L"Press"
+#define UNCHECK L"UnCheck"
+#define CHECK L"Check"
+//End
+
+static DWORD GetMSAAStateFromUNO(short xState);
+
+#endif
diff --git a/winaccessibility/source/UAccCOM/stdafx.h b/winaccessibility/source/UAccCOM/stdafx.h
new file mode 100644
index 000000000000..c9b2a23cc7c4
--- /dev/null
+++ b/winaccessibility/source/UAccCOM/stdafx.h
@@ -0,0 +1,64 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#if !defined(AFX_STDAFX_H__5E2F9072_190F_47C7_8003_4D44FD308CB9__INCLUDED_)
+#define AFX_STDAFX_H__5E2F9072_190F_47C7_8003_4D44FD308CB9__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+#define STRICT
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0400
+#endif
+//#define _ATL_APARTMENT_THREADED
+
+#include <atlbase.h>
+// You may derive a class from CComModule and use it if you want to override
+// something, but do not change the name of _Module
+extern CComModule _Module;
+#include <atlcom.h>
+
+#define ENTER_PROTECTED_BLOCK \
+ try \
+ {
+
+#define LEAVE_PROTECTED_BLOCK \
+ } \
+ catch(...) \
+ { \
+ return E_FAIL; \
+ }
+
+#define SAFE_SYSFREESTRING(x) { ::SysFreeString(x); x=NULL; }
+
+#include <windows.h>
+#undef OPAQUE
+#include "CheckEnableAccessible.h"
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__5E2F9072_190F_47C7_8003_4D44FD308CB9__INCLUDED)
diff --git a/winaccessibility/source/UAccCOMIDL/AccessibleKeyBinding.idl b/winaccessibility/source/UAccCOMIDL/AccessibleKeyBinding.idl
new file mode 100644
index 000000000000..8e0e8e06c5c5
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/AccessibleKeyBinding.idl
@@ -0,0 +1,66 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+import "objidl.idl";
+import "oaidl.idl";
+import "oleacc.idl";
+import "AccessibleKeyStroke.idl";
+
+[object, uuid(6B1923AC-3E9A-4336-99E1-A69EA4E946E9)]
+interface IAccessibleKeyBinding : IUnknown
+{
+ ///
+ /// get number of key bindings for this object
+ ///
+ [propget] HRESULT nKeyBindings
+ (
+ [out, retval] long *nKeyBindings
+ );
+
+ ///
+ /// get length of keystroke sequence for specified key binding
+ ///
+ [propget] HRESULT keyStrokeSequenceLength
+ (
+ [in] long keyBindingIndex,
+ [out] long *sequenceLength
+ );
+
+ ///
+ /// The returned sequence of key strokes describes one method
+ /// to invoke the associated action (the one from which you
+ /// obtained the object at which you called this method) by
+ /// pressing keys. The keys specified by each of the returned
+ /// key strokes have to be pressed at the same time (the
+ /// Control-key and the A-key for example). The keys of one key
+ /// stroke have to be released before pressing those of the next.
+ /// The order of the key strokes in the sequence define the order
+ /// in which to press them.
+ ///
+ [propget] HRESULT keyBinding
+ (
+ [in] long keyBindingIndex,
+ [in] long keyStrokeSequenceLength,
+ [out, size_is(,keyStrokeSequenceLength), length_is(,*actualKeyStrokeSequenceLength)]
+ ACCESSIBLE_KEYSTROKE **keyStroke,
+ [out, retval] long *actualKeyStrokeSequenceLength
+ );
+}
diff --git a/winaccessibility/source/UAccCOMIDL/AccessibleKeyStroke.idl b/winaccessibility/source/UAccCOMIDL/AccessibleKeyStroke.idl
new file mode 100644
index 000000000000..7e74497ee8cc
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/AccessibleKeyStroke.idl
@@ -0,0 +1,149 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+typedef struct _ACCESSIBLE_KEYSTROKE {
+ short modifiers;
+ short keyCode;
+ char keyChar;
+ short keyFunc;
+} ACCESSIBLE_KEYSTROKE;
+
+const short MODIFIER_SHIFT = 1;
+const short MODIFIER_CTRL = 2;
+const short MODIFIER_ALT = 4;
+
+const short KEYCODE_NUM0 = 256;
+const short KEYCODE_NUM1 = 257;
+const short KEYCODE_NUM2 = 258;
+const short KEYCODE_NUM3 = 259;
+const short KEYCODE_NUM4 = 260;
+const short KEYCODE_NUM5 = 261;
+const short KEYCODE_NUM6 = 262;
+const short KEYCODE_NUM7 = 263;
+const short KEYCODE_NUM8 = 264;
+const short KEYCODE_NUM9 = 265;
+const short KEYCODE_A = 512;
+const short KEYCODE_B = 513;
+const short KEYCODE_C = 514;
+const short KEYCODE_D = 515;
+const short KEYCODE_E = 516;
+const short KEYCODE_F = 517;
+const short KEYCODE_G = 518;
+const short KEYCODE_H = 519;
+const short KEYCODE_I = 520;
+const short KEYCODE_J = 521;
+const short KEYCODE_K = 522;
+const short KEYCODE_L = 523;
+const short KEYCODE_M = 524;
+const short KEYCODE_N = 525;
+const short KEYCODE_O = 526;
+const short KEYCODE_P = 527;
+const short KEYCODE_Q = 528;
+const short KEYCODE_R = 529;
+const short KEYCODE_S = 530;
+const short KEYCODE_T = 531;
+const short KEYCODE_U = 532;
+const short KEYCODE_V = 533;
+const short KEYCODE_W = 534;
+const short KEYCODE_X = 535;
+const short KEYCODE_Y = 536;
+const short KEYCODE_Z = 537;
+const short KEYCODE_F1 = 768;
+const short KEYCODE_F2 = 769;
+const short KEYCODE_F3 = 770;
+const short KEYCODE_F4 = 771;
+const short KEYCODE_F5 = 772;
+const short KEYCODE_F6 = 773;
+const short KEYCODE_F7 = 774;
+const short KEYCODE_F8 = 775;
+const short KEYCODE_F9 = 776;
+const short KEYCODE_F10 = 777;
+const short KEYCODE_F11 = 778;
+const short KEYCODE_F12 = 779;
+const short KEYCODE_F13 = 780;
+const short KEYCODE_F14 = 781;
+const short KEYCODE_F15 = 782;
+const short KEYCODE_F16 = 783;
+const short KEYCODE_F17 = 784;
+const short KEYCODE_F18 = 785;
+const short KEYCODE_F19 = 786;
+const short KEYCODE_F20 = 787;
+const short KEYCODE_F21 = 788;
+const short KEYCODE_F22 = 789;
+const short KEYCODE_F23 = 790;
+const short KEYCODE_F24 = 791;
+const short KEYCODE_F25 = 792;
+const short KEYCODE_F26 = 793;
+const short KEYCODE_DOWN = 1024;
+const short KEYCODE_UP = 1025;
+const short KEYCODE_LEFT = 1026;
+const short KEYCODE_RIGHT = 1027;
+const short KEYCODE_HOME = 1028;
+const short KEYCODE_END = 1029;
+const short KEYCODE_PAGEUP = 1030;
+const short KEYCODE_PAGEDOWN = 1031;
+const short KEYCODE_RETURN = 1280;
+const short KEYCODE_ESCAPE = 1281;
+const short KEYCODE_TAB = 1282;
+const short KEYCODE_BACKSPACE = 1283;
+const short KEYCODE_SPACE = 1284;
+const short KEYCODE_INSERT = 1285;
+const short KEYCODE_DELETE = 1286;
+const short KEYCODE_ADD = 1287;
+const short KEYCODE_SUBTRACT = 1288;
+const short KEYCODE_MULTIPLY = 1289;
+const short KEYCODE_DIVIDE = 1290;
+const short KEYCODE_POINT = 1291;
+const short KEYCODE_COMMA = 1292;
+const short KEYCODE_LESS = 1293;
+const short KEYCODE_GREATER = 1294;
+const short KEYCODE_EQUAL = 1295;
+const short KEYCODE_OPEN = 1296;
+const short KEYCODE_CUT = 1297;
+const short KEYCODE_COPY = 1298;
+const short KEYCODE_PASTE = 1299;
+const short KEYCODE_UNDO = 1300;
+const short KEYCODE_REPEAT = 1301;
+const short KEYCODE_FIND = 1302;
+const short KEYCODE_PROPERTIES = 1303;
+const short KEYCODE_FRONT = 1304;
+const short KEYCODE_CONTEXTMENU = 1305;
+const short KEYCODE_HELP = 1306;
+
+const short SHORTCUT_DONTKNOW = 0;
+const short NEW = 1;
+const short OPEN = 2;
+const short SAVE = 3;
+const short SAVEAS = 4;
+const short PRINT = 5;
+const short CLOSE = 6;
+const short QUIT = 7;
+const short CUT = 8;
+const short COPY = 9;
+const short PASTE = 10;
+const short UNDO = 11;
+const short REDO = 12;
+const short UNODELETE = 13;
+const short REPEAT = 14;
+const short FIND = 15;
+const short FINDBACKWARD = 16;
+const short PROPERTIES = 17;
+const short FRONT = 18;
diff --git a/winaccessibility/source/UAccCOMIDL/Charset.idl b/winaccessibility/source/UAccCOMIDL/Charset.idl
new file mode 100644
index 000000000000..059573224268
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/Charset.idl
@@ -0,0 +1,33 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+const short CHARSET_DONTKNOW = 0;
+const short ANSI = 1;
+const short MAC = 2;
+const short IBMPC_437 = 3;
+const short IBMPC_850 = 4;
+const short IBMPC_860 = 5;
+const short IBMPC_861 = 6;
+const short IBMPC_863 = 7;
+const short IBMPC_865 = 8;
+const short CHARSET_SYSTEM = 9;
+const short SYMBOL = 10;
diff --git a/winaccessibility/source/UAccCOMIDL/UAccCOM.idl b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
new file mode 100644
index 000000000000..c1de789fbdaa
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
@@ -0,0 +1,209 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+import "ia2_api_all.idl";
+import "defines.idl";
+
+ [
+ object,
+ uuid(D00F5EB7-588A-487F-A6F6-0B5D7D1815AA),
+ dual,
+ helpstring("IMAccessible Interface"),
+ pointer_default(unique)
+ ]
+ interface IMAccessible : IAccessible2
+ {
+ [id(1), helpstring("method Put_XAccName")] HRESULT Put_XAccName(const OLECHAR* pszName);
+ [id(2), helpstring("method Put_XAccRole")] HRESULT Put_XAccRole(unsigned short pRole);
+ [id(3), helpstring("method DecreaseState")] HRESULT DecreaseState(DWORD pXSate);
+ [id(4), helpstring("method IncreaseState")] HRESULT IncreaseState(DWORD pXSate);
+ [id(5), helpstring("method Put_XDescription")] HRESULT Put_XAccDescription(const OLECHAR* pszDescription);
+ [id(6), helpstring("method Put_XAccValue")] HRESULT Put_XAccValue(const OLECHAR* pszAccValue);
+ [id(7), helpstring("method SetState")] HRESULT SetState(DWORD pXSate);
+ [id(8), helpstring("method Put_XAccLocation")] HRESULT Put_XAccLocation(const Location sLocation);
+ [id(9), helpstring("method Put_XAccFocus")] HRESULT Put_XAccFocus(long dChildID);
+ [id(10), helpstring("method Put_XAccParent")] HRESULT Put_XAccParent(IMAccessible* pIParent);
+ [id(13), helpstring("method Put_XAccWindowHandle")] HRESULT Put_XAccWindowHandle(HWND hwnd);
+ [id(14), helpstring("method Put_XAccChildID")] HRESULT Put_XAccChildID(long dChildID);
+ [id(19), helpstring("method SetXAccessible")] HRESULT SetXAccessible( long XAccessible);
+ [id(20), helpstring("method GetUNOInterface")] HRESULT GetUNOInterface(long* UNOInterface);
+ [id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(long pAction);
+ [id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction);
+ [id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(long pAgent);
+ [id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(BOOL isDestroy);
+ [id(30), helpstring("method Get_XAccChildID")] HRESULT Get_XAccChildID([out,retval] long* childID);
+ };
+ [
+ object,
+ uuid(951299EE-1841-4249-9E07-812C0739E489),
+ dual,
+ helpstring("IEnumVariant Interface"),
+ pointer_default(unique)
+ ]
+ interface IEnumVariant : IEnumVARIANT
+ {
+ [id(1), helpstring("method ClearEnumeration")] HRESULT ClearEnumeration();
+ [id(2), helpstring("method PutSelection")] HRESULT PutSelection(long pXSeletion);
+ };
+ [
+ object,
+ uuid(6641185C-E099-4C45-B753-3FBC0EE40646),
+ dual,
+ helpstring("IUNOXWrapper Interface"),
+ pointer_default(unique)
+ ]
+ interface IUNOXWrapper : IUnknown
+ {
+ [id(1), helpstring("method put_XInterface")] HRESULT put_XInterface(long pXInterface);
+ [id(2), helpstring("method put_XSubInterface")] HRESULT put_XSubInterface(long pXSubInterface);
+ [id(3), helpstring("method get_XInterface")] HRESULT get_XInterface([out,retval]long* pXInterface);
+ [id(4), helpstring("method get_XSubInterface")] HRESULT get_XSubInterface([out,retval]long* pXSubInterface);
+ };
+
+[
+ uuid(19ECB1B0-9376-4FF9-B580-223FC9C200B8),
+ version(1.0),
+ helpstring("UAccCOM 1.0 Type Library")
+]
+library UACCCOMLib
+{
+ importlib("stdole32.tlb");
+ importlib("stdole2.tlb");
+ importlib("oleacc.dll");
+
+ [
+ uuid(CF8DF8BA-44FE-4B10-BD2E-8C8CB322485F),
+ helpstring("MAccessible Class")
+ ]
+ coclass MAccessible
+ {
+ [default] interface IMAccessible;
+ };
+ [
+ uuid(152884E0-268B-4481-9AE7-1B372D3AA97F),
+ helpstring("EnumVariant Class")
+ ]
+ coclass EnumVariant
+ {
+ [default] interface IEnumVariant;
+ };
+ [
+ uuid(AA360FB0-BC98-41C1-A885-BB921F5ED601),
+ helpstring("UNOXWrapper Class")
+ ]
+ coclass UNOXWrapper
+ {
+ [default] interface IUNOXWrapper;
+ };
+
+ [
+ uuid(9FD9BA47-70AF-4160-99F1-526F2B9F111B),
+ helpstring("AccComponent Class")
+ ]
+ coclass AccComponent
+ {
+ [default] interface IAccessibleComponent;
+ };
+
+ [
+ uuid(8745CF0C-3104-4BAE-B7D0-D7B1717C006E),
+ helpstring("AccRelation Class")
+ ]
+ coclass AccRelation
+ {
+ [default] interface IAccessibleRelation;
+ };
+ [
+ uuid(AA49F20E-BB4E-400D-A5B0-6F5B7B770227),
+ helpstring("AccAction Class")
+ ]
+ coclass AccAction
+ {
+ [default] interface IAccessibleAction;
+ };
+
+ [
+ uuid(6D8AB08B-CCE9-471E-8A41-35773D5263F5),
+ helpstring("AccText Class")
+ ]
+ coclass AccText
+ {
+ [default] interface IAccessibleText;
+ };
+
+ [
+ uuid(79CE1450-1F61-48E2-BF76-C07BD10105E2),
+ helpstring("AccEditableText Class")
+ ]
+ coclass AccEditableText
+ {
+ [default] interface IAccessibleEditableText;
+ };
+
+ [
+ uuid(CC55D71B-1828-4EE0-89E2-C3749CF9C9AB),
+ helpstring("AccHypertext Class")
+ ]
+ coclass AccHypertext
+ {
+ [default] interface IAccessibletext;
+ };
+
+
+ [
+ uuid(73A45800-7A62-432C-A1A6-BF8852994331),
+ helpstring("AccImage Class")
+ ]
+ coclass AccImage
+ {
+ [default] interface IAccessibleImage;
+ };
+
+ [
+ uuid(730A561B-1AF6-49E1-9C04-9A2F48CD8512),
+ helpstring("AccValue Class")
+ ]
+ coclass AccValue
+ {
+ [default] interface IAccessibleValue;
+ };
+ [
+ uuid(92BAA62D-535A-4EAB-9ABB-BFA60B7A6DB6),
+ helpstring("AccTable Class")
+ ]
+ coclass AccTable
+ {
+ [default] interface IAccessibleTable;
+ };
+
+ [
+ uuid(519A64CD-F6A6-4793-BE50-4E36C4C593EF),
+ helpstring("AccHyperLink Class")
+ ]
+ coclass AccHyperLink
+ {
+ [default] interface IAccessibleAction;
+ };
+
+};
diff --git a/winaccessibility/source/UAccCOMIDL/defines.idl b/winaccessibility/source/UAccCOMIDL/defines.idl
new file mode 100644
index 000000000000..dc4e9aababb6
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/defines.idl
@@ -0,0 +1,40 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+import "objidl.idl";
+import "oaidl.idl";
+import "oleacc.idl";
+
+interface IMAccessible;
+
+const long UACC_NO_FOCUS=0xFFFF;
+
+typedef struct {
+ long m_dChildID;//identify a unique child node
+ IMAccessible* m_pIMAccessible;
+}AccChildNode;
+
+typedef struct Location {
+ long m_dLeft;
+ long m_dTop;
+ long m_dWidth;
+ long m_dHeight;
+}Location;
diff --git a/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl b/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl
new file mode 100644
index 000000000000..04a2e7b76349
--- /dev/null
+++ b/winaccessibility/source/UAccCOMIDL/ia2_api_all.idl
@@ -0,0 +1,5473 @@
+/*************************************************************************
+ *
+ * File Name (api_all_headers.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2013 Linux Foundation
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+import "objidl.idl";
+import "oaidl.idl";
+import "oleacc.idl";
+
+/*************************************************************************
+ *
+ * File Name (IA2CommonTypes.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+ /** These constants control the scrolling of an object or substring into a window.
+
+ This enum is used in IAccessible2::scrollTo and IAccessibleText::scrollSubstringTo.
+*/
+enum IA2ScrollType {
+
+ /** Scroll the top left corner of the object or substring such that the top left
+ corner (and as much as possible of the rest of the object or substring) is within
+ the top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_TOP_LEFT,
+
+ /** Scroll the bottom right corner of the object or substring such that the bottom right
+ corner (and as much as possible of the rest of the object or substring) is within
+ the top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_BOTTOM_RIGHT,
+
+ /** Scroll the top edge of the object or substring such that the top edge
+ (and as much as possible of the rest of the object or substring) is within the
+ top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_TOP_EDGE,
+
+ /** Scroll the bottom edge of the object or substring such that the bottom edge
+ (and as much as possible of the rest of the object or substring) is within the
+ top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_BOTTOM_EDGE,
+
+ /** Scroll the left edge of the object or substring such that the left edge
+ (and as much as possible of the rest of the object or substring) is within the
+ top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_LEFT_EDGE,
+
+ /** Scroll the right edge of the object or substring such that the right edge
+ (and as much as possible of the rest of the object or substring) is within the
+ top level window. In cases where the entire object or substring fits within
+ the top level window, the placement of the object or substring is dependent on
+ the application. For example, the object or substring may be scrolled to the
+ closest edge, the furthest edge, or midway between those two edges. In cases
+ where there is a hierarchy of nested scrollable controls, more than one control
+ may have to be scrolled.
+ */
+ IA2_SCROLL_TYPE_RIGHT_EDGE,
+
+ /** Scroll the object or substring such that as much as possible of the
+ object or substring is within the top level window. The placement of
+ the object is dependent on the application. For example, the object or
+ substring may be scrolled to to closest edge, the furthest edge, or midway
+ between those two edges.
+ */
+ IA2_SCROLL_TYPE_ANYWHERE
+};
+
+/** These constants define which coordinate system a point is located in.
+
+ This enum is used in IAccessible2::scrollToPoint, IAccessibleImage::imagePosition,
+ IAccessibleText::characterExtents, and IAccessibleText::offsetAtPoint, and
+ IAccessibleText::scrollSubstringToPoint.
+*/
+enum IA2CoordinateType {
+
+ /// The coordinates are relative to the screen.
+ IA2_COORDTYPE_SCREEN_RELATIVE,
+
+ /** The coordinates are relative to the upper left corner of the bounding box
+ of the immediate parent.
+ */
+ IA2_COORDTYPE_PARENT_RELATIVE
+
+};
+
+/** Special offsets for use in IAccessibleText and IAccessibleEditableText methods
+
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for more information.
+*/
+enum IA2TextSpecialOffsets {
+ IA2_TEXT_OFFSET_LENGTH = -1, /**< This offset is equivalent to the length of the string. It eliminates
+ the need to call IAccessibleText::nCharacters. */
+ IA2_TEXT_OFFSET_CARET = -2 /**< This offset signifies that the text related to the physical location
+ of the caret should be used. */
+};
+
+/** These constants specify the kind of change made to a table.
+
+ This enum is used in the IA2TableModelChange struct which in turn is used by
+ IAccessibleTable::modelChange and IAccessibleTable2::modelChange.
+*/
+enum IA2TableModelChangeType {
+ IA2_TABLE_MODEL_CHANGE_INSERT, // = 0;
+ IA2_TABLE_MODEL_CHANGE_DELETE,
+ IA2_TABLE_MODEL_CHANGE_UPDATE
+};
+
+/** A structure defining the type of and extents of changes made to a table
+
+ IAccessibleTable::modelChange and IAccessibleTable2::modelChange return this struct.
+ In the case of an insertion or change the row and column offsets define the boundaries
+ of the inserted or changed subtable after the operation. In the case of a deletion
+ the row and column offsets define the boundaries of the subtable being removed before
+ the removal.
+*/
+typedef struct IA2TableModelChange {
+ enum IA2TableModelChangeType type; // insert, delete, update
+ long firstRow; ///< 0 based, inclusive
+ long lastRow; ///< 0 based, inclusive
+ long firstColumn; ///< 0 based, inclusive
+ long lastColumn; ///< 0 based, inclusive
+} IA2TableModelChange;
+/*************************************************************************
+ *
+ * File Name (AccessibleRelation.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+/** @defgroup grpRelations Relations
+ Use the following constants to compare against the BSTRs returned by
+ IAccessibleRelation::relationType.
+*/
+///@{
+
+/** The target object is the containing application object. */
+const WCHAR *const IA2_RELATION_CONTAINING_APPLICATION = L"containingApplication";
+
+/** The target object is the containing document object. The target object implements
+ the IAccessibleDocument interface.
+*/
+const WCHAR *const IA2_RELATION_CONTAINING_DOCUMENT = L"containingDocument";
+
+/** The target object is the containing tab pane object. */
+const WCHAR *const IA2_RELATION_CONTAINING_TAB_PANE = L"containingTabPane";
+
+/** The target object is the containing window object. */
+const WCHAR *const IA2_RELATION_CONTAINING_WINDOW = L"containingWindow";
+
+/** Some attribute of this object is affected by a target object. */
+const WCHAR *const IA2_RELATION_CONTROLLED_BY = L"controlledBy";
+
+/** This object is interactive and controls some attribute of a target object. */
+const WCHAR *const IA2_RELATION_CONTROLLER_FOR = L"controllerFor";
+
+/** This object is described by the target object. */
+const WCHAR *const IA2_RELATION_DESCRIBED_BY = L"describedBy";
+
+/** This object is describes the target object. */
+const WCHAR *const IA2_RELATION_DESCRIPTION_FOR = L"descriptionFor";
+
+/** This object is embedded by a target object. */
+const WCHAR *const IA2_RELATION_EMBEDDED_BY = L"embeddedBy";
+
+/** This object embeds a target object. This relation can be used on the
+ OBJID_CLIENT accessible for a top level window to show where the content
+ areas are.
+*/
+const WCHAR *const IA2_RELATION_EMBEDS = L"embeds";
+
+/** Content flows to this object from a target object.
+ This relation and IA2_RELATION_FLOWS_TO are useful to tie text and non-text
+ objects together in order to allow assistive technology to follow the
+ intended reading order.
+*/
+const WCHAR *const IA2_RELATION_FLOWS_FROM = L"flowsFrom";
+
+/** Content flows from this object to a target object. */
+const WCHAR *const IA2_RELATION_FLOWS_TO = L"flowsTo";
+
+/** This object is label for a target object. */
+const WCHAR *const IA2_RELATION_LABEL_FOR = L"labelFor";
+
+/** This object is labelled by a target object. Note that the double L spelling
+ which follows is preferred. Please use it instead. This single L version may
+ be removed in a later version.
+*/
+const WCHAR *const IA2_RELATION_LABELED_BY = L"labelledBy";
+
+/** This object is labelled by a target object. */
+const WCHAR *const IA2_RELATION_LABELLED_BY = L"labelledBy";
+
+/** This object is a member of a group of one or more objects. When
+ there is more than one object in the group each member may have one and the
+ same target, e.g. a grouping object. It is also possible that each member has
+ multiple additional targets, e.g. one for every other member in the group.
+*/
+const WCHAR *const IA2_RELATION_MEMBER_OF = L"memberOf";
+
+/** The target object is the next object in the tab order. */
+const WCHAR *const IA2_RELATION_NEXT_TABBABLE = L"nextTabbable";
+
+/** This object is a logical child of a target object. This relation is the reciprocal
+ of the IA2_RELATION_NODE_PARENT_OF relation. In some cases an application's accessible
+ tree is such that objects can be in a logical parent-child relationship which is
+ different from the hierarchy of the accessible tree. */
+const WCHAR *const IA2_RELATION_NODE_CHILD_OF = L"nodeChildOf";
+
+/** This object is a logical parent of a target object. This relation is the reciprocal
+ of the IA2_RELATION_NODE_CHILD_OF relation. In some cases an application's accessible
+ tree is such that objects can be in a logical parent-child relationship which is
+ different from the hierarchy of the accessible tree. */
+const WCHAR *const IA2_RELATION_NODE_PARENT_OF = L"nodeParentOf";
+
+/** This object is a parent window of the target object. */
+const WCHAR *const IA2_RELATION_PARENT_WINDOW_OF = L"parentWindowOf";
+
+/** This object is a transient component related to the target object.
+ When this object is activated the target object doesn't lose focus.
+*/
+const WCHAR *const IA2_RELATION_POPUP_FOR = L"popupFor";
+
+/** The target object is the previous object in the tab order. */
+const WCHAR *const IA2_RELATION_PREVIOUS_TABBABLE = L"previousTabbable";
+
+/** This object is a sub window of a target object. */
+const WCHAR *const IA2_RELATION_SUBWINDOW_OF = L"subwindowOf";
+
+///@}
+
+/** This interface gives access to an object's set of relations.
+*/
+[object, uuid(7CDF86EE-C3DA-496a-BDA4-281B336E1FDC)]
+interface IAccessibleRelation : IUnknown
+{
+ /** @brief Returns the type of the relation.
+ @param [out] relationType
+ The strings returned are defined @ref grpRelations "in this section of the documentation".
+ @retval S_OK
+ */
+ [propget] HRESULT relationType
+ (
+ [out, retval] BSTR *relationType
+ );
+
+ /** @brief Returns a localized version of the relation type.
+ @param [out] localizedRelationType
+ @retval S_OK
+ */
+ [propget] HRESULT localizedRelationType
+ (
+ [out, retval] BSTR *localizedRelationType
+ );
+
+ /** @brief Returns the number of targets for this relation.
+ @param [out] nTargets
+ @retval S_OK
+ */
+ [propget] HRESULT nTargets
+ (
+ [out, retval] long *nTargets
+ );
+
+ /** @brief Returns one accessible relation target.
+ @param [in] targetIndex
+ 0 based index
+ @param [out] target
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Use QueryInterface to get IAccessible2.
+ */
+ [propget] HRESULT target
+ (
+ [in] long targetIndex,
+ [out, retval] IUnknown **target
+ );
+
+ /** @brief Returns multiple accessible relation targets
+ @param [in] maxTargets
+ maximum size of the array allocated by the client
+ @param [out] targets
+ The array of target objects. Note that this array is to be allocated by the
+ client and freed when no longer needed. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details. You will need to use
+ QueryInterface on the IUnknown to get the IAccessible2.
+ @param [out] nTargets
+ actual number of targets in the returned array (not more than maxTargets)
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, e.g. a negative value
+ */
+ [propget] HRESULT targets
+ (
+ [in] long maxTargets,
+ [out, size_is(maxTargets), length_is(*nTargets)]
+ IUnknown **targets,
+ [out, retval] long *nTargets
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleAction.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+/** This enum defines values which are predefined actions for use when implementing
+ support for media.
+
+ This enum is used when specifying an action for IAccessibleAction::doAction.
+*/
+
+enum IA2Actions {
+ IA2_ACTION_OPEN = -1, /**< Used to inform the server that the client will
+ signal via IA2_ACTION_COMPLETE when it has consumed
+ the content provided by the object. This action
+ allows the object's server to wait for all clients
+ to signal their readiness for additional content.
+ Any form of content generation that requires
+ synchronization with an AT would require use of this
+ action. One example is the generation of text describing
+ visual content not obvious from a video's sound track.
+ In this scenario the Text to Speech or Braille output
+ may take more time than the related length of silence
+ in the video's sound track. */
+ IA2_ACTION_COMPLETE = -2, /**< Used by the client to inform the server that it has
+ consumed the most recent content provided by this object. */
+ IA2_ACTION_CLOSE = -3 /**< Used to inform the server that the client no longer
+ requires synchronization. */
+};
+
+/** @brief This interface gives access to actions that can be executed
+ for accessible objects.
+
+ Every accessible object that can be manipulated via the native GUI beyond the
+ methods available either in the MSAA IAccessible interface or in the set of
+ IAccessible2 interfaces (other than this IAccessibleAction interface) should
+ support the IAccessibleAction interface in order to provide Assistive Technology
+ access to all the actions that can be performed by the object. Each action can
+ be performed or queried for a name, description or associated key bindings.
+ Actions are needed more for ATs that assist the mobility impaired, such as
+ on-screen keyboards and voice command software. By providing actions directly,
+ the AT can present them to the user without the user having to perform the extra
+ steps to navigate a context menu.
+
+ The first action should be equivalent to the MSAA default action. If there is
+ only one action, %IAccessibleAction should also be implemented.
+*/
+[object, uuid(B70D9F59-3B5A-4dba-AB9E-22012F607DF5)]
+interface IAccessibleAction : IUnknown
+{
+
+ /** @brief Returns the number of accessible actions available in this object.
+
+ If there are more than one, the first one is considered the
+ "default" action of the object.
+ @param [out] nActions
+ The returned value of the number of actions is zero if there are
+ no actions.
+ @retval S_OK
+ @note This method is missing a [propget] prefix in the IDL. The result is the
+ method is named nActions in generated C++ code instead of get_nActions.
+ */
+ HRESULT nActions
+ (
+ [out,retval] long* nActions
+ );
+
+ /** @brief Performs the specified Action on the object.
+ @param [in] actionIndex
+ 0 based index specifying the action to perform. If it lies outside
+ the valid range no action is performed.
+ @retval S_OK
+ @retval S_FALSE if action could not be performed
+ @retval E_INVALIDARG if bad [in] passed
+ @note If implementing support for media, refer to the predefined constants in the ::IA2Actions enum.
+ */
+ HRESULT doAction
+ (
+ [in] long actionIndex
+ );
+
+ /** @brief Returns a description of the specified action of the object.
+ @param [in] actionIndex
+ 0 based index specifying which action's description to return.
+ If it lies outside the valid range an empty string is returned.
+ @param [out] description
+ The returned value is a localized string of the specified action.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT description
+ (
+ [in] long actionIndex,
+ [out, retval] BSTR *description
+ );
+
+ /** @brief Returns an array of BSTRs describing one or more key bindings, if
+ there are any, associated with the specified action.
+
+ The returned strings are the localized human readable key sequences to be
+ used to activate each action, e.g. "Ctrl+Shift+D". Since these key
+ sequences are to be used when the object has focus, they are like
+ mnemonics (access keys), and not like shortcut (accelerator) keys.
+
+ There is no need to implement this method for single action controls since
+ that would be redundant with the standard MSAA programming practice of
+ getting the mnemonic from get_accKeyboardShortcut.
+
+ An AT such as an On Screen Keyboard might not expose these bindings but
+ provide alternative means of activation.
+
+ Note: the client allocates and passes in an array of pointers. The server
+ allocates the BSTRs and passes back one or more pointers to these BSTRs into
+ the array of pointers allocated by the client. The client is responsible
+ for deallocating the BSTRs.
+
+ @param [in] actionIndex
+ 0 based index specifying which action's key bindings should be returned.
+ @param [in] nMaxBindings
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] keyBindings
+ An array of BSTRs, allocated by the server, one for each key binding.
+ The client must free it with CoTaskMemFree.
+ @param [out] nBindings
+ The number of key bindings returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are no key bindings, [out] values are NULL and 0 respectively
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT keyBinding
+ (
+ [in] long actionIndex,
+ [in] long nMaxBindings,
+ [out, size_is(,nMaxBindings), length_is(,*nBindings)] BSTR **keyBindings,
+ [out, retval] long *nBindings
+ );
+
+ /** @brief Returns the non-localized name of specified action.
+ @param [in] actionIndex
+ 0 based index specifying which action's non-localized name should be returned.
+ @param [out] name
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT name
+ (
+ [in] long actionIndex,
+ [out, retval] BSTR *name
+ );
+
+ /** @brief Returns the localized name of specified action.
+ @param [in] actionIndex
+ 0 based index specifying which action's localized name should be returned.
+ @param [out] localizedName
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT localizedName
+ (
+ [in] long actionIndex,
+ [out, retval] BSTR *localizedName
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleRole.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+/** Collection of roles
+
+ This enumerator defines an extended set of accessible roles of objects implementing
+ the %IAccessible2 interface. These roles are in addition to the MSAA roles obtained
+ through the MSAA get_accRole method. Examples are 'footnote', 'heading', and
+ 'label'. You obtain an object's %IAccessible2 roles by calling IAccessible2::role.
+*/
+enum IA2Role {
+
+ /** Unknown role. The object contains some Accessible information, but its
+ role is not known.
+ */
+ IA2_ROLE_UNKNOWN = 0,
+
+ /** An object that can be drawn into and to manage events from the objects
+ drawn into it. Also refer to ::IA2_ROLE_FRAME,
+ ::IA2_ROLE_GLASS_PANE, and ::IA2_ROLE_LAYERED_PANE.
+ */
+ IA2_ROLE_CANVAS = 0x401,
+
+ /// A caption describing another object.
+ IA2_ROLE_CAPTION,
+
+ /// Used for check buttons that are menu items.
+ IA2_ROLE_CHECK_MENU_ITEM,
+
+ /// A specialized dialog that lets the user choose a color.
+ IA2_ROLE_COLOR_CHOOSER,
+
+ /// A date editor.
+ IA2_ROLE_DATE_EDITOR,
+
+ /** An iconified internal frame in an ::IA2_ROLE_DESKTOP_PANE.
+ Also refer to ::IA2_ROLE_INTERNAL_FRAME.
+ */
+ IA2_ROLE_DESKTOP_ICON,
+
+ /** A desktop pane. A pane that supports internal frames and iconified
+ versions of those internal frames. Also refer to ::IA2_ROLE_INTERNAL_FRAME.
+ */
+ IA2_ROLE_DESKTOP_PANE,
+
+ /** A directory pane. A pane that allows the user to navigate through
+ and select the contents of a directory. May be used by a file chooser.
+ Also refer to ::IA2_ROLE_FILE_CHOOSER.
+ */
+ IA2_ROLE_DIRECTORY_PANE,
+
+ /** An editable text object in a toolbar. <b>Deprecated.</b>
+ The edit bar role was meant for a text area in a tool bar. However, to detect
+ a text area in a tool bar the AT can query the parent.
+ */
+ IA2_ROLE_EDITBAR,
+
+ /// Embedded (OLE) object.
+ IA2_ROLE_EMBEDDED_OBJECT,
+
+ /// Text that is used as an endnote (footnote at the end of a chapter or section).
+ IA2_ROLE_ENDNOTE,
+
+ /** A file chooser. A specialized dialog that displays the files in the
+ directory and lets the user select a file, browse a different directory,
+ or specify a filename. May use the directory pane to show the contents of
+ a directory.
+ Also refer to ::IA2_ROLE_DIRECTORY_PANE.
+ */
+ IA2_ROLE_FILE_CHOOSER,
+
+ /** A font chooser. A font chooser is a component that lets the user pick
+ various attributes for fonts.
+ */
+ IA2_ROLE_FONT_CHOOSER,
+
+ /** Footer of a document page.
+ Also refer to ::IA2_ROLE_HEADER.
+ */
+ IA2_ROLE_FOOTER,
+
+ /// Text that is used as a footnote. Also refer to ::IA2_ROLE_ENDNOTE.
+ IA2_ROLE_FOOTNOTE,
+
+ /** A container of form controls. An example of the use of this role is to
+ represent an HTML FORM tag.
+ */
+ IA2_ROLE_FORM,
+
+ /** Frame role. A top level window with a title bar, border, menu bar, etc.
+ It is often used as the primary window for an application. Also refer to
+ ::IA2_ROLE_CANVAS and the MSAA roles of dialog and window.
+ */
+ IA2_ROLE_FRAME,
+
+ /** A glass pane. A pane that is guaranteed to be painted on top of all panes
+ beneath it. Also refer to ::IA2_ROLE_CANVAS, ::IA2_ROLE_INTERNAL_FRAME, and
+ ::IA2_ROLE_ROOT_PANE.
+ */
+ IA2_ROLE_GLASS_PANE,
+
+ /** Header of a document page.
+ Also refer to ::IA2_ROLE_FOOTER.
+ */
+ IA2_ROLE_HEADER,
+
+ /// Heading. Use the IAccessible2::attributes level attribute to determine the heading level.
+ IA2_ROLE_HEADING,
+
+ /// A small fixed size picture, typically used to decorate components.
+ IA2_ROLE_ICON,
+
+ /** An image map object. Usually a graphic with multiple hotspots, where
+ each hotspot can be activated resulting in the loading of another document
+ or section of a document.
+ */
+ IA2_ROLE_IMAGE_MAP,
+
+ /** An object which is used to allow input of characters not found on a keyboard,
+ such as the input of Chinese characters on a Western keyboard.
+ */
+ IA2_ROLE_INPUT_METHOD_WINDOW,
+
+ /** An internal frame. A frame-like object that is clipped by a desktop pane.
+ The desktop pane, internal frame, and desktop icon objects are often used to
+ create multiple document interfaces within an application.
+ Also refer to ::IA2_ROLE_DESKTOP_ICON, ::IA2_ROLE_DESKTOP_PANE, and ::IA2_ROLE_FRAME.
+ */
+ IA2_ROLE_INTERNAL_FRAME,
+
+ /// An object used to present an icon or short string in an interface.
+ IA2_ROLE_LABEL,
+
+ /** A layered pane. A specialized pane that allows its children to be drawn
+ in layers, providing a form of stacking order. This is usually the pane that
+ holds the menu bar as well as the pane that contains most of the visual
+ components in a window.
+ Also refer to ::IA2_ROLE_CANVAS, ::IA2_ROLE_GLASS_PANE, and ::IA2_ROLE_ROOT_PANE.
+ */
+ IA2_ROLE_LAYERED_PANE,
+
+ /** A section whose content is parenthetic or ancillary to the main content
+ of the resource.
+ */
+ IA2_ROLE_NOTE,
+
+ /** A specialized pane whose primary use is inside a dialog.
+ Also refer to MSAA's dialog role.
+ */
+ IA2_ROLE_OPTION_PANE,
+
+ /** An object representing a page of document content. It is used in documents
+ which are accessed by the user on a page by page basis.
+ */
+ IA2_ROLE_PAGE,
+
+ /// A paragraph of text.
+ IA2_ROLE_PARAGRAPH,
+
+ /** A radio button that is a menu item.
+ Also refer to MSAA's button and menu item roles.
+ */
+ IA2_ROLE_RADIO_MENU_ITEM,
+
+ /** An object which is redundant with another object in the accessible hierarchy.
+ ATs typically ignore objects with this role.
+ */
+ IA2_ROLE_REDUNDANT_OBJECT,
+
+ /** A root pane. A specialized pane that has a glass pane and a layered pane
+ as its children.
+ Also refer to ::IA2_ROLE_GLASS_PANE and ::IA2_ROLE_LAYERED_PANE
+ */
+ IA2_ROLE_ROOT_PANE,
+
+ /** A ruler such as those used in word processors.
+ */
+ IA2_ROLE_RULER,
+
+ /** A scroll pane. An object that allows a user to incrementally view a large
+ amount of information. Its children can include scroll bars and a viewport.
+ Also refer to ::IA2_ROLE_VIEW_PORT and MSAA's scroll bar role.
+ */
+ IA2_ROLE_SCROLL_PANE,
+
+ /** A container of document content. An example of the use of this role is to
+ represent an HTML DIV tag. A section may be used as a region. A region is a
+ group of elements that together form a perceivable unit. A region does not
+ necessarily follow the logical structure of the content, but follows the
+ perceivable structure of the page. A region may have an attribute in the set
+ of IAccessible2::attributes which indicates that it is "live". A live region
+ is content that is likely to change in response to a timed change, a user
+ event, or some other programmed logic or event.
+ */
+ IA2_ROLE_SECTION,
+
+ /// Object with graphical representation used to represent content on draw pages.
+ IA2_ROLE_SHAPE,
+
+ /** A split pane. A specialized panel that presents two other panels at the
+ same time. Between the two panels is a divider the user can manipulate to make
+ one panel larger and the other panel smaller.
+ */
+ IA2_ROLE_SPLIT_PANE,
+
+ /** An object that forms part of a menu system but which can be "undocked"
+ from or "torn off" the menu system to exist as a separate window.
+ */
+ IA2_ROLE_TEAR_OFF_MENU,
+
+ /// An object used as a terminal emulator.
+ IA2_ROLE_TERMINAL,
+
+ /// Collection of objects that constitute a logical text entity.
+ IA2_ROLE_TEXT_FRAME,
+
+ /** A toggle button. A specialized push button that can be checked or unchecked,
+ but does not provide a separate indicator for the current state.
+ Also refer to MSAA's roles of push button, check box, and radio button.
+ <BR><B>Note:</B> IA2_ROLE_TOGGLE_BUTTON should not be used. Instead, use MSAA's
+ ROLE_SYSTEM_PUSHBUTTON and STATE_SYSTEM_PRESSED.
+ */
+ IA2_ROLE_TOGGLE_BUTTON,
+
+ /** A viewport. An object usually used in a scroll pane. It represents the
+ portion of the entire data that the user can see. As the user manipulates
+ the scroll bars, the contents of the viewport can change.
+ Also refer to ::IA2_ROLE_SCROLL_PANE.
+ */
+ IA2_ROLE_VIEW_PORT,
+
+ /** An object containing content which is complementary to the main content of
+ a document, but remains meaningful when separated from the main content. There
+ are various types of content that would appropriately have this role. For example,
+ in the case where content is delivered via a web portal to a web browser, this may
+ include but not be limited to show times, current weather, related articles, or
+ stocks to watch. The complementary role indicates that contained content is relevant
+ to the main content. If the complementary content is completely separable main
+ content, it may be appropriate to use a more general role.
+ */
+ IA2_ROLE_COMPLEMENTARY_CONTENT
+
+};
+/*************************************************************************
+ *
+ * File Name (AccessibleStates.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2010 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+typedef long AccessibleStates;
+
+/** %IAccessible2 specific state bit constants
+
+ This enum defines the state bits returned by IAccessible2::states. The
+ %IAccessible2 state bits are in addition to those returned by MSAA.
+*/
+enum IA2States {
+
+/** Indicates a window is currently the active window, or is an active subelement
+ within a container or table.
+
+ This state can be used to indicate the current active item in a container, even
+ if the container itself is not currently active. In other words this would indicate
+ the item that will get focus if you tab to the container.
+
+ This information is important for knowing what to report for trees and potentially
+ other containers in a virtual buffer.
+
+ Also, see ::IA2_STATE_MANAGES_DESCENDANTS for more information.
+*/
+IA2_STATE_ACTIVE = 0x1,
+
+/** Indicates that the object is armed.
+
+ Used to indicate that the control is "pressed" and will be invoked when the
+ actuator, e.g. a mouse button, is "released". An AT which either monitors the
+ mouse or synthesizes mouse events might need to know that, and possibly a talking
+ interface would even let the user know about it. It could also potentially be
+ useful to on screen keyboards or test tools since the information does indicate
+ something about the state of the interface, for example, code operating asynchronously
+ might need to wait for the armed state to change before doing something else.
+
+*/
+IA2_STATE_ARMED = 0x2,
+
+/** Indicates the user interface object corresponding to this object no longer exists. */
+IA2_STATE_DEFUNCT = 0x4,
+
+/** An object with this state has a caret and implements the IAccessibleText interface.
+
+ Such fields may be read-only, so STATE_SYSTEM_READONLY is valid in combination
+ with IA2_STATE_EDITABLE.
+
+*/
+IA2_STATE_EDITABLE = 0x8,
+
+/** Indicates the orientation of this object is horizontal. */
+IA2_STATE_HORIZONTAL = 0x10,
+
+/** Indicates this object is minimized and is represented only by an icon. */
+IA2_STATE_ICONIFIED = 0x20,
+
+/** Indicates an input validation failure. */
+IA2_STATE_INVALID_ENTRY = 0x40,
+
+/** Indicates that this object manages its children.
+
+ Note: Due to the fact that MSAA's WinEvents don't allow the active child index
+ to be passed on the IA2_EVENT_ACTIVE_DESCENDANT_CHANGED event, the manages
+ descendants scheme can't be used. Instead the active child object has to fire
+ MSAA's EVENT_OBJECT_FOCUS. In a future release a new event mechanism may be
+ added to provide for event specific data to be passed with the event. At that
+ time the IA2_EVENT_ACTIVE_DECENDENT_CHANGED event and
+ IA2_STATE_MANAGES_DESCENDANTS state would be useful.
+*/
+IA2_STATE_MANAGES_DESCENDANTS = 0x80,
+
+/** Indicates that an object is modal.
+
+ Modal objects have the behavior that something must be done with the object
+ before the user can interact with an object in a different window.
+*/
+IA2_STATE_MODAL = 0x100,
+
+/** Indicates this text object can contain multiple lines of text. */
+IA2_STATE_MULTI_LINE = 0x200,
+
+/** Indicates this object paints every pixel within its rectangular region. */
+IA2_STATE_OPAQUE = 0x400,
+
+/** Indicates that user interaction is required.
+
+ An example of when this state is used is when a field in a form must be filled
+ before a form can be processed.
+*/
+IA2_STATE_REQUIRED = 0x800,
+
+/** Indicates an object which supports text selection.
+
+ Note: This is different than MSAA STATE_SYSTEM_SELECTABLE.
+*/
+IA2_STATE_SELECTABLE_TEXT = 0x1000,
+
+/** Indicates that this text object can contain only a single line of text. */
+IA2_STATE_SINGLE_LINE = 0x2000,
+
+/** Indicates that the accessible object is stale.
+
+ This state is used when the accessible object no longer accurately
+ represents the state of the object which it is representing such as when an
+ object is transient or when an object has been or is in the process of being
+ destroyed or when the object's index in its parent has changed.
+*/
+IA2_STATE_STALE = 0x4000,
+
+/** Indicates that the object implements autocompletion.
+
+ This state indicates that a text control will respond to the input of
+ one ore more characters and cause a sub-item to become selected. The
+ selection may also result in events fired on the parent object.
+*/
+IA2_STATE_SUPPORTS_AUTOCOMPLETION = 0x8000,
+
+/** Indicates this object is transient.
+
+ An object has this state when its parent object has the state ::IA2_STATE_MANAGES_DESCENDANTS.
+ For example, a list item object may be managed by its parent list object and may only
+ exist as long as the object is actually rendered. Similarly a table cell's accessible
+ object may exist only while the cell has focus. However, from the perspective of an
+ assistive technology a transient object behaves like a non-transient object. As a
+ result it is likely that this state is not of use to an assistive technology, but it
+ is provided in case an assistive technology determines that knowledge of the transient
+ nature of the object is useful and also for harmony with the Linux accessibility API.
+
+ Also, see ::IA2_STATE_MANAGES_DESCENDANTS for more information.
+ */
+IA2_STATE_TRANSIENT = 0x10000,
+
+/** Indicates the orientation of this object is vertical. */
+IA2_STATE_VERTICAL = 0x20000,
+
+/** Indicates this object is checkable.
+
+ The standard checkable objects are check boxes, radio buttons, check box menu
+ items, radio menu items, and toggle buttons. Since assistive technology will
+ determine that these objects are checkable via the object's role the checkable
+ state is not required. However, this state is necessary in those cases where
+ an object has a role which is not one of the previously mentioned roles. An
+ example is a table cell which indicates whether or not an email has an attachment,
+ whether or not an mail is considered spam, and whether or not an email has been read.
+ */
+IA2_STATE_CHECKABLE = 0x40000,
+
+/** Indicates this object is pinned.
+
+ This state indicates that an object is fixed at a certain location. One example
+ is a browser tab that when pinned cannot be moved until unpinned. Another example
+ is a movable or floating object that when pinned remains in its pinned location
+ until being unpinned.
+ */
+IA2_STATE_PINNED = 0x80000
+
+};
+/*************************************************************************
+ *
+ * File Name (Accessible2.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+/** @mainpage
+
+ @section _interfaces Interfaces
+ IAccessible2\n
+ IAccessible2_2\n
+ IAccessibleAction\n
+ IAccessibleApplication\n
+ IAccessibleComponent\n
+ IAccessibleDocument\n
+ IAccessibleEditableText\n
+ IAccessibleHypertext\n
+ IAccessibleHypertext2\n
+ IAccessibleHyperlink\n
+ IAccessibleImage\n
+ IAccessibleRelation\n
+ IAccessibleTable [Deprecated]\n
+ IAccessibleTable2\n
+ IAccessibleTableCell\n
+ IAccessibleText\n
+ IAccessibleText2\n
+ IAccessibleValue
+
+ @section _structs Structs
+ IA2Locale\n
+ IA2TableModelChange\n
+ IA2TextSegment
+
+ @section _enums Enums
+ ::IA2Actions values are predefined actions for use when implementing support for HTML5 media.\n
+ ::IA2CoordinateType values define the requested coordinate type (screen or parent window).\n
+ ::IA2EventID values identify events.\n
+ ::IA2Role values defines roles which are in addition to the existing MSAA roles.\n
+ ::IA2ScrollType values define where to place an object or substring on the screen.\n
+ ::IA2States values define states which are in addition to the existing MSAA states.\n
+ ::IA2TableModelChangeType values describe the kinds of changes made to a table (insert, delete, update).\n
+ ::IA2TextBoundaryType values define the requested text unit (character, word, sentence, line, paragraph).\n
+ ::IA2TextSpecialOffsets values define special offsets for use in the text interfaces.
+
+ @section _constants Constants
+ @ref grpRelations
+
+ @section _misc Miscellaneous
+ @ref _licensePage "BSD License"\n
+ @ref _generalInfo "General Information"\n
+
+ @page _licensePage BSD License
+ %IAccessible2 IDL Specification
+
+ Copyright (c) 2007, 2013 Linux Foundation\n
+ Copyright (c) 2006 IBM Corporation\n
+ Copyright (c) 2000, 2006 Sun Microsystems, Inc.\n
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ 3. Neither the name of the Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This BSD License conforms to the Open Source Initiative "Simplified
+ BSD License" as published at:
+ http://www.opensource.org/licenses/bsd-license.php
+
+ %IAccessible2 is a trademark of the Linux Foundation. The %IAccessible2
+ mark may be used in accordance with the
+ <a href="http://www.linuxfoundation.org/collaborate/workgroups/accessibility/trademark-policy">
+ Linux Foundation Trademark Policy</a> to indicate compliance with the %IAccessible2 specification.
+
+ @page _generalInfo General Information
+ The following information is applicable to two or more interfaces.
+
+ @ref _errors\n
+ @ref _memory\n
+ &nbsp;&nbsp;@ref _arrayConsideration\n
+ @ref _indexes\n
+ @ref _enumBase\n
+ @ref _specialOffsets\n
+ @ref _dicoveringInterfaces\n
+ @ref _changingInterfaces\n
+ @ref _applicationInfo\n
+ @ref _childIDs\n
+ @ref _variants\n
+ @ref _iaaction-iahyperlink\n
+ @ref _trademark
+
+ @section _errors Error Handling
+ HRESULT values are defined by the Microsoft&reg; Win32&reg; API. For more information, refer to
+ <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137%28v=vs.85%29.aspx">
+ Interpreting HRESULT Values</a> in MSDN&reg;.
+
+ Note that the S_FALSE return value is considered a non-error value and the
+ SUCCEEDED macro will return TRUE. S_FALSE is used when there is no failure
+ but there was nothing valid to return, e.g. in IAccessible2::attributes when
+ there are no attributes. When S_FALSE is returned [out] pointer types should
+ be NULL and [out] longs should generally be 0, but sometimes -1 is used such
+ as IAccessible2::indexInParent, IAccessibleText::caretOffset, and
+ IAccessibleHypertext::hyperlinkIndex.
+
+ Note that for BSTR [out] variables common COM practice is that the server does
+ the SysAllocString and the client does the SysFreeString. Also note that when
+ NULL is returned there is no need for the client to call SysFreeString. Please
+ refer to the documentation for each method for more details regarding error handling.
+
+ @section _memory Memory Management
+ The following memory management issues should be considered:
+ @li Although [out] BSTR variables are declared by the client, their space is
+ allocated by the server. They need to be freed with SysFreeString by the
+ client at end of life; the same is true when BSTRs are used in structs or
+ arrays which are passed to the server.
+ @li If there is no valid [out] BSTR to return, the server should return S_FALSE and
+ assign NULL to the output, e.g. *theOutBSTR = NULL;.
+ @li COM interfaces need to be referenced with AddRef when used and dereferenced
+ with Release at end of life.
+ @li Single [out] longs, HWNDs, booleans, and structs are declared by the caller
+ and passed by reference. The marshaller does all the memory management.
+
+ The following articles may be helpful for understanding memory management issues:
+ @li An article by Don Box in a
+ <a href="http://www.microsoft.com/msj/1196/activex1196.aspx">Q & A section</a>
+ of the November 1996 edition of the Microsoft Systems Journal.
+ @li A posting to a CodeGuru forum,
+ <a href="http://www.codeguru.com/forum/showthread.php?t=364511">Windows SDK
+ String: What are the rules for BSTR allocation and deallocation?</a>
+
+ @subsection _arrayConsideration Special Consideration when using Arrays
+ There are several methods which return arrays. In the case of IAccessible2::relations
+ and IAccessibleRelation::targets the client must allocate and free the arrays.
+
+ For the remaining methods which return arrays, the server must allocate the array
+ and the client must free the array when no longer needed. These methods are
+ IAccessible2::extendedStates, IAccessible2::localizedExtendedStates,
+ IAccessible2_2::relationTargetsOfType, IAccessibleAction::keyBinding,
+ IAccessibleHypertext2::hyperlinks, IAccessibleTable::selectedChildren,
+ IAccessibleTable::selectedColumns, IAccessibleTable::selectedRows,
+ IAccessibleTable2::selectedCells, IAccessibleTable2::selectedColumns,
+ IAccessibleTable2::selectedRows, IAccessibleTableCell::columnHeaderCells,
+ and IAccessibleTableCell::rowHeaderCells.
+ For those methods, the server must allocate both the top level array and any storage
+ associated with it, e.g. for BSTRs. The server must allocate the arrays with
+ CoTaskMemAlloc and any BSTRs with SysAllocString. The client must use CoTaskMemFree
+ to free the array and any BSTRs must be freed with SysFreeString.
+
+ Also, the IDL for IAccessible2::extendedStates, IAccessible2::localizedExtendedStates,
+ IAccessibleAction::keyBinding, IAccessibleTable::selectedChildren,
+ IAccessibleTable::selectedColumns, and IAccessibleTable::selectedRows includes an
+ extraneous [in] parameter for the caller to specify the max size of the array.
+ This parameter will be ignored by the COM server.
+
+ @section _indexes Zero and One Based Indexes
+ Unless otherwise specified all offsets and indexes are 0 based.
+
+ @section _enumBase Enum Base
+ Note that enums start at 0.
+
+ @section _specialOffsets Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods
+ IAccessibleText and IAccessibleEditableText can use one or more of the following
+ special offset values. They are defined in the ::IA2TextSpecialOffsets enum.
+ @li Using ::IA2_TEXT_OFFSET_LENGTH (-1) as an offset in any of the IAccessibleText or
+ IAccessibleEditableText methods is the same as specifying the length of the string.
+ @li Using ::IA2_TEXT_OFFSET_CARET (-2) as an offset for IAccessibleText::textBeforeOffset,
+ IAccessibleText::textAtOffset, and IAccessibleText::textAfterOffset indicates that the
+ text related to the physical location of the caret should be used. This is needed for
+ applications that consider the character offset of the end of one line (as reached by
+ pressing the End key) the same as the offset of the first character on the next line.
+ Since the same offset is associated with two different lines a special means is needed
+ to fetch text from the line where the caret is physically located.
+
+ @section _dicoveringInterfaces Discovery of Interfaces
+ In general AT (Assistive Technology) should try IAccessible2 interfaces, followed by using
+ the MSAA (Microsoft&reg; Active Accessibility&reg;) interfaces. (In cases where the an application
+ is known to have custom interfaces which provide information not supplied by IAccessible2
+ or MSAA, then those custom interfaces can be used.) The AT can then, by default, support
+ unknown IAccessible2/MSAA applications, without the application developers having to request
+ AT vendors for support on an individual application by application basis.
+
+ When you have a reference to an IAccessible and require a reference to an IAccessible2 use
+ QueryService as follows:
+ @code
+ // pAcc is a reference to the accessible object's IAccessible interface.
+ IServiceProvider *pService = NULL;
+ hr = pAcc->QueryInterface(IID_IServiceProvider, (void **)&pService);
+ if(SUCCEEDED(hr)) {
+ IAccessible2 *pIA2 = NULL;
+ hr = pService->QueryService(IID_IAccessible, IID_IAccessible2, (void**)&pIA2);
+ if (SUCCEEDED(hr) && pIA2) {
+ // The control supports IAccessible2.
+ // pIA2 is the reference to the accessible object's IAccessible2 interface.
+ }
+ }
+ @endcode
+
+ @section _changingInterfaces Changing between Accessible Interfaces
+ Note that developers must always implement MSAA's IAccessible and, if needed, some
+ of the interfaces in the set of IAccessible2 interfaces. Although the IAccessible2
+ IDL is coded such that IAccessible2 is a subclass of MSAA's IAccessible, none of
+ MSAA's IAccessible methods are redefined by IAccessible2.
+
+ QueryService must be used to switch from a reference to an MSAA IAccessible interface
+ to another interface. This has been
+ <a href="http://www.atia.org/files/public/Introducing_IAccessibleEx.doc">
+ documented</a> and the pertinent facts have been extracted below:
+
+ @par
+ Why use QueryService instead of just using QueryInterface to get IAccessibleEx
+ directly? The reason is that since MSAA 2.0, clients don't talk to a server's
+ IAccessible interface directly; instead they talk to an intermediate MSAA-provided
+ wrapper that calls through to the original IAccessible. This wrapper provides services
+ such as implementing IDispatch, supplying information from MSAA 2.0's Dynamic Annotation
+ service, and scaling locations when running on Windows Vista with DPI scaling enabled.
+ QueryService is the supported way to expose additional interfaces from an existing
+ IAccessible and was originally used by MSHTML to expose IHTMLElement objects corresponding
+ to IAccessibles. QueryService is often more convenient for servers to implement than
+ QueryInterface because it does not have the same requirements for preserving object
+ identity or symmetry/transitivity as QueryInterface, so QueryService allows servers to
+ easily implement the interface on the same object or a separate object. The latter is
+ often hard to do with QueryInterface unless the original object supports aggregation.
+
+ Two related references in MSDN&reg; are:
+ @li <a href="http://msdn.microsoft.com/en-us/library/ms696078(VS.85).aspx">
+ "Using QueryService to expose a native object model interface for an IAccessible object"</a>
+ @li <a href="http://msdn.microsoft.com/en-us/library/ms528415.aspx#acc_obj">
+ "Accessing the Internet Explorer Object Associated with an Accessible Object"</a>
+
+ Based on this information from Microsoft, QueryService must be used to switch back and forth
+ between a reference to an MSAA IAccessible interface and any of the IAccessible2 interfaces.
+
+ Regarding switching between any of the IAccessible2 interfaces, applications implementing
+ IAccessible2 should implement the IAccessible2 interfaces on a single object since ATs
+ will be using QueryInterface to switch between the IAccessilbe2 interfaces. Implementing
+ the IAccessible2 interfaces on separate objects would require the use of QueryService.
+ There is one exception, IAccessibleApplication can be implemented on a separate object so
+ its common code doesn't have to be included in each accessible object. ATs should use
+ QueryService to access IAccessibleApplication.
+
+ @section _applicationInfo Access to Information about the Application
+ Servers implementing IAccessible2 should provide access to the IAccessibleApplication
+ interface via QueryService from any object so that ATs can easily determine specific
+ information about the application such as its name or version.
+
+ @section _childIDs Child IDs
+ The IAccessible2 interfaces do not support child IDs, i.e. simple child elements.
+ Full accessible objects must be created for each object that supports IAccessible2.
+ Therefore MSAA's get_accChild should never return a child ID (other than CHILDID_SELF)
+ for an object that implements any of the IAccessible2 interfaces.
+
+ Microsoft's UI Automation specification has the same limitation and this was resolved
+ in the UI Automation Express specification by adding IAccessibleEx::GetObjectForChild
+ and IAccessibleEx::GetIAccessiblePair. These methods allow mapping back and forth
+ between an IAccessibleEx and an {IAccessible, Child ID} pair. A future version of
+ IAccessible2 may include similar methods to map back and forth between an IAccessible2
+ and an {IAccessible, Child ID} pair.
+
+ @section _variants VARIANTs
+ Some methods return a VARIANT. Implementers need to make sure that the return type is
+ specified, i.e. VT_I4, VT_IDISPATCH, etc. The methods that return VARIANTs are
+ IAccessibleHyperlink::anchor, IAccessibleHyperlink::anchorTarget, IAccessibleValue::currentValue,
+ IAccessibleValue::maximumValue, IAccessibleValue::minimumValue.
+
+ @section _iaaction-iahyperlink IAccessibleHyperlink as subclass of IAccessibleAction
+ In this version of the IDL, IAccessibleHyperlink is a subclass of IAccessibleAction.
+ However, there is no practical need for that inheritance and in some cases, such as
+ an image map of smart tags, it doesn't make sense because such an image map doesn't
+ have actionable objects; it's the secondary smart tags that are actionable. As a
+ result, implementations should not rely on the inheritance as it may be removed in
+ a later version of the IDL.
+
+ @section _trademark Trademark Attribution
+ The names of actual companies and products mentioned herein may be the trademarks of
+ their respective owners. In particular, Active Accessibility, Microsoft, MSDN, and Win32
+ are trademarks of the Microsoft group of companies in the U.S.A. and/or other countries.
+
+**/
+
+
+
+
+
+
+
+
+/** A structure defining the locale of an accessible object.
+
+IAccessible2::locale returns this struct.
+*/
+typedef struct IA2Locale {
+ BSTR language; ///< ISO 639-1 Alpha-2 two character language code
+ BSTR country; ///< ISO 3166-1 Alpha-2 two character country code
+ BSTR variant; ///< Application specific variant of the locale
+} IA2Locale;
+
+/** @brief This interface exposes the primary set of information about an
+ IAccessible2 enabled accessible object.
+
+ This interface must always be provided for objects that support some
+ portion of the collection of the %IAccessible2 interfaces.
+
+ Please refer to @ref _changingInterfaces "Changing between Accessible Interfaces"
+ for special considerations related to use of the MSAA IAccessible interface and
+ the set of %IAccessible2 interfaces.
+ */
+[object, uuid(E89F726E-C4F4-4c19-BB19-B647D7FA8478)]
+interface IAccessible2 : IAccessible
+{
+
+ /** @brief Returns the number of accessible relations for this object.
+ @param [out] nRelations
+ @retval S_OK
+ */
+ [propget] HRESULT nRelations
+ (
+ [out, retval] long *nRelations
+ );
+
+ /** @brief Returns one accessible relation for this object.
+ @param [in] relationIndex
+ 0 based
+ @param [out] relation
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT relation
+ (
+ [in] long relationIndex,
+ [out, retval] IAccessibleRelation **relation
+ );
+
+ /** @brief Returns multiple accessible relations for this object.
+ @param [in] maxRelations
+ maximum size of the array allocated by the client
+ @param [out] relations
+ The array of accessible relation objects. Note that this array is to be
+ allocated by the client and freed when no longer needed. Refer to @ref
+ _arrayConsideration "Special Consideration when using Arrays" for more details.
+ @param [out] nRelations
+ actual number of relations in the returned array (not more than maxRelations)
+ @retval S_OK
+ @retval S_FALSE if there are no relations, nRelations is set to 0
+ @note As a performant alternative, client code should consider using IAccessible2_2::relationTargetsOfType.
+ */
+ [propget] HRESULT relations
+ (
+ [in] long maxRelations,
+ [out, size_is(maxRelations), length_is(*nRelations)]
+ IAccessibleRelation **relations,
+ [out, retval] long *nRelations
+ );
+
+ /** @brief Returns the role of an %IAccessible2 object.
+ @param [out] role
+ The role of an %IAccessible2 object.
+ @retval S_OK
+ @note
+ @li For convenience MSAA roles are also passed through this method so the
+ AT doesn't have to also fetch roles through MSAA's get_accRole.
+ @li %IAccessible2 roles should not be passed through MSAA's get_accRole.
+ @li For compatibility with non IAccessible2 enabled ATs, IAccessible2
+ applications should also add support to get_accRole to return the closest
+ MSAA role or ROLE_SYSTEM_CLIENT (the MSAA defined default role) if there
+ is not a good match.
+ @li This method is missing a [propget] prefix in the IDL. The result is the
+ method is named role in generated C++ code instead of get_role.
+ */
+ HRESULT role
+ (
+ [out, retval] long *role
+ );
+
+ /** @brief Makes an object visible on the screen.
+ @param [in] scrollType
+ Defines where the object should be placed on the screen.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT scrollTo
+ (
+ [in] enum IA2ScrollType scrollType
+ );
+
+ /** @brief Moves the top left of an object to a specified location.
+
+ @param [in] coordinateType
+ Specifies whether the coordinates are relative to the screen or the parent object.
+ @param [in] x
+ Defines the x coordinate.
+ @param [in] y
+ Defines the y coordinate.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT scrollToPoint
+ (
+ [in] enum IA2CoordinateType coordinateType,
+ [in] long x,
+ [in] long y
+ );
+
+ /** @brief Returns grouping information.
+
+ Used for tree items, list items, tab panel labels, radio buttons, etc.
+ Also used for collections of non-text objects.
+
+ @param [out] groupLevel
+ 1 based, 0 indicates that this value is not applicable
+ @param [out] similarItemsInGroup
+ 1 based, 0 indicates that this value is not applicable
+ @param [out] positionInGroup
+ 1 based, 0 indicates that this value is not applicable. This is an index
+ into the objects in the current group, not an index into all the objects
+ at the same group level.
+ @retval S_OK if at least one value is valid
+ @retval S_FALSE if no values are valid, [out] values are 0s
+ @note This method is meant to describe the nature of an object's containment
+ structure. It's exposed by trees, tree grids, nested lists, nested menus,
+ but not headings, which uses the level object attribute. It is also exposed
+ by radio buttons (with groupLevel == 0).
+ @note This is normally not implemented on a combo box to describe the nature
+ of its contents. Normally an AT will get that information from its child list
+ object. However, in some cases when non-edit combo boxes are not able to be structured
+ such that the list is a child of the combo box, this method is implemented on
+ the combo box itself. ATs can use this interface if a child list is not found.
+ */
+ [propget] HRESULT groupPosition
+ (
+ [out] long *groupLevel,
+ [out] long *similarItemsInGroup,
+ [out, retval] long *positionInGroup
+ );
+
+ /** @brief Returns the bit strip containing any IAccessible2 states.
+
+ The IAccessible2 states are in addition to the MSAA states and are defined in
+ the IA2States enum.
+
+ @param [out] states
+ @retval S_OK
+ */
+ [propget] HRESULT states
+ (
+ [out, retval] AccessibleStates *states
+ );
+
+ /** @brief Returns the extended role.
+
+ An extended role is a role which is dynamically generated by the application.
+ It is not predefined by the %IAccessible2 specification.
+
+ @param [out] extendedRole
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT extendedRole
+ (
+ [out, retval] BSTR *extendedRole
+ );
+
+ /** @brief Returns the localized extended role.
+ @param [out] localizedExtendedRole
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT localizedExtendedRole
+ (
+ [out, retval] BSTR *localizedExtendedRole
+ );
+
+ /** @brief Returns the number of extended states.
+ @param [out] nExtendedStates
+ @retval S_OK
+ */
+ [propget] HRESULT nExtendedStates
+ (
+ [out, retval] long *nExtendedStates
+ );
+
+ /** @brief Returns the extended states (array of strings).
+
+ An extended state is a state which is dynamically generated by the application.
+ It is not predefined by the %IAccessible2 specification.
+
+ @param [in] maxExtendedStates
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] extendedStates
+ This array is allocated by the server. The client must free it with CoTaskMemFree.
+ @param [out] nExtendedStates
+ The number of extended states returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are no states, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT extendedStates
+ (
+ [in] long maxExtendedStates,
+ [out, size_is(,maxExtendedStates), length_is(,*nExtendedStates)] BSTR **extendedStates,
+ [out, retval] long *nExtendedStates
+ );
+
+ /** @brief Returns the localized extended states (array of strings).
+
+ @param [in] maxLocalizedExtendedStates
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] localizedExtendedStates
+ This array is allocated by the server. The client must free it with CoTaskMemFree.
+ @param [out] nLocalizedExtendedStates
+ The number of localized extended states returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are no states, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT localizedExtendedStates
+ (
+ [in] long maxLocalizedExtendedStates,
+ [out, size_is(,maxLocalizedExtendedStates), length_is(,*nLocalizedExtendedStates)] BSTR **localizedExtendedStates,
+ [out, retval] long *nLocalizedExtendedStates
+ );
+
+ /** @brief Returns the unique ID.
+
+ The uniqueID is an identifier for this object, is unique within the
+ current window, and remains the same for the lifetime of the accessible
+ object.
+
+ The uniqueID is not related to:
+ - the MSAA objectID which is used by the server to disambiguate between
+ IAccessibles per HWND or
+ - the MSAA childID which is used to disambiguate between children being
+ managed by an IAccessible.
+
+ This value is provided so the AT can have access to a unique runtime persistent
+ identifier even when not handling an event for the object.
+
+ An example of when this value is useful is if the AT wants to build a cache.
+ The AT could cache the uniqueIDs in addition to other data being cached.
+ When an event is fired the AT could map the uniqueID to its internal model.
+ Thus, if there's a REORDER/SHOW/HIDE event the AT knows which part of the
+ internal structure has been invalidated and can refetch just that part.
+
+ This value can also be used by an AT to determine when the current control
+ has changed. If the role is the same for two controls that are adjacent in
+ the tab order, this can be used to detect the new control.
+
+ Another use of this value by an AT is to identify when a grouping object has
+ changed, e.g. when moving from a radio button in one group to a radio button in a
+ different group.
+
+ One means of implementing this would be to create a factory with a 32 bit number
+ generator and a reuse pool. The number generator would emit numbers starting
+ at 1. Each time an object's life cycle ended, its number would be saved into a
+ reuse pool. The number generator would be used whenever the reuse pool was empty.
+
+ Another way to create a unique ID is to generate it from a pointer value, e.g. an
+ object's address. That would be unique because no two active objects can use the
+ same allocated memory space.
+
+ @param [out] uniqueID
+ @retval S_OK
+ */
+ [propget] HRESULT uniqueID
+ (
+ [out, retval] long *uniqueID
+ );
+
+ /** @brief Returns the window handle for the parent window which contains this object.
+
+ This is the same window handle which will be passed for any events that occur on the
+ object, but is cached in the accessible object for use when it would be helpful to
+ access the window handle in cases where an event isn't fired on this object.
+
+ A use case is when a screen reader is grabbing an entire web page on a page load.
+ Without the availability of windowHandle, the AT would have to get the window handle
+ by using WindowFromAccessibleObject on each IAccessible, which is slow because it's
+ implemented by oleacc.dll as a loop which crawls up the ancestor chain and looks for
+ a ROLE_WINDOW object, mapping that back to a window handle.
+
+ @param [out] windowHandle
+ @retval S_OK
+ */
+ [propget] HRESULT windowHandle
+ (
+ [out, retval] HWND *windowHandle
+ );
+
+ /** @brief Returns the index of this object in its parent object.
+ @param [out] indexInParent
+ 0 based; -1 indicates there is no parent; the upper bound is the value
+ returned by the parent's IAccessible::get_accChildCount.
+ @retval S_OK
+ @retval S_FALSE if no parent, [out] value is -1
+ */
+ [propget] HRESULT indexInParent
+ (
+ [out, retval] long *indexInParent
+ );
+
+ /** @brief Returns the IA2Locale of the accessible object.
+ @param [out] locale
+ @retval S_OK
+ */
+ [propget] HRESULT locale
+ (
+ [out, retval] IA2Locale *locale
+ );
+
+ /** @brief Returns the attributes specific to this object, such as a cell's formula.
+ @param [out] attributes
+ @retval S_OK
+ @retval S_FALSE returned if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT attributes
+ (
+ [out, retval] BSTR *attributes
+ );
+
+}
+
+/*************************************************************************
+ *
+ * File Name (Accessible2_2.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+/** @brief This interface exposes the primary set of information about an
+ IAccessible2 enabled accessible object.
+
+ This interface must always be provided for objects that support some
+ portion of the collection of the %IAccessible2 interfaces.
+
+ Please refer to @ref _changingInterfaces "Changing between Accessible Interfaces"
+ for special considerations related to use of the MSAA IAccessible interface and
+ the set of %IAccessible2 interfaces.
+ */
+[object, uuid(6C9430E9-299D-4E6F-BD01-A82A1E88D3FF)]
+interface IAccessible2_2 : IAccessible2
+{
+ /** @brief Returns the attribute value of a specified attribute specific to this object.
+ @param [in] name
+ @param [out] attribute
+ @retval S_OK
+ @retval S_FALSE returned if there is nothing to return, [out] value is NULL.
+ @retval E_INVALIDARG if bad [in] passed.
+ @note The output value is a VARIANT. Typically it will be a VT_BSTR, but there
+ are some cases where it will be a VT_I4 or VT_BOOL. Refer to the <a href=
+ "http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2/objectattributesIAccessible2">
+ Object Attributes specification</a> for more information.
+ */
+ [propget] HRESULT attribute
+ (
+ [in] BSTR name,
+ [out, retval] VARIANT *attribute
+ );
+
+ /** @brief Returns the deepest hypertext accessible in the subtree of this object, and the caret offset within it.
+ @param [out] accessible
+ @param [out] caretOffset
+ @retval S_OK
+ @retval S_FALSE returned if there is no caret in any of the objects in the subtree, [out] accessible is NULL and [out] caretOffset is -1.
+ */
+ [propget] HRESULT accessibleWithCaret
+ (
+ [out] IUnknown **accessible,
+ [out, retval] long *caretOffset
+ );
+
+ /** @brief Returns relation targets for a specified target type.
+ @param [in] type
+ The requested @ref grpRelations "relation type".
+ @param [in] maxTargets
+ The number of targets requested. 0 indicates that all targets should be returned.
+ @param [out] targets
+ This array is allocated by the server. The client must free it with CoTaskMemFree.
+ @param [out] nTargets
+ The number of targets returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are no targets, [out] values are NULL and 0 respectively.
+ @retval E_INVALIDARG if bad [in] passed.
+ */
+ [propget] HRESULT relationTargetsOfType
+ (
+ [in] BSTR type,
+ [in] long maxTargets,
+ [out, size_is(,*nTargets)] IUnknown ***targets,
+ [out, retval] long *nTargets
+ );
+
+}
+
+/*************************************************************************
+ *
+ * File Name (AccessibleComponent.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2010 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+/** A value specifying a color in ARGB format, where each 8 bit color component
+specifies alpha, red, green, and blue respectively. The alpha value is optional.
+*/
+typedef long IA2Color;
+
+/** @brief This interface is implemented by any object that can be rendered
+ on the screen.
+
+ This interface provides the standard mechanism for an assistive technology
+ to retrieve information concerning the graphical representation of an object.
+ Coordinates used by the functions of this interface are specified in
+ different coordinate systems. Their scale is the same and is equal to
+ that of the screen coordinate system. In other words all coordinates
+ are measured in pixels. They differ in their respective origin:
+ <ul>
+ <li>The screen coordinate system has its origin in the upper left
+ corner of the current screen.</li>
+ <li>The origin of the parent coordinate system is the upper left corner
+ of the parent's bounding box. With no parent the screen coordinate
+ system is used instead.</li>
+ </ul>
+*/
+[object, uuid(1546D4B0-4C98-4bda-89AE-9A64748BDDE4)]
+interface IAccessibleComponent : IUnknown
+{
+
+ /** @brief Returns the location of the upper left corner of the object's
+ bounding box relative to the immediate parent object.
+
+ The coordinates of the bounding box are given relative to the parent's
+ coordinate system. The coordinates of the returned position are relative
+ to this object's parent or relative to the screen on which this object
+ is rendered if it has no parent. If the object is not on any screen
+ the returned position is (0,0).
+
+ @param [out] x
+ @param [out] y
+ @retval S_OK
+ */
+ [propget] HRESULT locationInParent
+ (
+ [out] long *x,
+ [out, retval] long *y
+ );
+
+ /** @brief Returns the foreground color of this object.
+ @param [out] foreground
+ The returned color is the foreground color of this object or, if
+ that is not supported, the default foreground color.
+ @retval S_OK
+ */
+ [propget] HRESULT foreground
+ (
+ [out, retval] IA2Color *foreground
+ );
+
+ /** @brief Returns the background color of this object.
+ @param [out] background
+ The returned color is the background color of this object or, if
+ that is not supported, the default background color.
+ @retval S_OK
+ */
+ [propget] HRESULT background
+ (
+ [out, retval] IA2Color *background
+ );
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleValue.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2010 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+/** @brief This interface gives access to a single numerical value.
+
+ The %IAccessibleValue interface represents a single numerical value and should
+ be implemented by any class that supports numerical value like progress bars
+ and spin boxes. This interface lets you access the value and its upper and
+ lower bounds.
+*/
+[object, uuid(35855B5B-C566-4fd0-A7B1-E65465600394)]
+interface IAccessibleValue : IUnknown
+{
+
+ /** @brief Returns the value of this object as a number.
+
+ The exact return type is implementation dependent. Typical types are long and
+ double.
+ @param [out] currentValue
+ Returns the current value represented by this object. See the section about
+ @ref _variants "VARIANTs" for additional information.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is a VARIANT with vt = VT_EMPTY
+ */
+ [propget] HRESULT currentValue
+ (
+ [out, retval] VARIANT *currentValue
+ );
+
+ /** @brief Sets the value of this object to the given number.
+
+ The argument is clipped to the valid interval whose upper and lower
+ bounds are returned by the methods IAccessibleValue::maximumValue and
+ IAccessibleValue::minimumValue, i.e. if it is lower than the minimum
+ value the new value will be the minimum and if it is greater than the
+ maximum then the new value will be the maximum.
+
+ @param [in] value
+ The new value represented by this object. The set of admissible types for
+ this argument is implementation dependent.
+ @retval S_OK
+ */
+ HRESULT setCurrentValue
+ (
+ [in] VARIANT value
+ );
+
+ /** @brief Returns the maximal value that can be represented by this object.
+
+ The type of the returned value is implementation dependent. It does not have
+ to be the same type as that returned by method IAccessibleValue::currentValue.
+
+ @param [out] maximumValue
+ Returns the maximal value in an implementation dependent type. If this object
+ has no upper bound then an empty object is returned. See the section about
+ @ref _variants "VARIANTs" for additional information.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is a VARIANT with vt = VT_EMPTY
+ */
+ [propget] HRESULT maximumValue
+ (
+ [out, retval] VARIANT *maximumValue
+ );
+
+ /** @brief Returns the minimal value that can be represented by this object.
+
+ The type of the returned value is implementation dependent. It does not have
+ to be the same type as that returned by method IAccessibleValue::currentValue.
+
+ @param [out] minimumValue
+ Returns the minimal value in an implementation dependent type. If this object
+ has no lower bound then an empty object is returned. See the section about
+ @ref _variants "VARIANTs" for additional information.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is a VARIANT with vt = VT_EMPTY
+ */
+ [propget] HRESULT minimumValue
+ (
+ [out, retval] VARIANT *minimumValue
+ );
+
+};
+/*************************************************************************
+ *
+ * File Name (AccessibleText.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+/** A structure containing a substring and the start and end offsets in the enclosing string.
+
+ IAccessibleText::newText and IAccessibleText::oldText return this struct.
+*/
+typedef struct IA2TextSegment {
+ BSTR text; ///< A copy of a segment of text taken from an enclosing paragraph.
+ long start; ///< Index of the first character of the segment in the enclosing text.
+ long end; ///< Index of the character following the last character of the segment in the enclosing text.
+} IA2TextSegment;
+
+/** This enum defines values which specify a text boundary type.
+
+ IA2_TEXT_BOUNDARY_SENTENCE is optional. When a method doesn't implement this
+ method it must return S_FALSE. Typically this feature would not be implemented
+ by an application. However, if the application developer was not satisfied with
+ how screen readers have handled the reading of sentences this boundary type
+ could be implemented and screen readers could use the application's version of a
+ sentence rather than the screen reader's.
+
+ The rest of the boundary types must be supported.
+
+ This enum is used in IAccessibleText::textBeforeOffset, IAccessibleText::textAtOffset,
+ and IAccessibleText::textAfterOffset.
+*/
+
+enum IA2TextBoundaryType {
+ IA2_TEXT_BOUNDARY_CHAR, /**< Typically, a single character is returned. In some cases more than
+ one character is returned, for example, when a document contains field
+ data such as a field containing a date, time, or footnote reference.
+ In this case the caret can move over several characters in one movement
+ of the caret. Note that after the caret moves, the caret offset changes
+ by the number of characters in the field, e.g. by 8 characters in the
+ following date: 03/26/07. */
+ IA2_TEXT_BOUNDARY_WORD, /**< The range provided matches the range observed when the application
+ processes the Ctrl + left arrow and Ctrl + right arrow key sequences.
+ Typically this is from the start of one word to the start of the next, but
+ various applications are inconsistent in the handling of the end of a line. */
+ IA2_TEXT_BOUNDARY_SENTENCE, ///< Range is from start of one sentence to the start of another sentence.
+ IA2_TEXT_BOUNDARY_PARAGRAPH, ///< Range is from start of one paragraph to the start of another paragraph.
+ IA2_TEXT_BOUNDARY_LINE, /**< Range is from start of one line to the start of another line. This
+ often means that an end-of-line character will appear at the end of the
+ range. However in the case of some applications an end-of-line character
+ indicates the end of a paragraph and the lines composing the paragraph,
+ other than the last line, do not contain an end of line character. */
+ IA2_TEXT_BOUNDARY_ALL ///< Using this value will cause all text to be returned.
+};
+
+/** @brief This interface gives read-only access to text.
+
+ The %IAccessibleText interface should be implemented by all components
+ that present textual information on the display like buttons,
+ text entry fields, or text portions of the document window. The interface
+ provides access to the text's content, attributes, and spatial location.
+ However, text can not be modified with this interface. That is the task
+ of the IAccessibleEditableText interface.
+
+ The text length, i.e. the number of characters in the text, is
+ returned by IAccessibleText::nCharacters. All methods that operate
+ on particular characters (e.g. IAccessibleText::textAtOffset) use character
+ indices from 0 to length-1. All methods that operate on character positions
+ (e.g. IAccessibleText::text) use indices from 0 to length.
+
+ Please note that accessible text does not necessarily support selection.
+ In this case it should behave as if there where no selection. An empty
+ selection is used for example to express the current cursor position.
+
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+
+ E_FAIL is returned in the following cases
+ @li endOffset < startOffset
+ @li endoffset > length
+*/
+[object, uuid(24FD2FFB-3AAD-4a08-8335-A3AD89C0FB4B)]
+interface IAccessibleText : IUnknown
+{
+
+ /** @brief Adds a text selection
+ @param [in] startOffset
+ Starting offset ( 0 based).
+ @param [in] endOffset
+ Offset of first character after new selection (0 based).
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ */
+ HRESULT addSelection
+ (
+ [in] long startOffset,
+ [in] long endOffset
+ );
+
+ /** @brief Returns text attributes.
+ @param [in] offset
+ Text offset (0 based). Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @param [out] startOffset
+ The starting offset of the character range over which all text attributes match
+ those of offset. (0 based)
+ @param [out] endOffset
+ The offset of the first character past the character range over which all text
+ attributes match those of offset. (0 based)
+ @param [out] textAttributes
+ A string of attributes describing the text. The attributes are described in the
+ <a href="http://www.linuxfoundation.org/en/Accessibility/IAccessible2/TextAttributes">
+ text attributes specification</a> on the %IAccessible2 web site.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] values are 0s and NULL respectively
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT attributes
+ (
+ [in] long offset,
+ [out] long *startOffset,
+ [out] long *endOffset,
+ [out, retval] BSTR *textAttributes
+ );
+
+ /** @brief Returns the position of the caret.
+
+ Returns the 0-based offset of the caret within the text. If the text is
+ implemented as a tree of text objects with embed characters in higher levels
+ representing substrings of child text objects and the caret is in one of the
+ child text objects, then the offset in the higher level text object would be
+ at the embed character representing child text object that contains the caret.
+
+ For example, if the string "one two three" is implemented as a two text objects,
+ with a top level text object containing an embed character "one ? three" and a
+ child text object containing "two" and if the caret is in the descendant object
+ just before the 'o' in "two", then:
+ <ul>
+ <li>the caretOffset for the "one ? three" object would be 4, matching the embed character</li>
+ <li>the caretOffset for "two" would be 2, matching the "o"</li>
+ </ul>
+ The caret position/offset is that of the character logically following it, e.g.
+ to the right of it in a left to right language, or to the left of it in a right
+ to left language.
+ @param [out] offset
+ The returned offset is relative to the text represented by this object.
+ @retval S_OK
+ @retval S_FALSE if the caret is not currently active on this object, i.e. the
+ caret is located on some other object. The returned offset value will be -1.
+ @note S_FALSE (and an offset of -1) will not be returned if the caret is somewhere
+ in the text object or one of its descendants.
+ */
+ [propget] HRESULT caretOffset
+ (
+ [out, retval] long *offset
+ );
+
+
+ /** @brief Returns the bounding box of the specified position.
+
+ The virtual character after the last character of the represented
+ text, i.e. the one at position length is a special case. It represents the
+ current input position and will therefore typically be queried by AT more
+ often than other positions. Because it does not represent an existing character
+ its bounding box is defined in relation to preceding characters. It should be
+ roughly equivalent to the bounding box of some character when inserted at the
+ end of the text. Its height typically being the maximal height of all the
+ characters in the text or the height of the preceding character, its width being
+ at least one pixel so that the bounding box is not degenerate.
+
+ Note that the index 'length' is not always valid. Whether it is or not is
+ implementation dependent. It typically is when text is editable or otherwise
+ when on the screen the caret can be placed behind the text. You can be sure
+ that the index is valid after you have received a ::IA2_EVENT_TEXT_CARET_MOVED
+ event for this index.
+ @param [in] offset
+ Index of the character for which to return its bounding box. The valid range
+ is 0..length. Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @param [in] coordType
+ Specifies if the coordinates are relative to the screen or to the parent window.
+ @param [out] x
+ X coordinate of the top left corner of the bounding box of the referenced character.
+ @param [out] y
+ Y coordinate of the top left corner of the bounding box of the referenced character.
+ @param [out] width
+ Width of the bounding box of the referenced character.
+ @param [out] height
+ Height of the bounding box of the referenced character.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT characterExtents
+ (
+ [in] long offset,
+ [in] enum IA2CoordinateType coordType,
+ [out] long *x,
+ [out] long *y,
+ [out] long *width,
+ [out, retval] long *height
+ );
+
+
+ /** @brief Returns the number of active non-contiguous selections
+ @param [out] nSelections
+ @retval S_OK
+ */
+ [propget] HRESULT nSelections
+ (
+ [out, retval] long *nSelections
+ );
+
+ /** @brief Returns the text position for the specified screen position.
+
+ Given a point return the zero-based index of the character under that
+ point. The same functionality could be achieved by using the bounding
+ boxes for each character as returned by IAccessibleText::characterExtents.
+ The method IAccessibleText::offsetAtPoint, however, can be implemented
+ more efficiently.
+
+ @param [in] x
+ The position's x value for which to look up the index of the character that
+ is rendered on to the display at that point.
+ @param [in] y
+ The position's y value for which to look up the index of the character that
+ is rendered on to the display at that point.
+ @param [in] coordType
+ Screen coordinates or window coordinates.
+ @param [out] offset
+ Index of the character under the given point or -1 if the point
+ is invalid or there is no character under the point.
+ @retval S_OK
+ @retval S_FALSE if nothing to return, [out] value is -1
+
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT offsetAtPoint
+ (
+ [in] long x,
+ [in] long y,
+ [in] enum IA2CoordinateType coordType,
+ [out, retval] long *offset
+ );
+
+ /** @brief Returns the character offsets of Nth active text selection
+
+ Returns the 0-based starting and ending offsets of the Nth selection. If the
+ text is implemented as a tree of text objects with embed characters in higher
+ levels representing substrings of child text objects, consider the following.
+ If the starting selection offset is in one of the child text objects, then the
+ starting offset in the higher level text object would be at the embed character
+ representing the child text object that contains the starting selection offset.
+ If the ending selection offset is in one of the child text objects, then the
+ ending offset in the higher level text object would be just after the embed
+ character representing the child text object that contains the ending selection
+ offset.
+
+ For example, if the string "one two three" is implemented as a two text objects,
+ with a top level text object containing an embed character "one ? three" and a
+ child text object containing "two" and if the selection is the string "two" then:
+ <ul>
+ <li>the startOffset for the "one ? three" object would be 4, matching the embed character and the endOffset would be 5.</li>
+ <li>the startOffset for the "two" object would be 0, and the endOffset would be 3</li>
+ </ul>
+ Selection offsets are that of the character logically following it, e.g.
+ to the right of it in a left to right language or to the left of it in a right to left language.
+ @param [in] selectionIndex
+ Index of selection (0 based).
+ @param [out] startOffset
+ 0 based offset of first selected character
+ @param [out] endOffset
+ 0 based offset of one past the last selected character.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT selection
+ (
+ [in] long selectionIndex,
+ [out] long *startOffset,
+ [out, retval] long *endOffset
+ );
+
+ /** @brief Returns the substring between the two given indices.
+
+ The substring starts with the character at startOffset (inclusive) and up to
+ the character at endOffset (exclusive), if startOffset is less or equal
+ endOffset. If endOffset is lower than startOffset, the result is the same
+ as a call with the two arguments being exchanged.
+
+ The whole text can be requested by passing the indices zero and
+ IAccessibleText::nCharacters. If both indices have the same value, an empty
+ string is returned.
+ @param [in] startOffset
+ Index of the first character to include in the returned string. The valid range
+ is 0..length.
+ @param [in] endOffset
+ Index of the last character to exclude in the returned string. The valid range
+ is 0..length.
+ @param [out] text
+ Returns the substring starting with the character at startOffset (inclusive)
+ and up to the character at endOffset (exclusive), if startOffset is less than
+ or equal to endOffset.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note
+ @li The returned string may be longer than endOffset-startOffset bytes if text
+ contains multi-byte characters.
+ @li Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ */
+ [propget] HRESULT text
+ (
+ [in] long startOffset,
+ [in] long endOffset,
+ [out, retval] BSTR *text
+ );
+
+ /** @brief Returns a text portion before the given position.
+
+ Returns the substring of the specified text type that is located before the
+ given character and does not include it. The result of this method should be
+ same as a result for IAccessibleText::textAtOffset with a suitably decreased
+ index value.
+
+ For example, if text type is ::IA2_TEXT_BOUNDARY_WORD, then the complete
+ word that is closest to and located before offset is returned.
+
+ If the index is valid, but no text is found, S_FALSE is returned along with out
+ values of 0, 0, and a NULL pointer. This would happen for boundary types other
+ than character when the text consists entirely of whitespace.
+
+ @param [in] offset
+ Index of the character for which to return the text part before it. The index
+ character will not be part of the returned string. The valid range is 0..length.
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @param [in] boundaryType
+ The type of the text portion to return. See ::IA2TextBoundaryType for the
+ complete list.
+ @param [out] startOffset
+ 0 based offset of first character.
+ @param [out] endOffset
+ 0 based offset of one past the last character.
+ @param [out] text
+ Returns the requested text portion. This portion may be empty or invalid when
+ no appropriate text portion is found or text type is invalid.
+ @retval S_OK
+ @retval S_FALSE if the requested boundary type is not implemented, such as
+ ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
+ [out] values are 0s and NULL respectively
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT textBeforeOffset
+ (
+ [in] long offset,
+ [in] enum IA2TextBoundaryType boundaryType,
+ [out] long *startOffset,
+ [out] long *endOffset,
+ [out, retval] BSTR *text
+ );
+
+ /** @brief Returns a text portion after the given position.
+
+ Returns the substring of the specified text type that is located after the
+ given character and does not include it. The result of this method should be
+ same as a result for IAccessibleText::textAtOffset with a suitably increased
+ index value.
+
+ For example, if text type is ::IA2_TEXT_BOUNDARY_WORD, then the complete
+ word that is closest to and located after offset is returned.
+
+ If the index is valid, but no text is found, S_FALSE is returned along with out
+ values of 0, 0, and a NULL pointer. This would happen for boundary types other
+ than character when the text consists entirely of whitespace.
+
+ @param [in] offset
+ Index of the character for which to return the text part after it. The index
+ character will not be part of the returned string. The valid range is 0..length.
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @param [in] boundaryType
+ The type of the text portion to return. See ::IA2TextBoundaryType for the complete
+ list.
+ @param [out] startOffset
+ 0 based offset of first character.
+ @param [out] endOffset
+ 0 based offset of one past the last character.
+ @param [out] text
+ Returns the requested text portion. This portion may be empty or invalid when
+ no appropriate text portion is found or text type is invalid.
+ @retval S_OK
+ @retval S_FALSE if the requested boundary type is not implemented, such as
+ ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
+ [out] values are 0s and NULL respectively
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT textAfterOffset
+ (
+ [in] long offset,
+ [in] enum IA2TextBoundaryType boundaryType,
+ [out] long *startOffset,
+ [out] long *endOffset,
+ [out, retval] BSTR *text
+ );
+
+ /** @brief Returns a text portion that spans the given position.
+
+ Returns the substring defined by the specified boundary type at the specified
+ offset. Refer to IA2TextBoundaryType for more details.
+
+ For the word boundary type the returned string will contain the word at the
+ offset if the offset is inside a word and will contain the word before the
+ offset if the offset is not inside a word. All offsets from the first to the
+ last characters of a word are considered inside the word. Boundary types of
+ sentence and paragraph should exhibit similar behavior.
+
+ If the index is valid, but no text is found, S_FALSE is returned along with out
+ values of 0, 0, and a NULL pointer. This would happen for boundary types other
+ than character when the text consists entirely of whitespace.
+
+ @param [in] offset
+ Index of the character for which to return the text part it belongs to. The valid
+ range is 0..length.
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @param [in] boundaryType
+ The type of the text portion to return. See ::IA2TextBoundaryType for the complete
+ list.
+ @param [out] startOffset
+ 0 based offset of first character.
+ @param [out] endOffset
+ 0 based offset of one past the last character.
+ @param [out] text
+ Returns the requested text portion. This portion may be empty or invalid when
+ no appropriate text portion is found or text type is invalid.
+ @retval S_OK
+ @retval S_FALSE if the requested boundary type is not implemented, such as
+ ::IA2_TEXT_BOUNDARY_SENTENCE, or if there is nothing to return;
+ [out] values are 0s and NULL respectively
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT textAtOffset
+ (
+ [in] long offset,
+ [in] enum IA2TextBoundaryType boundaryType,
+ [out] long *startOffset,
+ [out] long *endOffset,
+ [out, retval] BSTR *text
+ );
+
+ /** @brief Unselects a range of text.
+ @param [in] selectionIndex
+ Index of selection to remove (0 based).
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT removeSelection
+ (
+ [in] long selectionIndex
+ );
+
+ /** @brief Sets the position of the caret.
+
+ The caret position/offset is that of the character logically following it,
+ e.g. to the right of it in a left to right language.
+
+ Setting the caret position may or may not alter the current selection. A
+ change of the selection is notified to the accessibility event listeners with
+ an ::IA2_EVENT_TEXT_SELECTION_CHANGED event.
+
+ When the new caret position differs from the old one (which, of course, is the
+ standard case) this is notified to the accessibility event listeners with an
+ ::IA2_EVENT_TEXT_CARET_MOVED event.
+ @param [in] offset
+ The new index of the caret. This caret is actually placed to the left side of
+ the character with that index. An index of 0 places the caret so that the next
+ insertion goes before the first character. An index of IAccessibleText::nCharacters
+ leads to insertion after the last character. Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ @retval S_OK
+ @retval E_FAIL if the caret cannot be set
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT setCaretOffset
+ (
+ [in] long offset
+ );
+
+ /** @brief Changes the bounds of an existing selection.
+ @param [in] selectionIndex
+ Index of selection to change (0 based)
+ @param [in] startOffset
+ New starting offset (0 based)
+ @param [in] endOffset
+ New ending offset (0 based) - the offset of the character just past the last character of the selection.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ */
+ HRESULT setSelection
+ (
+ [in] long selectionIndex,
+ [in] long startOffset,
+ [in] long endOffset
+ );
+
+ /** @brief Returns total number of characters.
+
+ Note that this may be different than the total number of bytes required to store the
+ text, if the text contains multi-byte characters.
+ @param [out] nCharacters
+ @retval S_OK
+ */
+ [propget] HRESULT nCharacters
+ (
+ [out, retval] long *nCharacters
+ );
+
+ /** @brief Makes a specific part of string visible on screen.
+ @param [in] startIndex
+ 0 based character offset.
+ @param [in] endIndex
+ 0 based character offset - the offset of the character just past the last character of the string.
+ @param [in] scrollType
+ Defines where the object should be placed on the screen.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ */
+ HRESULT scrollSubstringTo
+ (
+ [in] long startIndex,
+ [in] long endIndex,
+ [in] enum IA2ScrollType scrollType
+ );
+
+ /** @brief Moves the top left of a substring to a specified location.
+
+ @param [in] startIndex
+ 0 based character offset.
+ @param [in] endIndex
+ 0 based character offset - the offset of the character just past the last character of the string.
+ @param [in] coordinateType
+ Specifies whether the coordinates are relative to the screen or the parent object.
+ @param [in] x
+ Defines the x coordinate.
+ @param [in] y
+ Defines the y coordinate.
+ @retval S_OK
+ @retval S_FALSE if the object is already at the specified location.
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleText methods.
+ */
+ HRESULT scrollSubstringToPoint
+ (
+ [in] long startIndex,
+ [in] long endIndex,
+ [in] enum IA2CoordinateType coordinateType,
+ [in] long x,
+ [in] long y
+ );
+
+ /** @brief Returns any inserted text.
+
+ Provided for use by the ::IA2_EVENT_TEXT_INSERTED and ::IA2_EVENT_TEXT_UPDATED
+ event handlers.
+
+ This data is only guaranteed to be valid while the thread notifying the event
+ continues. Once the handler has returned, the validity of the data depends on
+ how the server manages the life cycle of its objects. Also, note that the server
+ may have different life cycle management strategies for controls depending on
+ whether or not a control manages its children. Lists, trees, and tables can have
+ a large number of children and thus it's possible that the child objects for those
+ controls would only be created as needed. Servers should document their life cycle
+ strategy as this will be of interest to assistive technology or script engines
+ accessing data out of process or from other threads. Servers only need to save the
+ last inserted block of text and a scope of the entire application is adequate.
+
+ @param [out] newText
+ The text that was just inserted.
+ @retval S_OK
+ @retval S_FALSE If there is nothing to return, the values of IA2TextSegment
+ struct are set as follows: text = NULL, start = 0, end = 0.
+
+ */
+ [propget] HRESULT newText
+ (
+ [out, retval] IA2TextSegment *newText
+ );
+
+ /** @brief Returns any removed text.
+
+ Provided for use by the IA2_EVENT_TEXT_REMOVED/UPDATED event handlers.
+
+ This data is only guaranteed to be valid while the thread notifying the event
+ continues. Once the handler has returned, the validity of the data depends on
+ how the server manages the life cycle of its objects. Also, note that the server
+ may have different life cycle management strategies for controls depending on
+ whether or not a control manages its children. Lists, trees, and tables can have
+ a large number of children and thus it's possible that the child objects for those
+ controls would only be created as needed. Servers should document their life cycle
+ strategy as this will be of interest to assistive technology or script engines
+ accessing data out of process or from other threads. Servers only need to save the
+ last removed block of text and a scope of the entire application is adequate.
+
+ @param [out] oldText
+ The text that was just removed.
+ @retval S_OK
+ @retval S_FALSE If there is nothing to return, the values of IA2TextSegment
+ struct are set as follows: text = NULL, start = 0, end = 0.
+ */
+ [propget] HRESULT oldText
+ (
+ [out, retval] IA2TextSegment *oldText
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleText2.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+
+/** @brief This interface gives read-only access to text.
+
+ The %IAccessibleText2 interface extends the functionality of the
+ %IAccessibleText interface.
+*/
+[object, uuid(9690A9CC-5C80-4DF5-852E-2D5AE4189A54)]
+interface IAccessibleText2 : IAccessibleText
+{
+
+ /** @brief Returns the range and of the specified set of attributes.
+
+ Return the range (start and end offsets) and text attributes that correspond
+ to the given attributes filter at the given offset.
+
+ @param [in] offset
+ The offset at which to search for the attributes specified in the filter.
+ @param [in] filter
+ The requested attribute names. The filter format is "attribute1, attribute2".
+ @param [out] startOffset
+ The starting (0-based) offset of the text containing the specified attributes.
+ @param [out] endOffset
+ The (0-based) offset one past the last character of the text containing the
+ specified attributes.
+ @param [out] attributeValues
+ The values of the requested attributes.
+ @retval S_OK
+ @retval S_FALSE if nothing to return, [out] values are -1, -1, NULL respectively.
+ @retval E_INVALIDARG if bad [in] passed.
+ */
+ [propget] HRESULT attributeRange
+ (
+ [in] long offset,
+ [in] BSTR filter,
+ [out] long *startOffset,
+ [out] long *endOffset,
+ [out, retval] BSTR *attributeValues
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleEditableText.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2012 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+/** @brief This interface provides clipboard capability to text objects.
+
+ This interface is typically used in conjunction with the IAccessibleText
+ interface and complements that interface with the additional capability of
+ clipboard operations. Note that even a read only text object can support
+ the copy capability so this interface is not limited to editable objects.
+
+ The substrings used with this interface are specified as follows:
+ If startOffset is less than endOffset, the substring starts with the
+ character at startOffset and ends with the character just before endOffset.
+ If endOffset is lower than startOffset, the result is the same as a call
+ with the two arguments exchanged. The whole text can be defined by passing
+ the indices zero and IAccessibleText::nCharacters. If both indices have the
+ same value, an empty string is defined.
+
+ Refer to the @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about a special offset constant that can be used in %IAccessibleEditableText methods.
+*/
+[object, uuid(A59AA09A-7011-4b65-939D-32B1FB5547E3)]
+interface IAccessibleEditableText : IUnknown
+{
+
+ /** @brief Copies the text range into the clipboard.
+
+ The selection is set to the specified offsets and then selection is copied into
+ the system clipboard.
+
+ @param [in] startOffset
+ Start index of the text to moved into the clipboard.
+ The valid range is 0..length.
+ @param [in] endOffset
+ End index of the text to moved into the clipboard.
+ The valid range is 0..length.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ @deprecated This function is available via the application's GUI.
+ */
+ HRESULT copyText
+ (
+ [in] long startOffset,
+ [in] long endOffset
+ );
+
+ /** @brief Deletes a range of text.
+
+ The text between and including the two given indices is deleted
+ from the text represented by this object.
+
+ @param [in] startOffset
+ Start index of the text to be deleted.
+ The valid range is 0..length.
+ @param [in] endOffset
+ End index of the text to be deleted.
+ The valid range is 0..length.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ */
+ HRESULT deleteText
+ (
+ [in] long startOffset,
+ [in] long endOffset
+ );
+
+ /** @brief Inserts text at the specified position.
+
+ The specified string is inserted at the given index into the text
+ represented by this object.
+
+ @param [in] offset
+ Index at which to insert the text.
+ The valid range is 0..length.
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ @param [in] text
+ Text that is inserted.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT insertText
+ (
+ [in] long offset,
+ [in] BSTR *text
+ );
+
+ /** @brief Deletes a range of text and copies it to the clipboard.
+
+ The selection is set to the specified offsets, the selection is then copied into
+ the system clipboard, and then the selection is deleted.
+
+ @param [in] startOffset
+ Start index of the text to be deleted.
+ The valid range is 0..length.
+ @param [in] endOffset
+ End index of the text to be deleted.
+ The valid range is 0..length.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ @deprecated This function is available via the application's GUI.
+ */
+ HRESULT cutText
+ (
+ [in] long startOffset,
+ [in] long endOffset
+ );
+
+ /** @brief Pastes content from the clipboard.
+
+ Any existing selection is removed, the clipboard content is then pasted into
+ this object's text at the given offset. This method is similar to the insertText
+ method. If the index is not valid the system clipboard content is not inserted. The
+ behavior is the same as when Ctrl+V is used, i.e. the pasted contents are not
+ necessarily plain text.
+
+ @param [in] offset
+ Index at which to insert the content from the system clipboard into
+ the text represented by this object.
+ The valid range is 0..length.
+ Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @deprecated This function is available via the application's GUI.
+ */
+ HRESULT pasteText
+ (
+ [in] long offset
+ );
+
+ /** @brief Replaces text.
+
+ The text between the two given indices is replaced by the specified
+ replacement string. This method is equivalent to calling first
+ IAccessibleEditableText::deleteText with the two indices and then
+ calling IAccessibleEditableText::insertText with the replacement text
+ at the start index.
+
+ @param [in] startOffset
+ Start index of the text to be replaced.
+ The valid range is 0..length.
+ @param [in] endOffset
+ End index of the text to be replaced.
+ The valid range is 0..length.
+ @param [in] text
+ The Text that replaces the text between the given indices.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ */
+ HRESULT replaceText
+ (
+ [in] long startOffset,
+ [in] long endOffset,
+ [in] BSTR *text
+ );
+
+ /** @brief Replaces the attributes of a text range by the given set of attributes.
+
+ Sets the attributes for the text between the two given indices. The old
+ attributes are replaced by the new list of attributes.
+
+ @param [in] startOffset
+ Start index of the text whose attributes are modified.
+ The valid range is 0..length.
+ @param [in] endOffset
+ End index of the text whose attributes are modified.
+ The valid range is 0..length.
+ @param [in] attributes
+ Set of attributes that replaces the old list of attributes of
+ the specified text portion.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ @note Refer to @ref _specialOffsets
+ "Special Offsets for use in the IAccessibleText and IAccessibleEditableText Methods"
+ for information about special offsets that can be used in %IAccessibleEditableText
+ methods.
+ */
+ HRESULT setAttributes
+ (
+ [in] long startOffset,
+ [in] long endOffset,
+ [in] BSTR *attributes
+ );
+}
+
+/*************************************************************************
+ *
+ * File Name (AccessibleHyperlink.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2010 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+/** @brief This interface represents hyperlinks.
+
+ This interface represents a hyperlink associated with a single substring
+ of text or single non-text object. Non-text objects can have either a
+ single link or a collection of links such as when the non-text object is
+ an image map.
+
+ Linked objects and anchors are implementation dependent. This interface is derived
+ from IAccessibleAction. IAccessibleAction::nActions is one greater than the
+ maximum value for the indices used with the methods of this interface.
+
+ Furthermore, the object that implements this interface has to be connected
+ implicitly or explicitly with an object that implements IAccessibleText.
+ IAccessibleHyperlink::startIndex and IAccessibleHyperlink::endIndex are
+ indices with respect to the text exposed by IAccessibleText.
+
+ This interface provides access to a single object which can have multiple actions.
+ An example is an image map which is an image with multiple links each of which is
+ associated with a separate non-overlapping area of the image. This interface could
+ also be applied to other kinds of objects with multiple actions such as "smart tags"
+ which are objects, typically strings, which have multiple actions such as
+ "Activate URI", "Bookmark URI", etc.
+
+ An interesting use case is an image map where each area is associated with multiple
+ actions, e.g. an image map of smart tags. In this case you would have to implement
+ two levels of accessible hyperlinks. The first level hyperlinks would only implement
+ anchor and anchorTarget. The anchors would all reference the image object. The
+ anchorTargets would reference the second level accessible hyperlink objects. None
+ of the IAccessibleAction methods would be implemented on the first level hyperlink
+ objects. The second level hyperlink objects would implement the IAccessibleAction
+ methods. Their anchors would also reference the image object and their anchorTargets
+ would reference URLs or the objects that would be activated.
+
+ This use case demonstrates that in some cases there is no need for IAccessibleHyperlink
+ to derive from IAccessibleAction. As a result it may be removed in a later version of
+ the IDL and it is suggested that implementations should not rely on the inheritance.
+
+*/
+[object, uuid(01C20F2B-3DD2-400f-949F-AD00BDAB1D41)]
+interface IAccessibleHyperlink : IAccessibleAction
+{
+
+ /** @brief Returns an object that represents the link anchor, as appropriate
+ for the link at the specified index.
+ @param [in] index
+ A 0 based index identifies the anchor when, as in the case of an image map,
+ there is more than one link represented by this object. The valid maximal
+ index is indicated by IAccessibleAction::nActions.
+ @param [out] anchor
+ This is an implementation dependent value. For example, for a text link this
+ method could return the substring of the containing string where the substring
+ is overridden with link behavior, and for an image link this method could return
+ an IUnknown VARIANT for IAccessibleImage. See the section about
+ @ref _variants "VARIANTs" for additional information.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT anchor
+ (
+ [in] long index,
+ [out, retval] VARIANT *anchor
+ );
+
+ /** @brief Returns an object representing the target of the link, as appropriate
+ for the link at the specified index.
+ @param [in] index
+ A 0 based index identifies the anchor when, as in the case of an image map,
+ there is more than one link represented by this object. The valid maximal
+ index is indicated by IAccessibleAction::nActions.
+ @param [out] anchorTarget
+ This is an implementation dependent value. For example this method could
+ return a BSTR VARIANT of the URI. Alternatively this method could return an
+ IUnknown VARIANT of a COM interface representing a target object to be
+ activated when the link is activated. See the section about
+ @ref _variants "VARIANTs" for additional information.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT anchorTarget
+ (
+ [in] long index,
+ [out, retval] VARIANT *anchorTarget
+ );
+
+ /** @brief Returns the 0 based character offset at which the textual representation of the hyperlink starts.
+
+ The returned value is related to the IAccessibleText interface of the object that
+ owns this hyperlink.
+ @param [out] index
+ @retval S_OK
+ */
+ [propget] HRESULT startIndex
+ (
+ [out, retval] long *index
+ );
+
+ /** @brief Returns the 0 based character offset at which the textual representation of the hyperlink ends.
+
+ The returned value is related to the IAccessibleText interface of the object that
+ owns this hyperlink. The character at the index is not part of the hypertext.
+ @param [out] index
+ @retval S_OK
+ */
+ [propget] HRESULT endIndex
+ (
+ [out, retval] long *index
+ );
+
+ /** @brief Returns whether the target object referenced by this link is still valid.
+
+ This is a volatile state that may change without sending an appropriate event.
+ Returns TRUE if the referenced target is still valid and FALSE otherwise.
+
+ This has also been used to indicate whether or not the URI of the anchorTarget
+ is malformed.
+
+ @param [out] valid
+ If false, one or more of the object's links are invalid.
+ If true, all of the object's links are valid.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is FALSE
+ @note This method is not being used, is deprecated, and should not be implemented or
+ used. It is likely that this method will be removed in a later version of the IDL.
+ */
+ [propget] HRESULT valid
+ (
+ [out, retval] boolean *valid
+ );
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleHypertext.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2010 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+
+/** @brief This interface exposes information about hypertext in a document.
+
+ The %IAccessibleHypertext interface is the main interface to expose
+ hyperlinks in a document, typically a text document, that are used
+ to reference other documents. A typical implementation is to implement
+ this interface on the smallest text object such as a paragraph of text.
+*/
+[object, uuid(6B4F8BBF-F1F2-418a-B35E-A195BC4103B9)]
+interface IAccessibleHypertext : IAccessibleText
+{
+
+ /** @brief Returns the number of links and link groups contained within this hypertext
+ paragraph.
+ @param [out] hyperlinkCount
+ The number of links and link groups within this hypertext paragraph.
+ Returns 0 if there is no link.
+ @retval S_OK
+ */
+ [propget] HRESULT nHyperlinks
+ (
+ [out, retval] long *hyperlinkCount
+ );
+
+ /** @brief Returns the specified link.
+
+ The returned IAccessibleHyperlink object encapsulates the hyperlink and
+ provides several kinds of information describing it.
+ @param [in] index
+ This 0 based index specifies the hyperlink to return.
+ @param [out] hyperlink
+ If the given index is valid, i.e. lies in the interval from 0 to the number
+ of links minus one, a reference to the specified hyperlink object is returned.
+ If the index is invalid then a NULL pointer is returned.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT hyperlink
+ (
+ [in] long index,
+ [out, retval] IAccessibleHyperlink **hyperlink
+ );
+
+ /** @brief Returns the index of the hyperlink that is associated with this character index.
+
+ This is the case when a link spans the given character index.
+ @param [in] charIndex
+ A 0 based index of the character for which to return the link index. If
+ IAccessibleText is used to represent the text containing the link, then the
+ character index is only valid if it is greater than or equal to zero and
+ lower than the number of characters in the text.
+ @param [out] hyperlinkIndex
+ Returns the 0 based index of the hyperlink that is associated with this
+ character index, or -1 if charIndex is not on a link.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is -1
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT hyperlinkIndex
+ (
+ [in] long charIndex,
+ [out, retval] long *hyperlinkIndex
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleHypertext2.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+
+/** @brief This interface exposes information about hypertext in a document.
+
+ The %IAccessibleHypertext2 interface extends the functinality of the
+ %IAccessibleHypertext inteface.
+*/
+[object, uuid(CF64D89F-8287-4B44-8501-A827453A6077)]
+interface IAccessibleHypertext2 : IAccessibleHypertext
+{
+
+ /** @brief Returns the links for this object.
+
+ The returned IAccessibleHyperlink objects encapsulate the hyperlink and
+ provides several kinds of information describing it.
+
+ @param [out] hyperlinks
+ This array is allocated by the server. The client must free it with CoTaskMemFree.
+ @param [out] nHyperlinks
+ The number of links returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are no links, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT hyperlinks
+ (
+ [out, size_is(,*nHyperlinks)] IAccessibleHyperlink ***hyperlinks,
+ [out, retval] long *nHyperlinks
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleTable.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2013 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+
+/** @brief This interface gives access to a two-dimensional table.
+
+ Typically all accessible objects that represent cells or cell-clusters of a table
+ will be at the same time children of the table. In this case IAccessible2::indexInParent
+ will return the child index which then can be used when calling IAccessibleTable::rowIndex
+ and IAccessibleTable::columnIndex.
+
+ However, in some cases that kind of implementation will not be possible. When
+ the table cells are not direct children of a table, the object representing
+ the cell can define a "table-cell-index" object attribute identifying the 0
+ based table cell index. This object attribute is obtained by parsing the
+ attribute string returned by IAccessible2::attributes. The "table-cell-index"
+ attribute can be used just like a child index of the typical case. ATs should
+ first test for the presence of the "table-cell-index" attribute and if it is not
+ present then IAccessible2::indexInParent can be used as in the typical case
+ where cells are direct children of the table.
+
+ The range of valid coordinates for this interface are implementation dependent.
+ However, that range includes at least the intervals from the from the first row
+ or column with the index 0 up to the last (but not including) used row or column
+ as returned by IAccessibleTable::nRows and IAccessibleTable::nColumns.
+
+ Note that newer implementations are now using IAccessibleTable2 and IAccessibleTableCell
+ rather than this interface.
+*/
+[object, uuid(35AD8070-C20C-4fb4-B094-F4F7275DD469)]
+interface IAccessibleTable : IUnknown
+{
+
+ /** @brief Returns the accessible object at the specified row and column in
+ the table. This object could be an IAccessible or an IAccessible2.
+ @param [in] row
+ The 0 based row index for which to retrieve the cell.
+ @param [in] column
+ The 0 based column index for which to retrieve the cell.
+ @param [out] accessible
+ If both row and column index are valid then the corresponding accessible
+ object is returned that represents the requested cell regardless of whether
+ the cell is currently visible (on the screen).
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is NULL
+ */
+ [propget] HRESULT accessibleAt
+ (
+ [in] long row,
+ [in] long column,
+ [out, retval] IUnknown **accessible
+ );
+
+ /** @brief Returns the caption for the table. The returned object could be
+ an IAccessible or an IAccessible2.
+ @param [out] accessible
+ If the table has a caption then a reference to it is returned, else a NULL
+ pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT caption
+ (
+ [out, retval] IUnknown **accessible
+ );
+
+ /** @brief Translates the given row and column indexes into the corresponding cell index.
+ @param [in] rowIndex
+ 0 based row index for the cell.
+ @param [in] columnIndex
+ 0 based column index for the cell.
+ @param [out] cellIndex
+ Returns the 0 based index of the cell at the specified row and column indexes.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is 0
+ @note The returned value is not necessarily a child index of the immediate parent.
+ In cases where the table cells are not direct children of the table the index
+ is actually the cell index, i.e. conceptually it's an index into a one dimensional
+ array of cells laid out in row order.
+ */
+ [propget] HRESULT childIndex
+ (
+ [in] long rowIndex,
+ [in] long columnIndex,
+ [out, retval] long *cellIndex
+ );
+
+ /** @brief Returns the description text of the specified column in the table.
+ @param [in] column
+ The 0 based index of the column for which to retrieve the description.
+ @param [out] description
+ Returns the description text of the specified column in the table if such a
+ description exists. Otherwise a NULL pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed, [out] value is NULL
+ */
+ [propget] HRESULT columnDescription
+ (
+ [in] long column,
+ [out, retval] BSTR *description
+ );
+
+ /** @brief Returns the number of columns occupied by the accessible object
+ at the specified row and column in the table.
+
+ The result is greater than 1 if the specified cell spans multiple columns.
+ @param [in] row
+ 0 based row index of the accessible for which to return the column extent.
+ @param [in] column
+ 0 based column index of the accessible for which to return the column extent.
+ @param [out] nColumnsSpanned
+ Returns the 1 based column extent of the specified cell.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is 0
+ */
+ [propget] HRESULT columnExtentAt
+ (
+ [in] long row,
+ [in] long column,
+ [out, retval] long *nColumnsSpanned
+ );
+
+ /** @brief Returns the column headers as an %IAccessibleTable object.
+
+ Content and size of the returned table are implementation dependent.
+ @param [out] accessibleTable
+ The column header
+ @param [out] startingRowIndex
+ The 0 based row index where the header starts, usually 0.
+ @retval S_OK
+ @retval S_FALSE if there is no header, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT columnHeader
+ (
+ [out] IAccessibleTable **accessibleTable,
+ [out, retval] long *startingRowIndex
+ );
+
+ /** @brief Translates the given cell index into the corresponding column index.
+ @param [in] cellIndex
+ 0 based index of the cell in the parent or closest ancestor table. Typically this
+ is the value returned from IAccessible2::indexInParent, but in the case where the
+ table cells are not direct children of the table this is the cell index specified
+ by the "table-cell-index" object attribute obtained from parsing the attributes
+ string returned by calling IAccessible2::attributes on the cell object.
+ @param [out] columnIndex
+ Returns the 0 based column index of the cell of the specified child or the index of
+ the first column if the child spans multiple columns.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is 0
+ */
+ [propget] HRESULT columnIndex
+ (
+ [in] long cellIndex,
+ [out, retval] long *columnIndex
+ );
+
+ /** @brief Returns the total number of columns in table
+ @param [out] columnCount
+ Number of columns in table (including columns outside the current viewport)
+ @retval S_OK
+ */
+ [propget] HRESULT nColumns
+ (
+ [out, retval] long *columnCount
+ );
+
+ /** @brief Returns the total number of rows in table
+ @param [out] rowCount
+ Number of rows in table (including rows outside the current viewport)
+ @retval S_OK
+ */
+ [propget] HRESULT nRows
+ (
+ [out, retval] long *rowCount
+ );
+
+ /** @brief Returns the total number of selected cells
+ @param [out] cellCount
+ Number of cells currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedChildren
+ (
+ [out, retval] long *cellCount
+ );
+
+ /** @brief Returns the total number of selected columns
+ @param [out] columnCount
+ Number of columns currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedColumns
+ (
+ [out, retval] long *columnCount
+ );
+
+ /** @brief Returns the total number of selected rows
+ @param [out] rowCount
+ Number of rows currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedRows
+ (
+ [out, retval] long *rowCount
+ );
+
+ /** @brief Returns the description text of the specified row in the table.
+ @param [in] row
+ The 0 based index of the row for which to retrieve the description.
+ @param [out] description
+ Returns the description text of the specified row in the table if such a
+ description exists. Otherwise a NULL pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed, [out] value is NULL
+ */
+ [propget] HRESULT rowDescription
+ (
+ [in] long row,
+ [out, retval] BSTR *description
+ );
+
+ /** @brief Returns the number of rows occupied by the accessible object
+ at the specified row and column in the table.
+
+ The result is greater than 1 if the specified cell spans multiple rows.
+ @param [in] row
+ 0 based row index of the accessible for which to return the row extent.
+ @param [in] column
+ 0 based column index of the accessible for which to return the row extent.
+ @param [out] nRowsSpanned
+ Returns the row extent of the specified cell.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is 0
+ */
+ [propget] HRESULT rowExtentAt
+ (
+ [in] long row,
+ [in] long column,
+ [out, retval] long *nRowsSpanned
+ );
+
+ /** @brief Returns the row headers as an %IAccessibleTable object.
+
+ Content and size of the returned table are implementation dependent.
+ @param [out] accessibleTable
+ The row header.
+ @param [out] startingColumnIndex
+ The 0 based column index where the header starts, usually 0.
+ @retval S_OK
+ @retval S_FALSE if there is no header, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT rowHeader
+ (
+ [out] IAccessibleTable **accessibleTable,
+ [out, retval] long *startingColumnIndex
+ );
+
+ /** @brief Translates the given cell index into a row index.
+ @param [in] cellIndex
+ 0 based index of the cell in the parent or closest ancestor table. Typically this
+ is the value returned from IAccessible2::indexInParent, but in the case where the
+ table cells are not direct children of the table this is the cell index specified
+ by the "table-cell-index" object attribute obtained from parsing the attributes
+ string returned by calling IAccessible2::attributes on the cell object.
+ @param [out] rowIndex
+ 0 based row index
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is 0
+ */
+ [propget] HRESULT rowIndex
+ (
+ [in] long cellIndex,
+ [out, retval] long *rowIndex
+ );
+
+ /** @brief Returns a list of cell indexes currently selected (0 based).
+ @param [in] maxChildren
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] children
+ An array of cell indexes of selected cells (each index is 0 based),
+ allocated by the server. The client must free it with CoTaskMemFree.
+ @param [out] nChildren
+ The number of cell indexes returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedChildren
+ (
+ [in] long maxChildren,
+ [out, size_is(,maxChildren), length_is(,*nChildren)] long **children,
+ [out, retval] long *nChildren
+ );
+
+ /** @brief Returns a list of column indexes currently selected (0 based).
+ @param [in] maxColumns
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] columns
+ An array of column indexes of selected columns (each index is 0 based), allocated
+ by the server. The client must free it with CoTaskMemFree.
+ @param [out] nColumns
+ The number of column indexes returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedColumns
+ (
+ [in] long maxColumns,
+ [out, size_is(,maxColumns), length_is(,*nColumns)] long **columns,
+ [out, retval] long *nColumns
+ );
+
+ /** @brief Returns a list of row indexes currently selected (0 based).
+ @param [in] maxRows
+ This parameter is ignored. Refer to @ref _arrayConsideration
+ "Special Consideration when using Arrays" for more details.
+ @param [out] rows
+ An array of row indexes of selected rows (each index is 0 based), allocated
+ by the server. The client must free it with CoTaskMemFree.
+ @param [out] nRows
+ The number of row indexes returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedRows
+ (
+ [in] long maxRows,
+ [out, size_is(,maxRows), length_is(,*nRows)] long **rows,
+ [out, retval] long *nRows
+ );
+
+ /** @brief Returns the summary description of the table. The returned object could be
+ an IAccessible or an IAccessible2.
+ @param [out] accessible
+ Returns a reference to an implementation dependent accessible object
+ representing the table's summary or a NULL pointer if the table
+ does not support a summary.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT summary
+ (
+ [out, retval] IUnknown **accessible
+ );
+
+ /** @brief Returns a boolean value indicating whether the specified column is
+ completely selected.
+ @param [in] column
+ 0 based index of the column for which to determine whether it is selected.
+ @param [out] isSelected
+ Returns TRUE if the specified column is selected completely and FALSE otherwise.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is FALSE
+ */
+ [propget] HRESULT isColumnSelected
+ (
+ [in] long column,
+ [out, retval] boolean *isSelected
+ );
+
+ /** @brief Returns a boolean value indicating whether the specified row is completely
+ selected.
+ @param [in] row
+ 0 based index of the row for which to determine whether it is selected.
+ @param [out] isSelected
+ Returns TRUE if the specified row is selected completely and FALSE otherwise.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is FALSE
+ */
+ [propget] HRESULT isRowSelected
+ (
+ [in] long row,
+ [out, retval] boolean *isSelected
+ );
+
+ /** @brief Returns a boolean value indicating whether the specified cell is selected.
+ @param [in] row
+ 0 based index of the row for the cell to determine whether it is selected.
+ @param [in] column
+ 0 based index of the column for the cell to determine whether it is selected.
+ @param [out] isSelected
+ Returns TRUE if the specified cell is selected and FALSE otherwise.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] value is FALSE
+ */
+ [propget] HRESULT isSelected
+ (
+ [in] long row,
+ [in] long column,
+ [out, retval] boolean *isSelected
+ );
+
+ /** @brief Selects a row and unselects all previously selected rows.
+ @param [in] row
+ 0 based index of the row to be selected.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT selectRow
+ (
+ [in] long row
+ );
+
+ /** @brief Selects a column and unselects all previously selected columns.
+ @param [in] column
+ 0 based index of the column to be selected.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT selectColumn
+ (
+ [in] long column
+ );
+
+ /** @brief Unselects one row, leaving other selected rows selected (if any).
+ @param [in] row
+ 0 based index of the row to be unselected.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT unselectRow
+ (
+ [in] long row
+ );
+
+ /** @brief Unselects one column, leaving other selected columns selected (if any).
+ @param [in] column
+ 0 based index of the column to be unselected.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ HRESULT unselectColumn
+ (
+ [in] long column
+ );
+
+ /** @brief Given a cell index, gets the row and column indexes and extents of a cell
+ and whether or not it is selected.
+
+ This is a convenience function. It is not mandatory to implement it.
+ @param [in] index
+ 0 based index of this cell in the table.
+ @param [out] row
+ 0 based row index.
+ @param [out] column
+ 0 based column index.
+ @param [out] rowExtents
+ Number of cells spanned by this cell in this row.
+ @param [out] columnExtents
+ Number of cells spanned by this cell in this column.
+ @param [out] isSelected
+ Indicates if the specified cell is selected.
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed, [out] values are 0s and FALSE respectively
+ */
+ [propget] HRESULT rowColumnExtentsAtIndex
+ (
+ [in] long index,
+ [out] long *row,
+ [out] long *column,
+ [out] long *rowExtents,
+ [out] long *columnExtents,
+ [out, retval] boolean *isSelected
+ );
+
+ /** @brief Returns the type and extents describing how a table changed.
+
+ Provided for use by the IA2_EVENT_TABLE_MODEL_CHANGED event handler.
+
+ This data is only guaranteed to be valid while the thread notifying the event
+ continues. Once the handler has returned, the validity of the data depends on
+ how the server manages the life cycle of its objects. Also, note that the server
+ may have different life cycle management strategies for controls depending on
+ whether or not a control manages its children. Lists, trees, and tables can have
+ a large number of children and thus it's possible that the child objects for those
+ controls would only be created as needed. Servers should document their life cycle
+ strategy as this will be of interest to assistive technology or script engines
+ accessing data out of process or from other threads. Servers only need to save the
+ most recent row and column values associated with the change and a scope of the
+ entire application is adequate.
+
+ @param [out] modelChange
+ A struct of (type(insert, delete, update), firstRow, lastRow, firstColumn, lastColumn).
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ */
+ [propget] HRESULT modelChange
+ (
+ [out, retval] IA2TableModelChange *modelChange
+ );
+
+}
+/*************************************************************************
+ *
+ * File Name (AccessibleTable2.idl)
+ *
+ * IAccessible2 IDL Specification
+ *
+ * Copyright (c) 2007, 2012 Linux Foundation
+ * Copyright (c) 2006 IBM Corporation
+ * Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+ * All rights reserved.
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * 3. Neither the name of the Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This BSD License conforms to the Open Source Initiative "Simplified
+ * BSD License" as published at:
+ * http://www.opensource.org/licenses/bsd-license.php
+ *
+ * IAccessible2 is a trademark of the Linux Foundation. The IAccessible2
+ * mark may be used in accordance with the Linux Foundation Trademark
+ * Policy to indicate compliance with the IAccessible2 specification.
+ *
+ ************************************************************************/
+
+
+
+
+
+
+
+/** @brief This interface gives access to a two-dimensional table.
+
+ Please also refer to the IAccessibleTableCell interface.
+
+ If you want to support older applications you should also support the
+ IAccessibleTable inteface.
+*/
+[object, uuid(6167f295-06f0-4cdd-a1fa-02e25153d869)]
+interface IAccessibleTable2 : IUnknown
+{
+
+ /** @brief Returns the accessible object at the specified row and column in
+ the table. This object could be an IAccessible or an IAccessible2.
+ @param [in] row
+ The 0 based row index for which to retrieve the cell.
+ @param [in] column
+ The 0 based column index for which to retrieve the cell.
+ @param [out] cell
+ If both row and column index are valid then the corresponding accessible
+ object is returned that represents the requested cell regardless of whether
+ the cell is currently visible (on the screen).
+ @retval S_OK
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT cellAt
+ (
+ [in] long row,
+ [in] long column,
+ [out, retval] IUnknown **cell
+ );
+
+ /** @brief Returns the caption for the table. The returned object could be
+ an IAccessible or an IAccessible2.
+ @param [out] accessible
+ If the table has a caption then a reference to it is returned, else a NULL
+ pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @deprecated use a describedBy relation
+ */
+ [propget] HRESULT caption
+ (
+ [out, retval] IUnknown **accessible
+ );
+
+ /** @brief Returns the description text of the specified column in the table.
+ @param [in] column
+ The 0 based index of the column for which to retrieve the description.
+ @param [out] description
+ Returns the description text of the specified column in the table if such a
+ description exists. Otherwise a NULL pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT columnDescription
+ (
+ [in] long column,
+ [out, retval] BSTR *description
+ );
+
+
+ /** @brief Returns the total number of columns in table
+ @param [out] columnCount
+ Number of columns in table (including columns outside the current viewport)
+ @retval S_OK
+ */
+ [propget] HRESULT nColumns
+ (
+ [out, retval] long *columnCount
+ );
+
+ /** @brief Returns the total number of rows in table
+ @param [out] rowCount
+ Number of rows in table (including rows outside the current viewport)
+ @retval S_OK
+ */
+ [propget] HRESULT nRows
+ (
+ [out, retval] long *rowCount
+ );
+
+ /** @brief Returns the total number of selected cells
+ @param [out] cellCount
+ Number of cells currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedCells
+ (
+ [out, retval] long *cellCount
+ );
+
+ /** @brief Returns the total number of selected columns
+ @param [out] columnCount
+ Number of columns currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedColumns
+ (
+ [out, retval] long *columnCount
+ );
+
+ /** @brief Returns the total number of selected rows
+ @param [out] rowCount
+ Number of rows currently selected
+ @retval S_OK
+ */
+ [propget] HRESULT nSelectedRows
+ (
+ [out, retval] long *rowCount
+ );
+
+ /** @brief Returns the description text of the specified row in the table.
+ @param [in] row
+ The 0 based index of the row for which to retrieve the description.
+ @param [out] description
+ Returns the description text of the specified row in the table if such a
+ description exists. Otherwise a NULL pointer is returned.
+ @retval S_OK
+ @retval S_FALSE if there is nothing to return, [out] value is NULL
+ @retval E_INVALIDARG if bad [in] passed
+ */
+ [propget] HRESULT rowDescription
+ (
+ [in] long row,
+ [out, retval] BSTR *description
+ );
+
+ /** @brief Returns a list of accessibles currently selected.
+ @param [out] cells
+ Pointer to an array of references to selected accessibles. The array is
+ allocated by the server with CoTaskMemAlloc and freed by the client with
+ CoTaskMemFree.
+ @param [out] nSelectedCells
+ The number of accessibles returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedCells
+ (
+ [out, size_is(,*nSelectedCells)] IUnknown ***cells,
+ [out, retval] long *nSelectedCells
+ );
+
+ /** @brief Returns a list of column indexes currently selected (0 based).
+ @param [out] selectedColumns
+ A pointer to an array of column indexes of selected columns (each index is
+ 0 based). The array is allocated by the server with CoTaskMemAlloc and
+ freed by the client with CoTaskMemFree.
+ @param [out] nColumns
+ The number of column indexes returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedColumns
+ (
+ [out, size_is(,*nColumns)] long **selectedColumns,
+ [out, retval] long *nColumns
+ );
+
+ /** @brief Returns a list of row indexes currently selected (0 based).
+ @param [out] selectedRows
+ An array of row indexes of selected rows (each index is 0 based). The array
+ is allocated by the server with CoTaskMemAlloc and freed by the client with
+ CoTaskMemFree.
+ @param [out] nRows
+ The number of row indexes returned; the size of the returned array.
+ @retval S_OK
+ @retval S_FALSE if there are none, [out] values are NULL and 0 respectively
+ */
+ [propget] HRESULT selectedRows
+ (
+ [out, size_is(,*nRows)] long **selectedRows,
+ [out, retval] long *nRows
+ );
+
+ /** @bri