1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 29 #ifndef _SC_ACCESSIBLEPAGEHEADER_HXX 30 #define _SC_ACCESSIBLEPAGEHEADER_HXX 31 32 #include "AccessibleContextBase.hxx" 33 #include <editeng/svxenum.hxx> 34 35 class ScPreviewShell; 36 class EditTextObject; 37 class ScAccessiblePageHeaderArea; 38 class ScPreviewShell; 39 40 class ScAccessiblePageHeader : public ScAccessibleContextBase 41 { 42 public: 43 ScAccessiblePageHeader( const ::com::sun::star::uno::Reference< 44 ::com::sun::star::accessibility::XAccessible>& rxParent, 45 ScPreviewShell* pViewShell, sal_Bool bHeader, sal_Int32 nIndex ); 46 47 protected: 48 virtual ~ScAccessiblePageHeader(); 49 50 using ScAccessibleContextBase::IsDefunc; 51 52 public: 53 using ScAccessibleContextBase::disposing; 54 virtual void SAL_CALL disposing(); 55 56 //===== SfxListener ===================================================== 57 58 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 59 60 //===== XAccessibleComponent ============================================ 61 62 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL 63 getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) 64 throw (::com::sun::star::uno::RuntimeException); 65 virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException); 66 67 //===== XAccessibleContext ============================================== 68 69 virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); 70 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL 71 getAccessibleChild( sal_Int32 i ) 72 throw (::com::sun::star::lang::IndexOutOfBoundsException, 73 ::com::sun::star::uno::RuntimeException); 74 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException); 75 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL 76 getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); 77 78 //===== XServiceInfo ==================================================== 79 80 virtual ::rtl::OUString SAL_CALL getImplementationName() 81 throw(::com::sun::star::uno::RuntimeException); 82 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 83 throw(::com::sun::star::uno::RuntimeException); 84 85 //===== internal ======================================================== 86 void SetCurrentIndexInParent(sal_Int32 nNew) { mnIndex = nNew; } 87 88 protected: 89 virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException); 90 virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException); 91 92 virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException); 93 virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); 94 95 private: 96 ScPreviewShell* mpViewShell; 97 sal_Int32 mnIndex; 98 sal_Bool mbHeader; 99 typedef std::vector< ScAccessiblePageHeaderArea* > ScHFAreas; 100 ScHFAreas maAreas; 101 sal_Int32 mnChildCount; 102 103 sal_Bool IsDefunc( 104 const com::sun::star::uno::Reference< 105 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); 106 107 void AddChild(const EditTextObject* pArea, sal_uInt32 nIndex, SvxAdjust eAdjust); 108 }; 109 110 111 #endif 112