You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by st...@apache.org on 2012/12/12 05:41:33 UTC
svn commit: r1420522 [3/12] - in
/openoffice/branches/ia2/main/winaccessibility: ./ inc/ prj/ source/
source/UAccCOM/ source/UAccCOMIDL/ source/service/
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.cpp Wed Dec 12 04:41:12 2012
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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;
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.h
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.h?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.h (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.h Wed Dec 12 04:41:12 2012
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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_)
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHyperLink.rgs Wed Dec 12 04:41:12 2012
@@ -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'
+ }
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.cpp
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.cpp?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.cpp (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.cpp Wed Dec 12 04:41:12 2012
@@ -0,0 +1,412 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "stdafx.h"
+#include "UAccCOM2.h"
+#include "AccHypertext.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 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;
+ HRESULT hr = CoCreateInstance( CLSID_AccHyperLink, NULL, CLSCTX_SERVER ,
+ IID_IAccessibleHyperlink,
+ (void **)&plink);
+ 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
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.h
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.h?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.h (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.h Wed Dec 12 04:41:12 2012
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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_)
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccHypertext.rgs Wed Dec 12 04:41:12 2012
@@ -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'
+ }
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.cpp
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.cpp?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.cpp (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.cpp Wed Dec 12 04:41:12 2012
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.h
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.h?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.h (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.h Wed Dec 12 04:41:12 2012
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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_)
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccImage.rgs Wed Dec 12 04:41:12 2012
@@ -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'
+ }
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccKeyBinding.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccKeyBinding.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccKeyBinding.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccKeyBinding.rgs Wed Dec 12 04:41:12 2012
@@ -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'
+ }
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.cpp
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.cpp?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.cpp (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.cpp Wed Dec 12 04:41:12 2012
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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("");
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.h
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.h?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.h (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.h Wed Dec 12 04:41:12 2012
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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_
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccRelation.rgs Wed Dec 12 04:41:12 2012
@@ -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}'
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccSelection.rgs
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccSelection.rgs?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccSelection.rgs (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccSelection.rgs Wed Dec 12 04:41:12 2012
@@ -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'
+ }
+ }
+ }
+}
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccTable.cpp
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccTable.cpp?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccTable.cpp (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOM/AccTable.cpp Wed Dec 12 04:41:12 2012
@@ -0,0 +1,1070 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 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"
+
+#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;
+ HRESULT hr = CoCreateInstance( CLSID_MAccessible, NULL, CLSCTX_ALL ,
+ IID_IMAccessible,
+ (void **)&m_pIMacc
+ );
+ ((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;
+ HRESULT hr = CoCreateInstance( CLSID_MAccessible, NULL, CLSCTX_ALL ,
+ IID_IMAccessible,
+ (void **)&m_pIMacc
+ );
+ ((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
+
+}