11d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 51d2dbeb0SAndrew Rist * distributed with this work for additional information 61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 101d2dbeb0SAndrew Rist * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 121d2dbeb0SAndrew Rist * 131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 171d2dbeb0SAndrew Rist * specific language governing permissions and limitations 181d2dbeb0SAndrew Rist * under the License. 191d2dbeb0SAndrew Rist * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef _ACCDOC_HXX 24cdf0e10cSrcweir #define _ACCDOC_HXX 25cdf0e10cSrcweir #ifndef _ACCCONTEXT_HXX 26cdf0e10cSrcweir #include "acccontext.hxx" 27cdf0e10cSrcweir #endif 28cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 29*ca62e2c2SSteve Yin #include <com/sun/star/document/XEventListener.hpp> 30cdf0e10cSrcweir #include <accselectionhelper.hxx> 31cdf0e10cSrcweir 32*ca62e2c2SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_ 33*ca62e2c2SSteve Yin #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> 34*ca62e2c2SSteve Yin #endif 35*ca62e2c2SSteve Yin 36*ca62e2c2SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEGETACCFLOWTO_HPP_ 37*ca62e2c2SSteve Yin #include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp> 38*ca62e2c2SSteve Yin #endif 39*ca62e2c2SSteve Yin 40cdf0e10cSrcweir class VclSimpleEvent; 41cdf0e10cSrcweir 42cdf0e10cSrcweir /** 43cdf0e10cSrcweir * base class for SwAccessibleDocument (in this same header file) and 44cdf0e10cSrcweir * SwAccessiblePreview 45cdf0e10cSrcweir */ 46cdf0e10cSrcweir class SwAccessibleDocumentBase : public SwAccessibleContext 47cdf0e10cSrcweir { 48cdf0e10cSrcweir ::com::sun::star::uno::Reference< 49cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible> mxParent; 50cdf0e10cSrcweir 51cdf0e10cSrcweir Window* mpChildWin; // protected by solar mutext 52cdf0e10cSrcweir 53cdf0e10cSrcweir using SwAccessibleFrame::SetVisArea; 54cdf0e10cSrcweir 55cdf0e10cSrcweir protected: 56cdf0e10cSrcweir 57cdf0e10cSrcweir virtual ~SwAccessibleDocumentBase(); 58cdf0e10cSrcweir 59cdf0e10cSrcweir public: 60cdf0e10cSrcweir 61cdf0e10cSrcweir SwAccessibleDocumentBase( SwAccessibleMap* pInitMap ); 62cdf0e10cSrcweir 63cdf0e10cSrcweir void SetVisArea(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir virtual void AddChild( Window *pWin, sal_Bool bFireEvent = sal_True ); 66cdf0e10cSrcweir virtual void RemoveChild( Window *pWin ); 67cdf0e10cSrcweir 68cdf0e10cSrcweir //===== XAccessibleContext ============================================== 69cdf0e10cSrcweir 70cdf0e10cSrcweir /// Return the number of currently visible children. 71cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getAccessibleChildCount (void) 72cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 73cdf0e10cSrcweir 74cdf0e10cSrcweir /// Return the specified child or NULL if index is invalid. 75cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL 76cdf0e10cSrcweir getAccessibleChild (sal_Int32 nIndex) 77cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException, 78cdf0e10cSrcweir ::com::sun::star::lang::IndexOutOfBoundsException); 79cdf0e10cSrcweir 80cdf0e10cSrcweir /// Return a reference to the parent. 81cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL 82cdf0e10cSrcweir getAccessibleParent (void) 83cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir 85cdf0e10cSrcweir /// Return this objects index among the parents children. 86cdf0e10cSrcweir virtual sal_Int32 SAL_CALL 87cdf0e10cSrcweir getAccessibleIndexInParent (void) 88cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 89cdf0e10cSrcweir 90cdf0e10cSrcweir /// Return this object's description. 91cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 92cdf0e10cSrcweir getAccessibleDescription (void) throw (com::sun::star::uno::RuntimeException); 93*ca62e2c2SSteve Yin virtual ::rtl::OUString SAL_CALL getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir 95cdf0e10cSrcweir //===== XAccessibleComponent ============================================== 96cdf0e10cSrcweir virtual sal_Bool SAL_CALL containsPoint( 97cdf0e10cSrcweir const ::com::sun::star::awt::Point& aPoint ) 98cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir 100cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 101cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( 102cdf0e10cSrcweir const ::com::sun::star::awt::Point& aPoint ) 103cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 104cdf0e10cSrcweir 105cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() 106cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 107cdf0e10cSrcweir 108cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocation() 109cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 110cdf0e10cSrcweir 111cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() 112cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir 114cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getSize() 115cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 116cdf0e10cSrcweir }; 117cdf0e10cSrcweir 118cdf0e10cSrcweir 119cdf0e10cSrcweir 120cdf0e10cSrcweir /** 121cdf0e10cSrcweir * access to an accessible Writer document 122cdf0e10cSrcweir */ 123cdf0e10cSrcweir class SwAccessibleDocument : public SwAccessibleDocumentBase, 124*ca62e2c2SSteve Yin public com::sun::star::accessibility::XAccessibleSelection, 125*ca62e2c2SSteve Yin public com::sun::star::document::XEventListener, 126*ca62e2c2SSteve Yin public com::sun::star::accessibility::XAccessibleExtendedAttributes, 127*ca62e2c2SSteve Yin public com::sun::star::accessibility::XAccessibleGetAccFlowTo 128cdf0e10cSrcweir { 129cdf0e10cSrcweir // Implementation for XAccessibleSelection interface 130cdf0e10cSrcweir SwAccessibleSelectionHelper maSelectionHelper; 131cdf0e10cSrcweir 132cdf0e10cSrcweir protected: 133cdf0e10cSrcweir 134cdf0e10cSrcweir // Set states for getAccessibleStateSet. 135cdf0e10cSrcweir // This drived class additinaly sets MULTISELECTABLE(1) 136cdf0e10cSrcweir virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ); 137cdf0e10cSrcweir 138cdf0e10cSrcweir virtual ~SwAccessibleDocument(); 139cdf0e10cSrcweir 140cdf0e10cSrcweir public: 141cdf0e10cSrcweir 142cdf0e10cSrcweir SwAccessibleDocument( SwAccessibleMap* pInitMap ); 143cdf0e10cSrcweir 144cdf0e10cSrcweir DECL_LINK( WindowChildEventListener, VclSimpleEvent* ); 145*ca62e2c2SSteve Yin //===== XEventListener==================================================== 146*ca62e2c2SSteve Yin virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) 147*ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 148*ca62e2c2SSteve Yin virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Event ) 149*ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 150cdf0e10cSrcweir 151cdf0e10cSrcweir //===== XServiceInfo ==================================================== 152cdf0e10cSrcweir 153cdf0e10cSrcweir /** Returns an identifier for the implementation of this object. 154cdf0e10cSrcweir */ 155cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 156cdf0e10cSrcweir getImplementationName (void) 157cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 158cdf0e10cSrcweir 159cdf0e10cSrcweir /** Return whether the specified service is supported by this class. 160cdf0e10cSrcweir */ 161cdf0e10cSrcweir virtual sal_Bool SAL_CALL 162cdf0e10cSrcweir supportsService (const ::rtl::OUString& sServiceName) 163cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 164cdf0e10cSrcweir 165cdf0e10cSrcweir /** Returns a list of all supported services. In this case that is just 166cdf0e10cSrcweir the AccessibleContext service. 167cdf0e10cSrcweir */ 168cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 169cdf0e10cSrcweir getSupportedServiceNames (void) 170cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 171cdf0e10cSrcweir 172cdf0e10cSrcweir //===== XInterface ====================================================== 173cdf0e10cSrcweir 174cdf0e10cSrcweir // XInterface is inherited through SwAcessibleContext and 175cdf0e10cSrcweir // XAccessibleSelection. These methods are needed to avoid 176cdf0e10cSrcweir // ambigiouties. 177cdf0e10cSrcweir 178cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 179cdf0e10cSrcweir const ::com::sun::star::uno::Type& aType ) 180cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 181cdf0e10cSrcweir acquire()182cdf0e10cSrcweir virtual void SAL_CALL acquire( ) throw () 183cdf0e10cSrcweir { SwAccessibleContext::acquire(); }; 184cdf0e10cSrcweir release()185cdf0e10cSrcweir virtual void SAL_CALL release( ) throw () 186cdf0e10cSrcweir { SwAccessibleContext::release(); }; 187cdf0e10cSrcweir 188cdf0e10cSrcweir //====== XTypeProvider ==================================================== 189cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 190cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 191cdf0e10cSrcweir 192cdf0e10cSrcweir //===== XAccessibleSelection ============================================ 193cdf0e10cSrcweir 194cdf0e10cSrcweir virtual void SAL_CALL selectAccessibleChild( 195cdf0e10cSrcweir sal_Int32 nChildIndex ) 196cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 197cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 198cdf0e10cSrcweir 199cdf0e10cSrcweir virtual sal_Bool SAL_CALL isAccessibleChildSelected( 200cdf0e10cSrcweir sal_Int32 nChildIndex ) 201cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 202cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 203cdf0e10cSrcweir virtual void SAL_CALL clearAccessibleSelection( ) 204cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 205cdf0e10cSrcweir virtual void SAL_CALL selectAllAccessibleChildren( ) 206cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 207cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) 208cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 209cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( 210cdf0e10cSrcweir sal_Int32 nSelectedChildIndex ) 211cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 212cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 213cdf0e10cSrcweir 214cdf0e10cSrcweir // --> OD 2004-11-16 #111714# - index has to be treated as global child index. 215cdf0e10cSrcweir virtual void SAL_CALL deselectAccessibleChild( 216cdf0e10cSrcweir sal_Int32 nChildIndex ) 217cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 218cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ); 219cdf0e10cSrcweir 220*ca62e2c2SSteve Yin virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() 221*ca62e2c2SSteve Yin throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; 222cdf0e10cSrcweir //====== thread safe C++ interface ======================================== 223cdf0e10cSrcweir 224cdf0e10cSrcweir // The object is not visible an longer and should be destroyed 225cdf0e10cSrcweir virtual void Dispose( sal_Bool bRecursive = sal_False ); 226*ca62e2c2SSteve Yin 227*ca62e2c2SSteve Yin //===== XAccessibleComponent ============================================ 228*ca62e2c2SSteve Yin sal_Int32 SAL_CALL getBackground() 229*ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 230*ca62e2c2SSteve Yin 231*ca62e2c2SSteve Yin //===== XAccessibleGetAccFlowTo ============================================ 232*ca62e2c2SSteve Yin ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > 233*ca62e2c2SSteve Yin SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType) 234*ca62e2c2SSteve Yin throw ( ::com::sun::star::uno::RuntimeException ); 235cdf0e10cSrcweir }; 236cdf0e10cSrcweir 237cdf0e10cSrcweir #endif 238cdf0e10cSrcweir 239