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