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 _ACCNOTEXTFRAME_HXX 24cdf0e10cSrcweir #define _ACCNOTEXTFRAME_HXX 25cdf0e10cSrcweir #include "accframebase.hxx" 26cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleImage.hpp> 27*ca62e2c2SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERTEXT_HPP_ 28*ca62e2c2SSteve Yin #include <com/sun/star/accessibility/XAccessibleHypertext.hpp> 29*ca62e2c2SSteve Yin #endif 30*ca62e2c2SSteve Yin 31*ca62e2c2SSteve Yin namespace utl { class AccessibleRelationSetHelper; } 32*ca62e2c2SSteve Yin namespace com { namespace star { 33*ca62e2c2SSteve Yin namespace accessibility { struct AccessibleRelation; } 34*ca62e2c2SSteve Yin } } 35cdf0e10cSrcweir 36cdf0e10cSrcweir class SwFlyFrm; 37cdf0e10cSrcweir class SwNoTxtNode; 38*ca62e2c2SSteve Yin class SwAccessibleNoTextHyperlink; 39cdf0e10cSrcweir 40cdf0e10cSrcweir class SwAccessibleNoTextFrame : public SwAccessibleFrameBase, 41*ca62e2c2SSteve Yin public ::com::sun::star::accessibility::XAccessibleImage, 42*ca62e2c2SSteve Yin public ::com::sun::star::accessibility::XAccessibleHypertext//Added by yangzhh for HyperLink 43cdf0e10cSrcweir { 44*ca62e2c2SSteve Yin friend class SwAccessibleNoTextHyperlink; 45*ca62e2c2SSteve Yin //HyperLinksMap alinksMap; 46*ca62e2c2SSteve Yin com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > alink; 47cdf0e10cSrcweir SwDepend aDepend; 48cdf0e10cSrcweir // --> OD 2009-07-14 #i73249# 49cdf0e10cSrcweir ::rtl::OUString msTitle; 50cdf0e10cSrcweir // <-- 51cdf0e10cSrcweir ::rtl::OUString msDesc; 52cdf0e10cSrcweir 53cdf0e10cSrcweir protected: 54cdf0e10cSrcweir 55cdf0e10cSrcweir virtual ~SwAccessibleNoTextFrame(); 56cdf0e10cSrcweir 57cdf0e10cSrcweir const SwNoTxtNode *GetNoTxtNode() const; 58cdf0e10cSrcweir 59cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 60cdf0e10cSrcweir 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir 63cdf0e10cSrcweir SwAccessibleNoTextFrame( SwAccessibleMap* pInitMap, 64cdf0e10cSrcweir sal_Int16 nInitRole, 65cdf0e10cSrcweir const SwFlyFrm *pFlyFrm ); 66cdf0e10cSrcweir 67cdf0e10cSrcweir //===== XAccessibleContext ============================================== 68cdf0e10cSrcweir 69cdf0e10cSrcweir // --> OD 2009-07-14 #i73249# 70cdf0e10cSrcweir /// Return the object's current name. 71cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 72cdf0e10cSrcweir getAccessibleName (void) 73cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir // <-- 75cdf0e10cSrcweir 76cdf0e10cSrcweir /// Return this object's description. 77cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 78cdf0e10cSrcweir getAccessibleDescription (void) 79cdf0e10cSrcweir throw (com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir 81cdf0e10cSrcweir //===== XInterface ====================================================== 82cdf0e10cSrcweir 83cdf0e10cSrcweir // XInterface methods need to be implemented to disambiguate 84cdf0e10cSrcweir // between those inherited through SwAcessibleContext and 85cdf0e10cSrcweir // XAccessibleImage. 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 88cdf0e10cSrcweir const ::com::sun::star::uno::Type& aType ) 89cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir acquire()91cdf0e10cSrcweir virtual void SAL_CALL acquire( ) throw () 92cdf0e10cSrcweir { SwAccessibleContext::acquire(); }; 93cdf0e10cSrcweir release()94cdf0e10cSrcweir virtual void SAL_CALL release( ) throw () 95cdf0e10cSrcweir { SwAccessibleContext::release(); }; 96cdf0e10cSrcweir 97cdf0e10cSrcweir //====== XTypeProvider ==================================================== 98cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir 100cdf0e10cSrcweir //===== XAccessibleImage ================================================ 101cdf0e10cSrcweir 102cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL 103cdf0e10cSrcweir getAccessibleImageDescription( ) 104cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir virtual sal_Int32 SAL_CALL 107cdf0e10cSrcweir getAccessibleImageHeight( ) 108cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 109cdf0e10cSrcweir 110cdf0e10cSrcweir virtual sal_Int32 SAL_CALL 111cdf0e10cSrcweir getAccessibleImageWidth( ) 112cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ); 113cdf0e10cSrcweir 114cdf0e10cSrcweir // The object is not visible an longer and should be destroyed 115cdf0e10cSrcweir virtual void Dispose( sal_Bool bRecursive = sal_False ); 116*ca62e2c2SSteve Yin 117*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException); 118*ca62e2c2SSteve Yin virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 119*ca62e2c2SSteve Yin virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);//Shen Zhen Jie changed sal_Unicode to sal_uInt32 120*ca62e2c2SSteve Yin virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 121*ca62e2c2SSteve Yin virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 122*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException); 123*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 124*ca62e2c2SSteve Yin virtual ::rtl::OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException); 125*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException); 126*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException); 127*ca62e2c2SSteve Yin virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 128*ca62e2c2SSteve Yin virtual ::rtl::OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException); 129*ca62e2c2SSteve Yin virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 130*ca62e2c2SSteve Yin virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 131*ca62e2c2SSteve Yin virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 132*ca62e2c2SSteve Yin virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 133*ca62e2c2SSteve Yin virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 134*ca62e2c2SSteve Yin 135*ca62e2c2SSteve Yin 136*ca62e2c2SSteve Yin //===== XAccessibleHypertext ============================================ 137*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getHyperLinkCount() 138*ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 139*ca62e2c2SSteve Yin virtual ::com::sun::star::uno::Reference< 140*ca62e2c2SSteve Yin ::com::sun::star::accessibility::XAccessibleHyperlink > 141*ca62e2c2SSteve Yin SAL_CALL getHyperLink( sal_Int32 nLinkIndex ) 142*ca62e2c2SSteve Yin throw (::com::sun::star::lang::IndexOutOfBoundsException, 143*ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException); 144*ca62e2c2SSteve Yin virtual sal_Int32 SAL_CALL getHyperLinkIndex( sal_Int32 nCharIndex ) 145*ca62e2c2SSteve Yin throw (::com::sun::star::lang::IndexOutOfBoundsException, 146*ca62e2c2SSteve Yin ::com::sun::star::uno::RuntimeException); 147*ca62e2c2SSteve Yin GetAccessibleMap()148*ca62e2c2SSteve Yin SwAccessibleMap *GetAccessibleMap(){ return GetMap();} 149*ca62e2c2SSteve Yin 150*ca62e2c2SSteve Yin private: 151*ca62e2c2SSteve Yin com::sun::star::accessibility::AccessibleRelation makeRelation( 152*ca62e2c2SSteve Yin sal_Int16 nType, const SwFlyFrm* pFrm ); 153*ca62e2c2SSteve Yin 154*ca62e2c2SSteve Yin public: 155*ca62e2c2SSteve Yin virtual ::com::sun::star::uno::Reference< 156*ca62e2c2SSteve Yin ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL 157*ca62e2c2SSteve Yin getAccessibleRelationSet (void) 158*ca62e2c2SSteve Yin throw (::com::sun::star::uno::RuntimeException); 159cdf0e10cSrcweir }; 160cdf0e10cSrcweir 161cdf0e10cSrcweir 162cdf0e10cSrcweir #endif 163