1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _ACCTEXTFRAME_HXX 24 #define _ACCTEXTFRAME_HXX 25 #include "accframebase.hxx" 26 27 //IAccessibility2 Implementation 2009----- 28 #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 29 //-----IAccessibility2 Implementation 2009 30 31 class SwFlyFrm; 32 namespace utl { class AccessibleRelationSetHelper; } 33 namespace com { namespace star { 34 namespace accessibility { struct AccessibleRelation; } 35 } } 36 37 class SwAccessibleTextFrame : public SwAccessibleFrameBase, 38 public ::com::sun::star::accessibility::XAccessibleSelection 39 { 40 private: 41 // --> OD 2009-07-14 #i73249# 42 ::rtl::OUString msTitle; 43 ::rtl::OUString msDesc; 44 // <-- 45 46 protected: 47 48 virtual ~SwAccessibleTextFrame(); 49 50 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 51 52 public: 53 54 SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm ); 55 56 //IAccessibility2 Implementation 2009----- 57 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 58 ::com::sun::star::uno::Type const & rType ) 59 throw (::com::sun::star::uno::RuntimeException); 60 virtual void SAL_CALL acquire() throw (); 61 virtual void SAL_CALL release() throw (); 62 //===== XAccessibleSelection ============================================ 63 virtual void SAL_CALL selectAccessibleChild( 64 sal_Int32 nChildIndex ) 65 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 66 ::com::sun::star::uno::RuntimeException ); 67 68 virtual sal_Bool SAL_CALL isAccessibleChildSelected( 69 sal_Int32 nChildIndex ) 70 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 71 ::com::sun::star::uno::RuntimeException ); 72 73 virtual void SAL_CALL clearAccessibleSelection( ) 74 throw ( ::com::sun::star::uno::RuntimeException ); 75 76 virtual void SAL_CALL selectAllAccessibleChildren( ) 77 throw ( ::com::sun::star::uno::RuntimeException ); 78 79 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) 80 throw ( ::com::sun::star::uno::RuntimeException ); 81 82 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( 83 sal_Int32 nSelectedChildIndex ) 84 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 85 ::com::sun::star::uno::RuntimeException); 86 87 virtual void SAL_CALL deselectAccessibleChild( 88 sal_Int32 nSelectedChildIndex ) 89 throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 90 ::com::sun::star::uno::RuntimeException ); 91 //-----IAccessibility2 Implementation 2009 92 93 //===== XAccessibleContext ============================================== 94 95 // --> OD 2009-07-14 #i73249# 96 /// Return the object's current name. 97 virtual ::rtl::OUString SAL_CALL 98 getAccessibleName (void) 99 throw (::com::sun::star::uno::RuntimeException); 100 // <-- 101 /// Return this object's description. 102 virtual ::rtl::OUString SAL_CALL 103 getAccessibleDescription (void) 104 throw (com::sun::star::uno::RuntimeException); 105 106 //===== XServiceInfo ==================================================== 107 108 /** Returns an identifier for the implementation of this object. 109 */ 110 virtual ::rtl::OUString SAL_CALL 111 getImplementationName (void) 112 throw (::com::sun::star::uno::RuntimeException); 113 114 /** Return whether the specified service is supported by this class. 115 */ 116 virtual sal_Bool SAL_CALL 117 supportsService (const ::rtl::OUString& sServiceName) 118 throw (::com::sun::star::uno::RuntimeException); 119 120 /** Returns a list of all supported services. In this case that is just 121 the AccessibleContext service. 122 */ 123 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL 124 getSupportedServiceNames (void) 125 throw (::com::sun::star::uno::RuntimeException); 126 127 //====== XTypeProvider ==================================================== 128 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); 129 130 131 //===== XAccessibleContext::getAccessibleRelationSet ==================== 132 133 // text frame may have accessible relations to their 134 // predocesor/successor frames 135 136 private: 137 // helper methods for getAccessibleRelationSet: 138 SwFlyFrm* getFlyFrm() const; 139 140 com::sun::star::accessibility::AccessibleRelation makeRelation( 141 sal_Int16 nType, const SwFlyFrm* pFrm ); 142 143 public: 144 145 virtual ::com::sun::star::uno::Reference< 146 ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL 147 getAccessibleRelationSet (void) 148 throw (::com::sun::star::uno::RuntimeException); 149 }; 150 151 152 #endif 153