1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_ACCESSILE_TEXT_HELPER_HXX_
25cdf0e10cSrcweir #define _SVX_ACCESSILE_TEXT_HELPER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <memory>
28cdf0e10cSrcweir #include <sal/types.h>
29cdf0e10cSrcweir #include <tools/gen.hxx>
30cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
31cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
32cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
33cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleContext.hpp>
34cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
35cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
36cdf0e10cSrcweir #include "svx/svxdllapi.h"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class SvxTextForwarder;
40cdf0e10cSrcweir class SvxViewForwarder;
41cdf0e10cSrcweir class SvxEditSource;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir namespace accessibility
44cdf0e10cSrcweir {
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     class AccessibleTextHelper_Impl;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	/** Helper class for objects containing EditEngine/Outliner text
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	    This class provides the methods from the XAccessibleContext,
51cdf0e10cSrcweir 	    XAccessibleEventBroadcaster and XAccessibleComponent
52cdf0e10cSrcweir 	    interfaces, that are common to all accessible objects
53cdf0e10cSrcweir 	    containing an edit engine.
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         The text contained in the EditEngine/Outliner is presented as
56cdf0e10cSrcweir         children of this class, namely for every text paragraph a
57cdf0e10cSrcweir         AccessibleEditableTextPara child object is generated. As this
58cdf0e10cSrcweir         class manages these children for itself, it has to send out
59cdf0e10cSrcweir         AccessibleEventId::CHILD events on your
60cdf0e10cSrcweir         behalf. Thus, you must forward every call to your
61cdf0e10cSrcweir         addEventListener()/removeEventListener() methods to the
62cdf0e10cSrcweir         AccessibleTextHelper (methods
63cdf0e10cSrcweir         AddEventListener/RemoveEventListener), otherwise none or not
64cdf0e10cSrcweir         every one of your event listener will notice child changes.
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 		You have to implement the SvxEditSource, SvxTextForwarder,
67cdf0e10cSrcweir 		SvxViewForwarder and SvxEditViewForwarder interfaces in order
68cdf0e10cSrcweir 		to enable your object to cooperate with this
69cdf0e10cSrcweir 		class. SvxTextForwarder encapsulates the fact that text
70cdf0e10cSrcweir 		objects do not necessarily have an EditEngine at their
71cdf0e10cSrcweir 		disposal, SvxViewForwarder and SvxEditViewForwarder do the
72cdf0e10cSrcweir 		same for the document and the edit view. The three mentioned
73cdf0e10cSrcweir 		forwarder objects are not stored by the AccessibleTextHelper,
74cdf0e10cSrcweir 		but fetched every time from the SvxEditSource. So you are best
75cdf0e10cSrcweir 		off making your SvxEditSource::Get*Forwarder methods cache the
76cdf0e10cSrcweir 		current forwarder.
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 		To support changes in edit mode or conversion of fixed text
79cdf0e10cSrcweir 		into EditEngine text, you can change the SvxEditSource this
80cdf0e10cSrcweir 		class is referring to. This might render all children invalid
81cdf0e10cSrcweir 		and change the child count, since the AccessibleTextHelper
82cdf0e10cSrcweir 		reinitializes itself from scratch.
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 		This class registers itself at the SvxEditSource as a state
85cdf0e10cSrcweir 		listener and manages the state of its children (i.e. the
86cdf0e10cSrcweir 		paragraphs). See the method documentation of
87cdf0e10cSrcweir 		AccessibleTextHelper::SetEditSource for the expected
88cdf0e10cSrcweir 		events. Generally, be prepared that when sending any of these
89cdf0e10cSrcweir 		events via SvxEditSource::GetBroadcaster() broadcaster, the
90cdf0e10cSrcweir 		AccessibleTextHelper will call the SvxEditSource and their
91cdf0e10cSrcweir 		forwarder to update it's state. Avoid being inconsistent in
92cdf0e10cSrcweir 		the facts you tell in the events, e.g. when sending a
93cdf0e10cSrcweir 		TEXT_HINT_PARAINSERTED event, the
94cdf0e10cSrcweir 		SvxEditSource::GetTextForwarder().GetParagraphCount() should
95cdf0e10cSrcweir 		already include the newly inserted paragraph.
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 		@attention All public methods must not be called with any
98cdf0e10cSrcweir 		mutex hold, except when calling from the main thread (with
99cdf0e10cSrcweir 		holds the solar mutex), unless stated otherwise. This is
100cdf0e10cSrcweir 		because they themselves might need the solar mutex in addition
101cdf0e10cSrcweir 		to the object mutex, and the ordering of the locking must be:
102cdf0e10cSrcweir 		first solar mutex, then object mutex. Furthermore, state
103cdf0e10cSrcweir 		change events might be fired internally.
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 		@derive Use this class in an aggregation and forward, or
106cdf0e10cSrcweir 		derive from it and overwrite. If the Remove/AddEventListener
107cdf0e10cSrcweir 		methods are overwritten, make sure FireEvent is adapted,
108cdf0e10cSrcweir 		too.
109cdf0e10cSrcweir 
110cdf0e10cSrcweir         @see SvxEditSource
111cdf0e10cSrcweir         @see SvxTextForwarder
112cdf0e10cSrcweir 		@see SvxViewForwarder
113cdf0e10cSrcweir         @see SvxEditViewForwarder
114cdf0e10cSrcweir 	*/
115cdf0e10cSrcweir     class SVX_DLLPUBLIC AccessibleTextHelper
116cdf0e10cSrcweir     {
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     public:
119cdf0e10cSrcweir         typedef ::std::vector< sal_Int16 > VectorOfStates;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir         /** Create accessible text object for given edit source
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 	        @param pEditSource
124cdf0e10cSrcweir 	        The edit source to use. Object ownership is transferred
125cdf0e10cSrcweir 	        from the caller to the callee. The object listens on the
126cdf0e10cSrcweir 	        SvxEditSource for object disposal, so no provisions have
127cdf0e10cSrcweir 	        to be taken if the caller destroys the data (e.g. the
128cdf0e10cSrcweir 	        model) contained in the given SvxEditSource.
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         */
131cdf0e10cSrcweir         explicit AccessibleTextHelper( ::std::auto_ptr< SvxEditSource > pEditSource );
132cdf0e10cSrcweir         virtual ~AccessibleTextHelper();
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     protected:
135cdf0e10cSrcweir 
136cdf0e10cSrcweir         // declared, but not defined
137cdf0e10cSrcweir         AccessibleTextHelper( const AccessibleTextHelper& );
138cdf0e10cSrcweir         // declared, but not defined
139cdf0e10cSrcweir         AccessibleTextHelper& operator= ( const AccessibleTextHelper& );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     public:
142cdf0e10cSrcweir         /** Query the current edit source
143cdf0e10cSrcweir 
144cdf0e10cSrcweir         	@attention This method returns by reference, so you are
145cdf0e10cSrcweir         	responsible for serialization (typically, you aquired the
146cdf0e10cSrcweir         	solar mutex when calling this method). Thus, the method
147cdf0e10cSrcweir         	should only be called from the main office thread.
148cdf0e10cSrcweir 
149cdf0e10cSrcweir          */
150cdf0e10cSrcweir         virtual const SvxEditSource& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException));
151cdf0e10cSrcweir 
152cdf0e10cSrcweir         /** Set the current edit source
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 	    	@attention Might fire state change events, therefore,
155cdf0e10cSrcweir 	    	don't hold any mutex except solar mutex, which you are
156cdf0e10cSrcweir 	    	required to lock before. This method should only be called
157cdf0e10cSrcweir 	    	from the main office thread.
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     	    The EditSource set here is required to broadcast out the
160cdf0e10cSrcweir     	    following hints: EDITSOURCE_HINT_PARASMOVED,
161cdf0e10cSrcweir     	    EDITSOURCE_HINT_SELECTIONCHANGED, TEXT_HINT_MODIFIED,
162cdf0e10cSrcweir     	    TEXT_HINT_PARAINSERTED, TEXT_HINT_PARAREMOVED,
163cdf0e10cSrcweir     	    TEXT_HINT_TEXTHEIGHTCHANGED,
164cdf0e10cSrcweir     	    TEXT_HINT_VIEWSCROLLED. Otherwise, not all state changes
165cdf0e10cSrcweir     	    will get noticed by the accessibility object. Further
166cdf0e10cSrcweir     	    more, when the corresponding core object or the model is
167cdf0e10cSrcweir     	    dying, either the edit source must be set to NULL or it
168cdf0e10cSrcweir     	    has to broadcast a SFX_HINT_DYING hint.
169cdf0e10cSrcweir 
170cdf0e10cSrcweir             If the SvxEditSource's managed text can change between
171cdf0e10cSrcweir             edit/non-edit mode (i.e. there are times when
172cdf0e10cSrcweir             SvxEditSource::GetEditViewForwarder(sal_False) returns
173cdf0e10cSrcweir             NULL), then the two additional hints are required:
174cdf0e10cSrcweir             HINT_BEGEDIT and HINT_ENDEDIT. When the
175cdf0e10cSrcweir             AccessibleTextHelper receives a HINT_BEGEDIT, it expects
176cdf0e10cSrcweir             the SvxEditSource already in edit mode. On a HINT_ENDEDIT,
177cdf0e10cSrcweir             edit mode must already been left. The rationale for these
178cdf0e10cSrcweir             events are the fact that focus and selection have to be
179cdf0e10cSrcweir             updated in edit mode, and completely relinquished and
180cdf0e10cSrcweir             reset to the parent (for the focus) in non-edit mode.
181cdf0e10cSrcweir 
182cdf0e10cSrcweir             This class does not have a dispose method, since it is not
183cdf0e10cSrcweir             a UNO component. Nevertheless, it holds C++ references to
184cdf0e10cSrcweir             several core objects, so you should issue a
185cdf0e10cSrcweir             SetEditSource(::std::auto_ptr<SvxEditSource>(NULL)) in
186cdf0e10cSrcweir             your dispose() method.
187cdf0e10cSrcweir 
188cdf0e10cSrcweir         	@param pEditSource
189cdf0e10cSrcweir 	        The new edit source to set. Object ownership is transferred
190cdf0e10cSrcweir     	    from the caller to the callee.
191cdf0e10cSrcweir         */
192cdf0e10cSrcweir         virtual void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) SAL_THROW((::com::sun::star::uno::RuntimeException));
193cdf0e10cSrcweir 
194cdf0e10cSrcweir         /** Set the event source
195cdf0e10cSrcweir 
196cdf0e10cSrcweir         	You should set the event source before registering any
197cdf0e10cSrcweir         	event listener and before requesting any child. Children
198cdf0e10cSrcweir         	of this object receive the event source as their parent
199cdf0e10cSrcweir         	accessible object. That is, the event source is best set
200cdf0e10cSrcweir         	in your object's init method.
201cdf0e10cSrcweir 
202cdf0e10cSrcweir         	@attention When setting a reference here, you should call
203cdf0e10cSrcweir         	Dispose() when you as the owner are disposing, since until
204cdf0e10cSrcweir         	then this object will hold that reference
205cdf0e10cSrcweir 
206cdf0e10cSrcweir         	@param rInterface
207cdf0e10cSrcweir             The interface that should be set as the source for
208cdf0e10cSrcweir             accessibility events sent by this object.
209cdf0e10cSrcweir          */
210cdf0e10cSrcweir         virtual void SetEventSource( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rInterface );
211cdf0e10cSrcweir 
212cdf0e10cSrcweir         /** Get the event source
213cdf0e10cSrcweir 
214cdf0e10cSrcweir         	@return the interface that is set as the source for
215cdf0e10cSrcweir             accessibility events sent by this object.
216cdf0e10cSrcweir          */
217cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetEventSource() const;
218cdf0e10cSrcweir 
219cdf0e10cSrcweir         /** Set offset of EditEngine/Outliner from parent
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	    	If the origin of the underlying EditEngine/Outliner does
222cdf0e10cSrcweir 	    	not correspond to the upper left corner of the object
223cdf0e10cSrcweir 	    	using this class, you have to specify the offset.
224cdf0e10cSrcweir 
225cdf0e10cSrcweir     		@attention Might fire state change events, therefore,
226cdf0e10cSrcweir     		don't hold any mutex except solar mutex, which you are
227cdf0e10cSrcweir     		required to lock before. This method should only be called
228cdf0e10cSrcweir     		from the main office thread.
229cdf0e10cSrcweir 
230cdf0e10cSrcweir         	@param rPoint
231cdf0e10cSrcweir 	        The offset in screen coordinates (i.e. pixel)
232cdf0e10cSrcweir         */
233cdf0e10cSrcweir         virtual void SetOffset( const Point& rPoint );
234cdf0e10cSrcweir 
235cdf0e10cSrcweir         /** Query offset of EditEngine/Outliner from parent
236cdf0e10cSrcweir 
237cdf0e10cSrcweir     		@return the offset in screen coordinates (i.e. pixel)
238cdf0e10cSrcweir         */
239cdf0e10cSrcweir         virtual Point GetOffset() const;
240cdf0e10cSrcweir 
241cdf0e10cSrcweir         /** Set offset the object adds to all children's indices
242cdf0e10cSrcweir 
243cdf0e10cSrcweir         	This can be used if the owner of this object has children
244cdf0e10cSrcweir         	handled by itself. Setting an offset different from 0
245cdf0e10cSrcweir         	leads to this object mimicking that all it's children are
246cdf0e10cSrcweir         	within the range [nOffset, GetChildCount()+nOffset). That
247cdf0e10cSrcweir         	means, GetChild() also expects the index to be in this
248cdf0e10cSrcweir         	range.
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	    	@attention Might fire state change events, therefore,
251cdf0e10cSrcweir 	    	don't hold any mutex except solar mutex, which you are
252cdf0e10cSrcweir 	    	required to lock before. This method should only be called
253cdf0e10cSrcweir 	    	from the main office thread.
254cdf0e10cSrcweir 
255cdf0e10cSrcweir             @param nOffset
256cdf0e10cSrcweir             The offset to add to every children's index.
257cdf0e10cSrcweir         */
258cdf0e10cSrcweir         virtual void SetStartIndex( sal_Int32 nOffset );
259cdf0e10cSrcweir 
260cdf0e10cSrcweir         /** Query offset the object adds to all children's indices
261cdf0e10cSrcweir 
262cdf0e10cSrcweir     		@return the offset to add to every children's index.
263cdf0e10cSrcweir         */
264cdf0e10cSrcweir         virtual sal_Int32 GetStartIndex() const;
265cdf0e10cSrcweir 
266cdf0e10cSrcweir         /** Sets a vector of additional accessible states.
267cdf0e10cSrcweir 
268cdf0e10cSrcweir             The states are passed to every created child object
269cdf0e10cSrcweir             (text paragraph). The state values are defined in
270cdf0e10cSrcweir             com::sun::star::accessibility::AccessibleStateType.
271cdf0e10cSrcweir 
272cdf0e10cSrcweir             This function has to be called before querying for
273cdf0e10cSrcweir             any children (e.g. with GetChild()).
274cdf0e10cSrcweir          */
275cdf0e10cSrcweir         void SetAdditionalChildStates( const VectorOfStates& rChildStates );
276cdf0e10cSrcweir 
277cdf0e10cSrcweir         /** Returns the additional accessible states for children.
278cdf0e10cSrcweir          */
279cdf0e10cSrcweir         const VectorOfStates& GetAdditionalChildStates() const;
280cdf0e10cSrcweir 
281cdf0e10cSrcweir         /** Update the visible children
282cdf0e10cSrcweir 
283cdf0e10cSrcweir     		@attention Might fire state change events, therefore,
284cdf0e10cSrcweir     		don't hold any mutex except solar mutex, which you are
285cdf0e10cSrcweir     		required to lock before. This method should only be called
286cdf0e10cSrcweir     		from the main office thread.
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 	        This method reevaluates the visibility of all
289cdf0e10cSrcweir 	        childrens. Call this method if your visibility state has
290cdf0e10cSrcweir 	        changed somehow, e.g. if the visible area has changed and
291cdf0e10cSrcweir 	        the AccessibleTextHelper isn't notified internally
292cdf0e10cSrcweir 	        (e.g. via TEXT_HINT_VIEWSCROLLED). Normally, there should
293cdf0e10cSrcweir 	        not be a need to call this method.
294cdf0e10cSrcweir         */
295cdf0e10cSrcweir         virtual void UpdateChildren() SAL_THROW((::com::sun::star::uno::RuntimeException));
296cdf0e10cSrcweir 
297cdf0e10cSrcweir         /** Drop all references and enter disposed state
298cdf0e10cSrcweir 
299cdf0e10cSrcweir         	This method drops all references to external objects (also
300cdf0e10cSrcweir         	the event source reference set via SetEventSource()) and
301cdf0e10cSrcweir         	sets the object into the disposed state (i.e. the methods
302cdf0e10cSrcweir         	return default values or throw a uno::DisposedException
303cdf0e10cSrcweir         	exception).
304cdf0e10cSrcweir          */
305cdf0e10cSrcweir         virtual void Dispose();
306cdf0e10cSrcweir 
307cdf0e10cSrcweir         /** Set the focus state of the accessibility object
308cdf0e10cSrcweir 
309cdf0e10cSrcweir         	Since this class handles children which also might get the
310cdf0e10cSrcweir         	focus, the user of this class is encouraged to delegate
311cdf0e10cSrcweir         	focus handling. Whenever the focus state of the
312cdf0e10cSrcweir         	surrounding object changes, this method has to be called.
313cdf0e10cSrcweir 
314cdf0e10cSrcweir             The protocol of focus handling for a user of this class is
315cdf0e10cSrcweir             then to call SetFocus() with the appropriate focus state,
316cdf0e10cSrcweir             and HaveFocus() to determine the focus state you tell the
317cdf0e10cSrcweir             outside.
318cdf0e10cSrcweir 
319cdf0e10cSrcweir 	    	@attention Might fire state change events, therefore,
320cdf0e10cSrcweir 	    	don't hold any mutex except solar mutex, which you are
321cdf0e10cSrcweir 	    	required to lock before. This method should only be called
322cdf0e10cSrcweir 	    	from the main office thread.
323cdf0e10cSrcweir 
324cdf0e10cSrcweir             @param bHaveFocus
325cdf0e10cSrcweir             Whether we got or we lost the focus. Set to sal_True if
326cdf0e10cSrcweir             focus is gotten, sal_False otherwise.
327cdf0e10cSrcweir 
328cdf0e10cSrcweir             @see HaveFocus()
329cdf0e10cSrcweir          */
330cdf0e10cSrcweir         virtual void SetFocus( sal_Bool bHaveFocus = sal_True ) SAL_THROW((::com::sun::star::uno::RuntimeException));
331cdf0e10cSrcweir 
332cdf0e10cSrcweir         /** Query the focus state of the surrounding object
333cdf0e10cSrcweir 
334cdf0e10cSrcweir         	If focus handling is delegated to this class, determine
335cdf0e10cSrcweir         	focus state with this method. Be prepared that even if you
336cdf0e10cSrcweir         	set the focus with SetFocus(sal_True), this method might
337cdf0e10cSrcweir         	return sal_False. This is the case if one of the children
338cdf0e10cSrcweir         	actually got the focus.
339cdf0e10cSrcweir 
340cdf0e10cSrcweir             @return the state of the focus ownership
341cdf0e10cSrcweir          */
342cdf0e10cSrcweir         virtual sal_Bool HaveFocus() SAL_THROW((::com::sun::star::uno::RuntimeException));
343cdf0e10cSrcweir 
344cdf0e10cSrcweir         /** Call this method to invoke all event listeners with the given event
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 	    	@attention Fires state change events, therefore, don't hold any mutex
347cdf0e10cSrcweir 
348cdf0e10cSrcweir         	@param nEventId
349cdf0e10cSrcweir     	    Id of the event to send, @see AccessibleEventId
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	        @param rNewValue
352cdf0e10cSrcweir     	    The value we've changed into
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 	        @param rOldValue
355cdf0e10cSrcweir     	    The old value before the change
356cdf0e10cSrcweir         */
357cdf0e10cSrcweir         virtual void FireEvent( const sal_Int16 nEventId,
358cdf0e10cSrcweir                                 const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
359cdf0e10cSrcweir                                 const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
360cdf0e10cSrcweir 
361cdf0e10cSrcweir         /** Call this method to invoke all event listeners with the given event
362cdf0e10cSrcweir 
363cdf0e10cSrcweir 	    	@attention Fires state change events, therefore, don't hold any mutex
364cdf0e10cSrcweir 
365cdf0e10cSrcweir         	@param rEvent
366cdf0e10cSrcweir     	    The event to send, @see AccessibleEventObject
367cdf0e10cSrcweir 
368cdf0e10cSrcweir         */
369cdf0e10cSrcweir         // TODO: make that virtual next time
370cdf0e10cSrcweir         void FireEvent( const ::com::sun::star::accessibility::AccessibleEventObject& rEvent ) const;
371cdf0e10cSrcweir 
372cdf0e10cSrcweir         /** Query select state of the text managed by this object
373cdf0e10cSrcweir 
374cdf0e10cSrcweir     		@attention Don't call with locked mutexes. You may hold
375cdf0e10cSrcweir     		the solar mutex, but this method aquires it anyway.
376cdf0e10cSrcweir 
377cdf0e10cSrcweir 	    	@return sal_True, if the text or parts of it are currently selected
378cdf0e10cSrcweir         */
379cdf0e10cSrcweir         virtual sal_Bool IsSelected() const;
380cdf0e10cSrcweir 
381cdf0e10cSrcweir         // XAccessibleContext child handling methods
382cdf0e10cSrcweir         //-----------------------------------------------------------------
383cdf0e10cSrcweir         /** Implements getAccessibleChildCount
384cdf0e10cSrcweir 
385cdf0e10cSrcweir     		@attention Don't call with locked mutexes. You may hold
386cdf0e10cSrcweir     		the solar mutex, but this method aquires it anyway.
387cdf0e10cSrcweir         */
388cdf0e10cSrcweir         virtual sal_Int32 GetChildCount() SAL_THROW((::com::sun::star::uno::RuntimeException));
389cdf0e10cSrcweir         /** Implements getAccessibleChild
390cdf0e10cSrcweir 
391cdf0e10cSrcweir     		@attention Don't call with locked mutexes. You may hold
392cdf0e10cSrcweir     		the solar mutex, but this method aquires it anyway.
393cdf0e10cSrcweir         */
394cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChild( sal_Int32 i ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException));
395cdf0e10cSrcweir 
396cdf0e10cSrcweir         // XAccessibleEventBroadcaster child related methods
397cdf0e10cSrcweir         //-----------------------------------------------------------------
398cdf0e10cSrcweir         /** Implements addEventListener
399cdf0e10cSrcweir 
400cdf0e10cSrcweir     		@attention Don't call with locked mutexes
401cdf0e10cSrcweir         */
402cdf0e10cSrcweir         virtual void AddEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) SAL_THROW((::com::sun::star::uno::RuntimeException));
403cdf0e10cSrcweir         /** Implements removeEventListener
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     		@attention Don't call with locked mutexes
406cdf0e10cSrcweir         */
407cdf0e10cSrcweir         virtual void RemoveEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) SAL_THROW((::com::sun::star::uno::RuntimeException));
408cdf0e10cSrcweir 
409cdf0e10cSrcweir         // XAccessibleComponent child related methods
410cdf0e10cSrcweir         //-----------------------------------------------------------------
411cdf0e10cSrcweir         /** Implements getAccessibleAt
412cdf0e10cSrcweir 
413cdf0e10cSrcweir     		@attention Don't call with locked mutexes. You may hold
414cdf0e10cSrcweir     		the solar mutex, but this method aquires it anyway.
415cdf0e10cSrcweir         */
416cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL GetAt( const ::com::sun::star::awt::Point& aPoint ) SAL_THROW((::com::sun::star::uno::RuntimeException));
417cdf0e10cSrcweir 
418cdf0e10cSrcweir     private:
419cdf0e10cSrcweir 
420cdf0e10cSrcweir         /// @dyn
421cdf0e10cSrcweir         const std::auto_ptr< AccessibleTextHelper_Impl > mpImpl;
422cdf0e10cSrcweir 
423cdf0e10cSrcweir     };
424cdf0e10cSrcweir 
425cdf0e10cSrcweir } // end of namespace accessibility
426cdf0e10cSrcweir 
427cdf0e10cSrcweir #endif /* _SVX_ACCESSILE_TEXT_HELPER_HXX_ */
428