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_STARMATH_SOURCE_ACCESSIBILITY_HXX
21 : #define INCLUDED_STARMATH_SOURCE_ACCESSIBILITY_HXX
22 :
23 : #include <com/sun/star/accessibility/XAccessible.hpp>
24 : #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
25 : #include <com/sun/star/accessibility/XAccessibleContext.hpp>
26 : #include <com/sun/star/accessibility/XAccessibleText.hpp>
27 : #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
28 : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
29 : #include <com/sun/star/lang/XServiceInfo.hpp>
30 : #include <com/sun/star/uno/Reference.h>
31 : #include <osl/mutex.hxx>
32 : #include <cppuhelper/interfacecontainer.h>
33 : #include <cppuhelper/implbase.hxx>
34 : #include <svl/SfxBroadcaster.hxx>
35 :
36 : #include <editeng/editeng.hxx>
37 : #include <editeng/unoedsrc.hxx>
38 : #include <svx/AccessibleTextHelper.hxx>
39 : #include <edit.hxx>
40 :
41 : class SmGraphicWindow;
42 : class SmEditWindow;
43 : class SmDocShell;
44 :
45 : namespace com { namespace sun { namespace star { namespace accessibility {
46 : struct AccessibleEventObject;
47 : }}}}
48 :
49 :
50 :
51 : // classes and helper-classes used for accessibility in the graphic-window
52 :
53 :
54 : typedef
55 : cppu::WeakImplHelper
56 : <
57 : com::sun::star::lang::XServiceInfo,
58 : com::sun::star::accessibility::XAccessible,
59 : com::sun::star::accessibility::XAccessibleComponent,
60 : com::sun::star::accessibility::XAccessibleContext,
61 : com::sun::star::accessibility::XAccessibleText,
62 : com::sun::star::accessibility::XAccessibleEventBroadcaster
63 : >
64 : SmGraphicAccessibleBaseClass;
65 :
66 : class SmGraphicAccessible :
67 : public SmGraphicAccessibleBaseClass
68 : {
69 : OUString aAccName;
70 : /// client id in the AccessibleEventNotifier queue
71 : sal_uInt32 nClientId;
72 :
73 : VclPtr<SmGraphicWindow> pWin;
74 :
75 : SmGraphicAccessible( const SmGraphicAccessible & ) SAL_DELETED_FUNCTION;
76 : SmGraphicAccessible & operator = ( const SmGraphicAccessible & ) SAL_DELETED_FUNCTION;
77 :
78 : protected:
79 : SmDocShell * GetDoc_Impl();
80 : OUString GetAccessibleText_Impl();
81 :
82 : public:
83 : explicit SmGraphicAccessible( SmGraphicWindow *pGraphicWin );
84 : virtual ~SmGraphicAccessible();
85 :
86 : SmGraphicWindow * GetWin() { return pWin; }
87 : void ClearWin(); // to be called when view is destroyed
88 : void LaunchEvent(
89 : const sal_Int16 nAccesibleEventId,
90 : const ::com::sun::star::uno::Any &rOldVal,
91 : const ::com::sun::star::uno::Any &rNewVal);
92 :
93 : // XAccessible
94 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 :
96 : // XAccessibleComponent
97 : virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 : virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 : virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 : virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 : virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 : virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 : virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 :
107 : // XAccessibleContext
108 : virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 : virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 : virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 : virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
115 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
117 : virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 :
119 : // XAccessibleEventBroadcaster
120 : virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 : virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 :
123 : // XAccessibleText
124 : virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : virtual sal_Bool SAL_CALL setCaretPosition ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 : virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 : 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;
128 : 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;
129 : virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
130 : virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
131 : virtual OUString SAL_CALL getSelectedText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
132 : virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
133 : virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 : 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;
135 : virtual OUString SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 : 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;
137 : 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;
138 : 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;
139 : 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;
140 : 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;
141 :
142 : // XServiceInfo
143 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
144 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
146 : };
147 :
148 :
149 :
150 : // classes and helper-classes used for accessibility in the command-window
151 :
152 :
153 : class SmEditAccessible;
154 : class SmEditSource;
155 : class EditEngine;
156 : class EditView;
157 : class SvxFieldItem;
158 : struct ESelection;
159 :
160 :
161 : class SmViewForwarder :
162 : public SvxViewForwarder
163 : {
164 : SmEditAccessible & rEditAcc;
165 :
166 : SmViewForwarder( const SmViewForwarder & ) SAL_DELETED_FUNCTION;
167 : SmViewForwarder & operator = ( const SmViewForwarder & ) SAL_DELETED_FUNCTION;
168 :
169 : public:
170 : explicit SmViewForwarder( SmEditAccessible &rAcc );
171 : virtual ~SmViewForwarder();
172 :
173 : virtual bool IsValid() const SAL_OVERRIDE;
174 : virtual Rectangle GetVisArea() const SAL_OVERRIDE;
175 : virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const SAL_OVERRIDE;
176 : virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const SAL_OVERRIDE;
177 : };
178 :
179 :
180 : class SmTextForwarder : /* analog to SvxEditEngineForwarder */
181 : public SvxTextForwarder
182 : {
183 : SmEditAccessible & rEditAcc;
184 : SmEditSource & rEditSource;
185 :
186 : DECL_LINK( NotifyHdl, EENotify * );
187 :
188 : SmTextForwarder( const SmTextForwarder & ) SAL_DELETED_FUNCTION;
189 : SmTextForwarder & operator = ( const SmTextForwarder & ) SAL_DELETED_FUNCTION;
190 :
191 : public:
192 : SmTextForwarder( SmEditAccessible& rAcc, SmEditSource & rSource );
193 : virtual ~SmTextForwarder();
194 :
195 : virtual sal_Int32 GetParagraphCount() const SAL_OVERRIDE;
196 : virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const SAL_OVERRIDE;
197 : virtual OUString GetText( const ESelection& rSel ) const SAL_OVERRIDE;
198 : virtual SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ) const SAL_OVERRIDE;
199 : virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const SAL_OVERRIDE;
200 : virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) SAL_OVERRIDE;
201 : virtual void RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich ) SAL_OVERRIDE;
202 : virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const SAL_OVERRIDE;
203 :
204 : virtual SfxItemState GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const SAL_OVERRIDE;
205 : virtual SfxItemState GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const SAL_OVERRIDE;
206 :
207 : virtual void QuickInsertText( const OUString& rText, const ESelection& rSel ) SAL_OVERRIDE;
208 : virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) SAL_OVERRIDE;
209 : virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) SAL_OVERRIDE;
210 : virtual void QuickInsertLineBreak( const ESelection& rSel ) SAL_OVERRIDE;
211 :
212 : virtual SfxItemPool* GetPool() const SAL_OVERRIDE;
213 :
214 : virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor ) SAL_OVERRIDE;
215 : virtual void FieldClicked(const SvxFieldItem&, sal_Int32, sal_Int32) SAL_OVERRIDE;
216 : virtual bool IsValid() const SAL_OVERRIDE;
217 :
218 : virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const SAL_OVERRIDE;
219 : virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const SAL_OVERRIDE;
220 : virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const SAL_OVERRIDE;
221 : virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const SAL_OVERRIDE;
222 : virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const SAL_OVERRIDE;
223 : virtual Rectangle GetParaBounds( sal_Int32 nPara ) const SAL_OVERRIDE;
224 : virtual MapMode GetMapMode() const SAL_OVERRIDE;
225 : virtual OutputDevice* GetRefDevice() const SAL_OVERRIDE;
226 : virtual bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const SAL_OVERRIDE;
227 : virtual bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const SAL_OVERRIDE;
228 : virtual bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell = false ) const SAL_OVERRIDE;
229 : virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const SAL_OVERRIDE;
230 : virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const SAL_OVERRIDE;
231 : virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const SAL_OVERRIDE;
232 : virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nLine ) const SAL_OVERRIDE;
233 : virtual bool Delete( const ESelection& ) SAL_OVERRIDE;
234 : virtual bool InsertText( const OUString&, const ESelection& ) SAL_OVERRIDE;
235 : virtual bool QuickFormatDoc( bool bFull = false ) SAL_OVERRIDE;
236 :
237 : virtual sal_Int16 GetDepth( sal_Int32 nPara ) const SAL_OVERRIDE;
238 : virtual bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) SAL_OVERRIDE;
239 :
240 : virtual const SfxItemSet* GetEmptyItemSetPtr() SAL_OVERRIDE;
241 : // implementation functions for XParagraphAppend and XTextPortionAppend
242 : virtual void AppendParagraph() SAL_OVERRIDE;
243 : virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) SAL_OVERRIDE;
244 :
245 : virtual void CopyText(const SvxTextForwarder& rSource) SAL_OVERRIDE;
246 : };
247 :
248 :
249 : class SmEditViewForwarder : /* analog to SvxEditEngineViewForwarder */
250 : public SvxEditViewForwarder
251 : {
252 : SmEditAccessible& rEditAcc;
253 :
254 : SmEditViewForwarder( const SmEditViewForwarder & ) SAL_DELETED_FUNCTION;
255 : SmEditViewForwarder & operator = ( const SmEditViewForwarder & ) SAL_DELETED_FUNCTION;
256 :
257 : public:
258 : explicit SmEditViewForwarder( SmEditAccessible& rAcc );
259 : virtual ~SmEditViewForwarder();
260 :
261 : virtual bool IsValid() const SAL_OVERRIDE;
262 :
263 : virtual Rectangle GetVisArea() const SAL_OVERRIDE;
264 : virtual Point LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const SAL_OVERRIDE;
265 : virtual Point PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const SAL_OVERRIDE;
266 :
267 : virtual bool GetSelection( ESelection& rSelection ) const SAL_OVERRIDE;
268 : virtual bool SetSelection( const ESelection& rSelection ) SAL_OVERRIDE;
269 : virtual bool Copy() SAL_OVERRIDE;
270 : virtual bool Cut() SAL_OVERRIDE;
271 : virtual bool Paste() SAL_OVERRIDE;
272 : };
273 :
274 :
275 : class SmEditSource :
276 : public SvxEditSource
277 : {
278 : SfxBroadcaster aBroadCaster;
279 : SmViewForwarder aViewFwd;
280 : SmTextForwarder aTextFwd;
281 : SmEditViewForwarder aEditViewFwd;
282 :
283 : SmEditAccessible& rEditAcc;
284 :
285 : SmEditSource( const SmEditSource &rSrc );
286 : SmEditSource & operator = ( const SmEditSource & ) SAL_DELETED_FUNCTION;
287 :
288 : public:
289 : SmEditSource( SmEditWindow *pWin, SmEditAccessible &rAcc );
290 : virtual ~SmEditSource();
291 :
292 : virtual SvxEditSource* Clone() const SAL_OVERRIDE;
293 : virtual SvxTextForwarder* GetTextForwarder() SAL_OVERRIDE;
294 : virtual SvxViewForwarder* GetViewForwarder() SAL_OVERRIDE;
295 : virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) SAL_OVERRIDE;
296 : virtual void UpdateData() SAL_OVERRIDE;
297 : virtual SfxBroadcaster& GetBroadcaster() const SAL_OVERRIDE;
298 : };
299 :
300 :
301 :
302 :
303 : typedef
304 : cppu::WeakImplHelper
305 : <
306 : com::sun::star::lang::XServiceInfo,
307 : com::sun::star::accessibility::XAccessible,
308 : com::sun::star::accessibility::XAccessibleComponent,
309 : com::sun::star::accessibility::XAccessibleContext,
310 : com::sun::star::accessibility::XAccessibleEventBroadcaster
311 : >
312 : SmEditAccessibleBaseClass;
313 :
314 : class SmEditAccessible :
315 : public SmEditAccessibleBaseClass
316 : {
317 : OUString aAccName;
318 : ::accessibility::AccessibleTextHelper *pTextHelper;
319 : VclPtr<SmEditWindow> pWin;
320 :
321 : SmEditAccessible( const SmEditAccessible & ) SAL_DELETED_FUNCTION;
322 : SmEditAccessible & operator = ( const SmEditAccessible & ) SAL_DELETED_FUNCTION;
323 :
324 : public:
325 : explicit SmEditAccessible( SmEditWindow *pEditWin );
326 : virtual ~SmEditAccessible();
327 :
328 0 : ::accessibility::AccessibleTextHelper * GetTextHelper() { return pTextHelper; }
329 :
330 : void Init();
331 : SmEditWindow * GetWin() { return pWin; }
332 : void ClearWin(); // to be called when view is destroyed
333 :
334 : //! access EditEngine and EditView via the functions in the respective window
335 : //! pointers may be 0 (e.g. during reload)
336 213 : EditEngine * GetEditEngine() { return pWin ? pWin->GetEditEngine() : 0; }
337 60 : EditView * GetEditView() { return pWin ? pWin->GetEditView() : 0; }
338 :
339 : // XAccessible
340 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
341 :
342 : // XAccessibleComponent
343 : virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
344 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
345 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
346 : virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
347 : virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
348 : virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
349 : virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
350 : virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
351 : virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
352 :
353 : // XAccessibleContext
354 : virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
355 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
356 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
357 : virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
358 : virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
359 : virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
360 : virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
361 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
362 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
363 : virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
364 :
365 : // XAccessibleEventBroadcaster
366 : virtual void SAL_CALL addAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
367 : virtual void SAL_CALL removeAccessibleEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
368 :
369 : // XServiceInfo
370 : virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
371 : virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
372 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
373 : };
374 :
375 :
376 :
377 : #endif
378 :
379 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|