Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCNOTEXTFRAME_HXX
21 : #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCNOTEXTFRAME_HXX
22 :
23 : #include "accframebase.hxx"
24 : #include <com/sun/star/accessibility/XAccessibleImage.hpp>
25 : #include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
26 :
27 : namespace utl { class AccessibleRelationSetHelper; }
28 : namespace com { namespace star {
29 : namespace accessibility { struct AccessibleRelation; }
30 : } }
31 :
32 : class SwFlyFrm;
33 : class SwNoTxtNode;
34 : class SwAccessibleNoTextHyperlink;
35 :
36 : class SwAccessibleNoTextFrame : public SwAccessibleFrameBase,
37 : public ::com::sun::star::accessibility::XAccessibleImage,
38 : public ::com::sun::star::accessibility::XAccessibleHypertext//Added by yangzhh for HyperLink
39 : {
40 : friend class SwAccessibleNoTextHyperlink;
41 : //HyperLinksMap alinksMap;
42 : com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > alink;
43 : SwDepend aDepend;
44 : OUString msTitle; // #i73249#
45 : OUString msDesc;
46 :
47 : protected:
48 : virtual ~SwAccessibleNoTextFrame();
49 :
50 : const SwNoTxtNode *GetNoTxtNode() const;
51 :
52 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
53 :
54 : public:
55 : SwAccessibleNoTextFrame( SwAccessibleMap* pInitMap,
56 : sal_Int16 nInitRole,
57 : const SwFlyFrm *pFlyFrm );
58 :
59 : // XAccessibleContext
60 :
61 : // #i73249# - Return the object's current name.
62 : virtual OUString SAL_CALL
63 : getAccessibleName (void)
64 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
65 :
66 : /// Return this object's description.
67 : virtual OUString SAL_CALL
68 : getAccessibleDescription (void)
69 : throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 :
71 : // XInterface methods need to be implemented to disambiguate
72 : // between those inherited through SwAcessibleContext and
73 : // XAccessibleImage.
74 :
75 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
76 : const ::com::sun::star::uno::Type& aType )
77 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 :
79 0 : virtual void SAL_CALL acquire( ) throw () SAL_OVERRIDE
80 0 : { SwAccessibleContext::acquire(); };
81 :
82 0 : virtual void SAL_CALL release( ) throw () SAL_OVERRIDE
83 0 : { SwAccessibleContext::release(); };
84 :
85 : // XTypeProvider
86 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 :
88 : // XAccessibleImage
89 : virtual OUString SAL_CALL
90 : getAccessibleImageDescription( )
91 : throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
92 :
93 : virtual sal_Int32 SAL_CALL
94 : getAccessibleImageHeight( )
95 : throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
96 :
97 : virtual sal_Int32 SAL_CALL
98 : getAccessibleImageWidth( )
99 : throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
100 :
101 : // The object is not visible an longer and should be destroyed
102 : virtual void Dispose( sal_Bool bRecursive = sal_False ) SAL_OVERRIDE;
103 :
104 : virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 : virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 : virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;//Shen Zhen Jie changed sal_Unicode to sal_uInt32
107 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 : virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 : virtual OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 : virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 : virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 : virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
115 : virtual OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
117 : 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, std::exception) SAL_OVERRIDE;
118 : 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, std::exception) SAL_OVERRIDE;
119 : 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, std::exception) SAL_OVERRIDE;
120 : virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 :
122 : //===== XAccessibleHypertext ============================================
123 : virtual sal_Int32 SAL_CALL getHyperLinkCount()
124 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : virtual ::com::sun::star::uno::Reference<
126 : ::com::sun::star::accessibility::XAccessibleHyperlink >
127 : SAL_CALL getHyperLink( sal_Int32 nLinkIndex )
128 : throw (::com::sun::star::lang::IndexOutOfBoundsException,
129 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
130 : virtual sal_Int32 SAL_CALL getHyperLinkIndex( sal_Int32 nCharIndex )
131 : throw (::com::sun::star::lang::IndexOutOfBoundsException,
132 : ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 :
134 0 : SwAccessibleMap *GetAccessibleMap(){ return GetMap();}
135 :
136 : public:
137 : virtual ::com::sun::star::uno::Reference<
138 : ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
139 : getAccessibleRelationSet (void)
140 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
141 : };
142 :
143 : #endif
144 :
145 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|