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