xref: /aoo42x/main/svx/inc/svx/AccessibleShape.hxx (revision 4d7c9de0)
13334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53334a7e6SAndrew Rist  * distributed with this work for additional information
63334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
83334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
93334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
103334a7e6SAndrew Rist  *
113334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
123334a7e6SAndrew Rist  *
133334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
143334a7e6SAndrew Rist  * software distributed under the License is distributed on an
153334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
173334a7e6SAndrew Rist  * specific language governing permissions and limitations
183334a7e6SAndrew Rist  * under the License.
193334a7e6SAndrew Rist  *
203334a7e6SAndrew Rist  *************************************************************/
213334a7e6SAndrew Rist 
223334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_HXX
26cdf0e10cSrcweir #define _SVX_ACCESSIBILITY_ACCESSIBLE_SHAPE_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <editeng/AccessibleContextBase.hxx>
29cdf0e10cSrcweir #include <editeng/AccessibleComponentBase.hxx>
30cdf0e10cSrcweir #include <svx/IAccessibleViewForwarderListener.hxx>
31cdf0e10cSrcweir #include <com/sun/star/document/XEventListener.hpp>
32cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
33cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
34cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
35cdf0e10cSrcweir #include <com/sun/star/drawing/XShape.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
38cdf0e10cSrcweir #include <svx/AccessibleTextHelper.hxx>
39cdf0e10cSrcweir #include "svx/svxdllapi.h"
40*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESELECTION_HPP_
41*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
42*9b8096d0SSteve Yin #endif
43*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLETEXT_HPP_
44*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleText.hpp>
45*9b8096d0SSteve Yin #endif
46*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
47*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
48*9b8096d0SSteve Yin #endif
49*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEGROUPPOSITION_HPP_
50*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
51*9b8096d0SSteve Yin #endif
52*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERTEXT_HPP_
53*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
54*9b8096d0SSteve Yin #endif
55*9b8096d0SSteve Yin #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERTEXT_HPP_
56*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
57*9b8096d0SSteve Yin #endif
58*9b8096d0SSteve Yin #ifndef INCLUDED_COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEHYPERLINK_HPP
59*9b8096d0SSteve Yin #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
60*9b8096d0SSteve Yin #endif
61*9b8096d0SSteve Yin 
62cdf0e10cSrcweir #include "ChildrenManager.hxx"
63cdf0e10cSrcweir 
64cdf0e10cSrcweir class SdrObject;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir namespace accessibility {
67cdf0e10cSrcweir 
68cdf0e10cSrcweir class AccessibleShapeInfo;
69cdf0e10cSrcweir class AccessibleShapeTreeInfo;
70cdf0e10cSrcweir class IAccessibleParent;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir /**	This base class provides a base implementation for all shapes.  For more
73cdf0e10cSrcweir     detailed documentation about the methods refer to the descriptions of
74cdf0e10cSrcweir     the implemented interfaces.  These are, among others,
75cdf0e10cSrcweir     <type>XAccessible</type>, <type>XAccessibleContext</type>,
76cdf0e10cSrcweir     <type>XAccessibleComponent</type> and
77cdf0e10cSrcweir     <type>XAccessibleExtendedComponent</type>.
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     <p>The children of a shape can stem from two sources which, in case of
80cdf0e10cSrcweir     SVX and SD shapes, are mutually exclusive.  This implementation,
81cdf0e10cSrcweir     however, handles both simultaniously to cope with future extensions or
82cdf0e10cSrcweir     shapes from other projects.
83cdf0e10cSrcweir     <ul>
84cdf0e10cSrcweir         <li>If this shape is a group shape, i.e. a
85cdf0e10cSrcweir         <type>SvxShapeGroup</type> or a <type>Svx3DSceneObject</type>, it
86cdf0e10cSrcweir         can have nested shapes.</li>
87cdf0e10cSrcweir         <li>If this shape is a descendant from <type>SvxShapeText</type>
88cdf0e10cSrcweir         then the text paragraphs are its children.</li>
89cdf0e10cSrcweir     </ul>
90cdf0e10cSrcweir     </p>
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     <p>Accessible shapes do not listen for disposing() calls of the UNO
93cdf0e10cSrcweir     shapes they make accessible.  This is the task of their owner, usually a
94cdf0e10cSrcweir     container, who can then call dispose() at the accessible object.</p>
95cdf0e10cSrcweir */
96cdf0e10cSrcweir class SVX_DLLPUBLIC AccessibleShape
97cdf0e10cSrcweir     :	public AccessibleContextBase,
98cdf0e10cSrcweir         public AccessibleComponentBase,
99*9b8096d0SSteve Yin         public ::com::sun::star::accessibility::XAccessibleSelection,
100*9b8096d0SSteve Yin         public ::com::sun::star::accessibility::XAccessibleExtendedAttributes,
101*9b8096d0SSteve Yin         public ::com::sun::star::accessibility::XAccessibleGroupPosition,
102*9b8096d0SSteve Yin         public com::sun::star::accessibility::XAccessibleHypertext,
103cdf0e10cSrcweir         public IAccessibleViewForwarderListener,
104cdf0e10cSrcweir         public ::com::sun::star::document::XEventListener,
105cdf0e10cSrcweir         public ::com::sun::star::lang::XUnoTunnel
106cdf0e10cSrcweir {
107cdf0e10cSrcweir public:
108cdf0e10cSrcweir 	//=====  internal  ========================================================
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     /** Create a new accessible object that makes the given shape accessible.
111cdf0e10cSrcweir         @param rShapeInfo
112cdf0e10cSrcweir             This object contains all information specific to the new
113cdf0e10cSrcweir             accessible shape.  That are e.g. the shape to be made accessible
114cdf0e10cSrcweir             and the accessible object that will become the parent of the new
115cdf0e10cSrcweir             object.
116cdf0e10cSrcweir         @param rShapeTreeInfo
117cdf0e10cSrcweir             Bundel of information passed to this shape and all of its desendants.
118cdf0e10cSrcweir         @attention
119cdf0e10cSrcweir             Always call the <member>init</member> method after creating a
120cdf0e10cSrcweir             new accessible shape.  This is one way to overcome the potential
121cdf0e10cSrcweir             problem of registering the new object with e.g. event
122cdf0e10cSrcweir             broadcasters.  That would delete the new object if a broadcaster
123cdf0e10cSrcweir             would not keep a strong reference to the new object.
124cdf0e10cSrcweir     */
125cdf0e10cSrcweir 	AccessibleShape (
126cdf0e10cSrcweir         const AccessibleShapeInfo& rShapeInfo,
127cdf0e10cSrcweir         const AccessibleShapeTreeInfo& rShapeTreeInfo);
128*9b8096d0SSteve Yin 	AccessibleShape (
129*9b8096d0SSteve Yin         const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent, const AccessibleShapeTreeInfo& rShapeTreeInfo, sal_Int32 nIndex = -1);
130*9b8096d0SSteve Yin 	 //Solution: Overwrite the object's current name.
131*9b8096d0SSteve Yin     virtual ::rtl::OUString SAL_CALL  	getAccessibleName (void) throw (::com::sun::star::uno::RuntimeException);
132*9b8096d0SSteve Yin     virtual ::rtl::OUString SAL_CALL  	getAccessibleDescription() throw (::com::sun::star::uno::RuntimeException);
133*9b8096d0SSteve Yin 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL getAccessibleRelationSet (void) throw (::com::sun::star::uno::RuntimeException);
134*9b8096d0SSteve Yin //=====  XAccessibleSelection  ============================================
135*9b8096d0SSteve Yin 
136*9b8096d0SSteve Yin 	virtual void SAL_CALL selectAccessibleChild(
137*9b8096d0SSteve Yin 		sal_Int32 nChildIndex )
138*9b8096d0SSteve Yin 		throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
139*9b8096d0SSteve Yin 		::com::sun::star::uno::RuntimeException );
140*9b8096d0SSteve Yin 
141*9b8096d0SSteve Yin 	virtual sal_Bool SAL_CALL isAccessibleChildSelected(
142*9b8096d0SSteve Yin 		sal_Int32 nChildIndex )
143*9b8096d0SSteve Yin 		throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
144*9b8096d0SSteve Yin 		::com::sun::star::uno::RuntimeException );
145*9b8096d0SSteve Yin 
146*9b8096d0SSteve Yin 	virtual void SAL_CALL clearAccessibleSelection(  )
147*9b8096d0SSteve Yin 		throw ( ::com::sun::star::uno::RuntimeException );
148*9b8096d0SSteve Yin 
149*9b8096d0SSteve Yin 	virtual void SAL_CALL selectAllAccessibleChildren(  )
150*9b8096d0SSteve Yin 		throw ( ::com::sun::star::uno::RuntimeException );
151*9b8096d0SSteve Yin 
152*9b8096d0SSteve Yin 	virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  )
153*9b8096d0SSteve Yin 		throw ( ::com::sun::star::uno::RuntimeException );
154*9b8096d0SSteve Yin 
155*9b8096d0SSteve Yin 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
156*9b8096d0SSteve Yin 		sal_Int32 nSelectedChildIndex )
157*9b8096d0SSteve Yin 		throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
158*9b8096d0SSteve Yin 		::com::sun::star::uno::RuntimeException);
159*9b8096d0SSteve Yin 
160*9b8096d0SSteve Yin 	virtual void SAL_CALL deselectAccessibleChild(
161*9b8096d0SSteve Yin 		sal_Int32 nSelectedChildIndex )
162*9b8096d0SSteve Yin 		throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
163*9b8096d0SSteve Yin 		::com::sun::star::uno::RuntimeException );
164*9b8096d0SSteve Yin 
165*9b8096d0SSteve Yin 	// ====== XAccessibleExtendedAttributes =====================================
166*9b8096d0SSteve Yin 	virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
167*9b8096d0SSteve Yin 	throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
168*9b8096d0SSteve Yin 	///	Return this object's role.
169*9b8096d0SSteve Yin 	virtual sal_Int16 SAL_CALL getAccessibleRole (void) throw (::com::sun::star::uno::RuntimeException);
170*9b8096d0SSteve Yin     //=====  XAccessibleGroupPosition  =========================================
171*9b8096d0SSteve Yin     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
172*9b8096d0SSteve Yin         getGroupPosition( const ::com::sun::star::uno::Any& rAny )
173*9b8096d0SSteve Yin         throw (::com::sun::star::uno::RuntimeException);
174*9b8096d0SSteve Yin 	virtual ::rtl::OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject )
175*9b8096d0SSteve Yin         throw (::com::sun::star::uno::RuntimeException);
176cdf0e10cSrcweir     /** The destructor releases its children manager and text engine if
177cdf0e10cSrcweir         still existent.  These are responsible to send appropriate events.
178cdf0e10cSrcweir     */
179cdf0e10cSrcweir 	virtual ~AccessibleShape (void);
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     /** Initialize a new shape.  See the documentation of the constructor
182cdf0e10cSrcweir         for the reason of this method's existence.
183cdf0e10cSrcweir     */
184cdf0e10cSrcweir     virtual void Init (void);
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     /** Compare two accessible shapes using object identity
187cdf0e10cSrcweir         @param rShape
188cdf0e10cSrcweir             This is the second operand.
189cdf0e10cSrcweir         @return
190cdf0e10cSrcweir             Returns true if both shapes are the same object.
191cdf0e10cSrcweir     */
192cdf0e10cSrcweir     virtual bool operator== (const AccessibleShape& rShape);
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     /** Set the specified state.  If the state is <const>FOCUSED</const>
195cdf0e10cSrcweir         then, additionally to the inherited functionality, the focus
196cdf0e10cSrcweir         listeners registered with the <type>XAccessibleComponent</type>
197cdf0e10cSrcweir         interface are called (if that state really changes).
198cdf0e10cSrcweir 
199cdf0e10cSrcweir         @param aState
200cdf0e10cSrcweir             The state to turn on.
201cdf0e10cSrcweir 
202cdf0e10cSrcweir         @return
203cdf0e10cSrcweir             The returned flag indicates whether the specified state has been
204cdf0e10cSrcweir             changed (<TRUE/>), i.e. it has formerly not been set.
205cdf0e10cSrcweir     */
206cdf0e10cSrcweir     virtual sal_Bool SetState (sal_Int16 aState);
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     /** Reset the specified state.  If the state is <const>FOCUSED</const>
209cdf0e10cSrcweir         then, additionally to the inherited functionality, the focus
210cdf0e10cSrcweir         listeners registered with the <type>XAccessibleComponent</type>
211cdf0e10cSrcweir         interface are called (if that state really changes).
212cdf0e10cSrcweir 
213cdf0e10cSrcweir         @param aState
214cdf0e10cSrcweir             The state to turn off.
215cdf0e10cSrcweir 
216cdf0e10cSrcweir         @return
217cdf0e10cSrcweir             The returned flag indicates whether the specified state has been
218cdf0e10cSrcweir             changed (<TRUE/>), i.e. it has formerly been set.
219cdf0e10cSrcweir     */
220cdf0e10cSrcweir     virtual sal_Bool ResetState (sal_Int16 aState);
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     /** Return the state of the specified state.  Take the
223cdf0e10cSrcweir         <const>FOCUSED</const> state from the accessible edit engine.
224cdf0e10cSrcweir 
225cdf0e10cSrcweir         @param aState
226cdf0e10cSrcweir             The state for which to return its value.
227cdf0e10cSrcweir         @return
228cdf0e10cSrcweir             A value of <TRUE/> indicates that the state is set.  A <FALSE/>
229cdf0e10cSrcweir             value indicates an unset state or the inability to access the
230cdf0e10cSrcweir             entity that manages the state set.
231cdf0e10cSrcweir 
232cdf0e10cSrcweir     */
233cdf0e10cSrcweir     sal_Bool GetState (sal_Int16 aState);
234cdf0e10cSrcweir 
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	//=====  XAccessibleContext  ==============================================
237cdf0e10cSrcweir 
238cdf0e10cSrcweir     ///	Return the number of currently visible children.
239cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL
240cdf0e10cSrcweir     	getAccessibleChildCount (void)
241cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     /**	Return the specified child.
244cdf0e10cSrcweir         @param nIndex
245cdf0e10cSrcweir             Index of the requested child.
246cdf0e10cSrcweir         @return
247cdf0e10cSrcweir             Reference of the requested child which is the accessible object
248cdf0e10cSrcweir             of a visible shape.
249cdf0e10cSrcweir         @raises IndexOutOfBoundsException
250cdf0e10cSrcweir             Throws an exception if the index is not valid.
251cdf0e10cSrcweir     */
252cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
253cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessible> SAL_CALL
254cdf0e10cSrcweir     	getAccessibleChild (sal_Int32 nIndex)
255cdf0e10cSrcweir         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
256cdf0e10cSrcweir 
257cdf0e10cSrcweir 
258cdf0e10cSrcweir     ///	Return the set of current states.
259cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference<
260cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
261cdf0e10cSrcweir     	getAccessibleStateSet (void)
262cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	///	Return this objects index among the parents children.
265cdf0e10cSrcweir 	virtual	sal_Int32 SAL_CALL
266cdf0e10cSrcweir     	getAccessibleIndexInParent (void)
267cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     //=====  XAccessibleComponent  ============================================
270cdf0e10cSrcweir 
271cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
272cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible > SAL_CALL
273cdf0e10cSrcweir         getAccessibleAtPoint (const ::com::sun::star::awt::Point& aPoint)
274cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
275cdf0e10cSrcweir 
276cdf0e10cSrcweir     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds (void)
277cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
278cdf0e10cSrcweir 
279cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocation (void)
280cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
281cdf0e10cSrcweir 
282cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen (void)
283cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
284cdf0e10cSrcweir 
285cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size SAL_CALL getSize (void)
286cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground (void)
289cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground (void)
292cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 
295cdf0e10cSrcweir 
296cdf0e10cSrcweir     //=====  XComponent  ========================================================
297cdf0e10cSrcweir 
298cdf0e10cSrcweir     using WeakComponentImplHelperBase::addEventListener;
299cdf0e10cSrcweir     using WeakComponentImplHelperBase::removeEventListener;
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     //=====  XAccessibleEventBroadcaster  =====================================
302cdf0e10cSrcweir 
303cdf0e10cSrcweir     /** This call is forwarded to a) the base class and b) to the
304cdf0e10cSrcweir         accessible edit engine if it is present.
305cdf0e10cSrcweir 
306cdf0e10cSrcweir         @param rxListener
307cdf0e10cSrcweir             This listener is informed about accessibility events.
308cdf0e10cSrcweir     */
309cdf0e10cSrcweir     virtual void SAL_CALL
310cdf0e10cSrcweir         addEventListener (
311cdf0e10cSrcweir             const ::com::sun::star::uno::Reference<
312cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
313cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
314cdf0e10cSrcweir 
315cdf0e10cSrcweir     /** This call is forwarded to a) the base class and b) to the
316cdf0e10cSrcweir         accessible edit engine if it is present.
317cdf0e10cSrcweir 
318cdf0e10cSrcweir         @param rxListener
319cdf0e10cSrcweir             This listener will not be informed about accessibility events
320cdf0e10cSrcweir             anymore.
321cdf0e10cSrcweir     */
322cdf0e10cSrcweir     virtual void SAL_CALL
323cdf0e10cSrcweir         removeEventListener (
324cdf0e10cSrcweir             const ::com::sun::star::uno::Reference<
325cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessibleEventListener >& rxListener)
326cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 
329cdf0e10cSrcweir     //=====  XInterface  ======================================================
330cdf0e10cSrcweir 
331cdf0e10cSrcweir     virtual com::sun::star::uno::Any SAL_CALL
332cdf0e10cSrcweir         queryInterface (const com::sun::star::uno::Type & rType)
333cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
334cdf0e10cSrcweir 
335cdf0e10cSrcweir     virtual void SAL_CALL
336cdf0e10cSrcweir         acquire (void)
337cdf0e10cSrcweir         throw ();
338cdf0e10cSrcweir 
339cdf0e10cSrcweir     virtual void SAL_CALL
340cdf0e10cSrcweir         release (void)
341cdf0e10cSrcweir         throw ();
342cdf0e10cSrcweir 
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	//=====  XServiceInfo  ====================================================
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     /**	Returns an identifier for the implementation of this object.
347cdf0e10cSrcweir     */
348cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL
349cdf0e10cSrcweir     	getImplementationName (void)
350cdf0e10cSrcweir 	    throw (::com::sun::star::uno::RuntimeException);
351cdf0e10cSrcweir 
352cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
353cdf0e10cSrcweir         getSupportedServiceNames (void)
354cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
355cdf0e10cSrcweir 
356cdf0e10cSrcweir     //=====  XTypeProvider  ===================================================
357cdf0e10cSrcweir 
358cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
359cdf0e10cSrcweir         getTypes (void)
360cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
361cdf0e10cSrcweir 
362cdf0e10cSrcweir     //=====  IAccessibleViewForwarderListener  ================================
363cdf0e10cSrcweir     virtual void ViewForwarderChanged (ChangeType aChangeType,
364cdf0e10cSrcweir         const IAccessibleViewForwarder* pViewForwarder);
365cdf0e10cSrcweir 
366cdf0e10cSrcweir     //=====  lang::XEventListener  ============================================
367cdf0e10cSrcweir 
368cdf0e10cSrcweir     /** Listen for disposing events of the model.  The accessible shape
369cdf0e10cSrcweir         remains functional when this happens.
370cdf0e10cSrcweir     */
371cdf0e10cSrcweir     virtual void SAL_CALL
372cdf0e10cSrcweir         disposing (const ::com::sun::star::lang::EventObject& Source)
373cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
374cdf0e10cSrcweir 
375cdf0e10cSrcweir     //=====  document::XEventListener  ========================================
376cdf0e10cSrcweir 
377cdf0e10cSrcweir     virtual void SAL_CALL
378cdf0e10cSrcweir         notifyEvent (const ::com::sun::star::document::EventObject& rEventObject)
379cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
380cdf0e10cSrcweir 
381cdf0e10cSrcweir 
382cdf0e10cSrcweir     //===== XUnoTunnel ========================================================
383cdf0e10cSrcweir 
384cdf0e10cSrcweir     static const ::com::sun::star::uno::Sequence< sal_Int8 >&	getUnoTunnelImplementationId() throw();
385cdf0e10cSrcweir 	static AccessibleShape*										getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace ) throw();
386cdf0e10cSrcweir 	sal_Int64													SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
387cdf0e10cSrcweir 
388*9b8096d0SSteve Yin 	//===== XAccessibleHypertext ========================================================
389*9b8096d0SSteve Yin     virtual sal_Int32 SAL_CALL getHyperLinkCount() 	throw (::com::sun::star::uno::RuntimeException);
390*9b8096d0SSteve Yin     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink >
391*9b8096d0SSteve Yin 		SAL_CALL getHyperLink( sal_Int32 nLinkIndex )
392*9b8096d0SSteve Yin 		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
393*9b8096d0SSteve Yin     virtual sal_Int32 SAL_CALL getHyperLinkIndex( sal_Int32 nCharIndex )
394*9b8096d0SSteve Yin 		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
395*9b8096d0SSteve Yin 	//=====  XAccesibleText  ==================================================
396*9b8096d0SSteve Yin 		virtual sal_Int32 SAL_CALL getCaretPosition(  ) throw (::com::sun::star::uno::RuntimeException);
397*9b8096d0SSteve Yin 		virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
398*9b8096d0SSteve 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; change back to sal_Unicode
399*9b8096d0SSteve 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);
400*9b8096d0SSteve Yin 		virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
401*9b8096d0SSteve Yin 		virtual sal_Int32 SAL_CALL getCharacterCount(  ) throw (::com::sun::star::uno::RuntimeException);
402*9b8096d0SSteve Yin 		virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
403*9b8096d0SSteve Yin 		virtual ::rtl::OUString SAL_CALL getSelectedText(  ) throw (::com::sun::star::uno::RuntimeException);
404*9b8096d0SSteve Yin 		virtual sal_Int32 SAL_CALL getSelectionStart(  ) throw (::com::sun::star::uno::RuntimeException);
405*9b8096d0SSteve Yin 		virtual sal_Int32 SAL_CALL getSelectionEnd(  ) throw (::com::sun::star::uno::RuntimeException);
406*9b8096d0SSteve Yin 		virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
407*9b8096d0SSteve Yin 		virtual ::rtl::OUString SAL_CALL getText(  ) throw (::com::sun::star::uno::RuntimeException);
408*9b8096d0SSteve Yin 		virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
409*9b8096d0SSteve 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);
410*9b8096d0SSteve 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);
411*9b8096d0SSteve 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);
412*9b8096d0SSteve Yin 		virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
413*9b8096d0SSteve Yin 
414cdf0e10cSrcweir     //===== Misc ========================================================
415cdf0e10cSrcweir 
416cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
417cdf0e10cSrcweir         GetXShape();
418cdf0e10cSrcweir 
419cdf0e10cSrcweir 	/** set the index _nIndex at the accessible shape
420cdf0e10cSrcweir 		@param	_nIndex
421cdf0e10cSrcweir 			The new index in parent.
422cdf0e10cSrcweir 	*/
setIndexInParent(sal_Int32 _nIndex)423cdf0e10cSrcweir 	inline void setIndexInParent(sal_Int32 _nIndex) { m_nIndexInParent = _nIndex; }
424cdf0e10cSrcweir 
425cdf0e10cSrcweir protected:
426cdf0e10cSrcweir     /// Children manager. May be empty if there are no children.
427cdf0e10cSrcweir     ChildrenManager* mpChildrenManager;
428cdf0e10cSrcweir 
429cdf0e10cSrcweir     /// Reference to the actual shape.
430cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
431cdf0e10cSrcweir         ::com::sun::star::drawing::XShape> mxShape;
432cdf0e10cSrcweir 
433cdf0e10cSrcweir     /** Bundle of information passed to all shapes in a document tree.
434cdf0e10cSrcweir     */
435cdf0e10cSrcweir     AccessibleShapeTreeInfo maShapeTreeInfo;
436cdf0e10cSrcweir 
437cdf0e10cSrcweir     /** Index that is appended to the object's name to disambiguate between
438cdf0e10cSrcweir         different names with the otherwise same name.
439cdf0e10cSrcweir     */
440cdf0e10cSrcweir     long mnIndex;
441cdf0e10cSrcweir 
442cdf0e10cSrcweir 	/** the index in parent.
443cdf0e10cSrcweir 	*/
444cdf0e10cSrcweir 	sal_Int32 m_nIndexInParent;
445cdf0e10cSrcweir 
446cdf0e10cSrcweir     /** The accessible text engine.  May be NULL if it can not be created.
447cdf0e10cSrcweir     */
448cdf0e10cSrcweir     AccessibleTextHelper* mpText;
449cdf0e10cSrcweir 
450cdf0e10cSrcweir     /** This object can be used to modify the child list of our parent.
451cdf0e10cSrcweir     */
452cdf0e10cSrcweir     IAccessibleParent* mpParent;
453cdf0e10cSrcweir 
454cdf0e10cSrcweir 	/** This object can be removed when we have an extra interface to ask if the shape is selected
455cdf0e10cSrcweir 	*/
456cdf0e10cSrcweir 	SdrObject* m_pShape;
457cdf0e10cSrcweir 
458cdf0e10cSrcweir     /** This method is called from the component helper base class while
459cdf0e10cSrcweir         disposing.
460cdf0e10cSrcweir     */
461cdf0e10cSrcweir     virtual void SAL_CALL disposing (void);
462cdf0e10cSrcweir 
463cdf0e10cSrcweir     /**	Create a base name string that contains the accessible name.
464cdf0e10cSrcweir     */
465cdf0e10cSrcweir 	virtual ::rtl::OUString
466cdf0e10cSrcweir     	CreateAccessibleBaseName (void)
467cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
468cdf0e10cSrcweir 
469cdf0e10cSrcweir     /**	Create a unique name string that contains the accessible name.  The
470cdf0e10cSrcweir         name consists of the base name and the index.
471cdf0e10cSrcweir     */
472cdf0e10cSrcweir 	virtual ::rtl::OUString
473cdf0e10cSrcweir     	CreateAccessibleName (void)
474cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
475cdf0e10cSrcweir 
476cdf0e10cSrcweir     ///	Create a description string that contains the accessible description.
477cdf0e10cSrcweir 	virtual ::rtl::OUString
478cdf0e10cSrcweir     	CreateAccessibleDescription (void)
479cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
480*9b8096d0SSteve Yin 	virtual ::rtl::OUString
481*9b8096d0SSteve Yin        GetFullAccessibleName(AccessibleShape *shape)
482*9b8096d0SSteve Yin        throw (::com::sun::star::uno::RuntimeException);
483*9b8096d0SSteve Yin     virtual::rtl::OUString GetStyle();
484*9b8096d0SSteve Yin 	void UpdateDocumentAllSelState(::com::sun::star::uno::Reference<
485*9b8096d0SSteve Yin 		::com::sun::star::accessibility::XAccessibleStateSet > &xStateSet);
486cdf0e10cSrcweir     /** Update the <const>OPAQUE</const> and <const>SELECTED</const> state.
487cdf0e10cSrcweir     */
488cdf0e10cSrcweir     virtual void UpdateStates (void);
489cdf0e10cSrcweir 
490cdf0e10cSrcweir private:
491cdf0e10cSrcweir     /** Don't use the default constructor.  Use the public constructor that
492cdf0e10cSrcweir         takes the original shape and the parent as arguments instead.
493cdf0e10cSrcweir     */
494cdf0e10cSrcweir     SVX_DLLPRIVATE explicit AccessibleShape (void);
495cdf0e10cSrcweir     /// Don't use the copy constructor.  Is there any use for it?
496cdf0e10cSrcweir     SVX_DLLPRIVATE explicit AccessibleShape (const AccessibleShape&);
497cdf0e10cSrcweir     /// Don't use the assignment operator.  Do we need this?
498cdf0e10cSrcweir     SVX_DLLPRIVATE AccessibleShape& operator= (const AccessibleShape&);
499*9b8096d0SSteve Yin     //Solution:Old accessible name
500*9b8096d0SSteve Yin     ::rtl::OUString aAccName;
501cdf0e10cSrcweir 
502cdf0e10cSrcweir     /** Call this method when the title, name, or description of the mxShape
503cdf0e10cSrcweir         member (may) have been changed.
504cdf0e10cSrcweir         This method adapts the name and description members of the
505cdf0e10cSrcweir         AccessibleContextBase base class.
506cdf0e10cSrcweir     */
507cdf0e10cSrcweir     void UpdateNameAndDescription (void);
508cdf0e10cSrcweir };
509cdf0e10cSrcweir 
510cdf0e10cSrcweir } // end of namespace accessibility
511cdf0e10cSrcweir 
512cdf0e10cSrcweir #endif
513