20#ifndef INCLUDED_EDITENG_ACCESSIBLEPARAMANAGER_HXX
21#define INCLUDED_EDITENG_ACCESSIBLEPARAMANAGER_HXX
23#include <config_options.h>
27#include <com/sun/star/awt/Rectangle.hpp>
28#include <com/sun/star/uno/Reference.hxx>
35class SvxEditSourceAdapter;
39 class AccessibleEditableTextPara;
48 template <
class UnoType,
class CppType >
class WeakCppRef
66 css::uno::Reference<UnoInterfaceType> ref(
maWeakRef);
77 css::uno::WeakReference< UnoInterfaceType >
maWeakRef;
89 class UNLESS_MERGELIBS(EDITENG_DLLPUBLIC) AccessibleParaManager
93 typedef ::std::pair< WeakPara, css::awt::Rectangle > WeakChild;
94 typedef ::std::pair< css::uno::Reference<
95 css::accessibility::XAccessible > , css::awt::Rectangle >
Child;
96 typedef ::std::vector< WeakChild > VectorOfChildren;
98 AccessibleParaManager();
99 ~AccessibleParaManager();
107 void SetAdditionalChildStates( sal_Int64 nChildStates );
115 void SetNum( sal_Int32 nNumParas );
118 sal_Int32 GetNum()
const;
121 VectorOfChildren::iterator
begin();
122 VectorOfChildren::iterator
end();
125 void SetFocus( sal_Int32 nChild );
127 void FireEvent( sal_Int32 nPara,
128 const sal_Int16 nEventId )
const;
131 bool IsReferencable( sal_Int32 nChild )
const;
132 static void ShutdownPara(
const WeakChild& rChild );
134 Child CreateChild( sal_Int32 nChild,
135 const css::uno::Reference< css::accessibility::XAccessible >& xFrontEnd,
136 SvxEditSourceAdapter& rEditSource,
137 sal_Int32 nParagraphIndex );
139 WeakChild GetChild( sal_Int32 nParagraphIndex )
const;
140 bool HasCreatedChild( sal_Int32 nParagraphIndex )
const;
144 void SetActive(
bool bActive =
true );
146 void SetState(
const sal_Int64 nStateId );
148 void UnSetState(
const sal_Int64 nStateId );
150 void SetEEOffset (
const Point& rOffset );
166 void Release( sal_Int32 nStartPara, sal_Int32 nEndPara );
178 void FireEvent( sal_Int32 nStartPara,
180 const sal_Int16 nEventId,
181 const css::uno::Any& rNewValue = css::uno::Any(),
182 const css::uno::Any& rOldValue = css::uno::Any() )
const;
194 template <
typename Functor >
class WeakChildAdapter
197 WeakChildAdapter( Functor& rFunctor ) : mrFunctor(rFunctor) {}
198 void operator()(
const WeakChild& rPara )
201 auto aHardRef( rPara.first.get() );
204 mrFunctor( *aHardRef );
220 template <
typename Argument >
class MemFunAdapter
223 typedef void (::accessibility::AccessibleEditableTextPara::*FunctionPointer)( Argument );
225 MemFunAdapter( FunctionPointer aFunPtr, Argument aArg ) : maFunPtr(aFunPtr), maArg(aArg) {}
226 void operator()(
const WeakChild& rPara )
229 auto aHardRef( rPara.first.get() );
232 (*aHardRef.*maFunPtr)( maArg );
236 FunctionPointer maFunPtr;
242 void SetState( sal_Int32 nChild,
const sal_Int64 nStateId );
244 void UnSetState( sal_Int32 nChild,
const sal_Int64 nStateId );
246 void InitChild( AccessibleEditableTextPara& rChild,
247 SvxEditSourceAdapter& rEditSource,
249 sal_Int32 nParagraphIndex )
const;
255 sal_Int64 mnChildStates;
261 sal_Int32 mnFocusedChild;
std::vector< Reference< XAnimationNode > > maChildren
Helper class for weak object references plus implementation.
WeakCppRef(rtl::Reference< InterfaceType > const &rImpl)
rtl::Reference< InterfaceType > get() const
css::uno::WeakReference< UnoInterfaceType > maWeakRef
InterfaceType * maUnsafeRef
void Dispose(const T &xInterface)
enumrange< T >::Iterator begin(enumrange< T >)