1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SVX_ACCESSIBLE_EDITABLE_TEXT_PARA_HXX 25 #define _SVX_ACCESSIBLE_EDITABLE_TEXT_PARA_HXX 26 27 #include <tools/gen.hxx> 28 #include <tools/string.hxx> 29 #include <cppuhelper/weakref.hxx> 30 #include <cppuhelper/compbase9.hxx> 31 #include <cppuhelper/typeprovider.hxx> 32 #include <cppuhelper/interfacecontainer.hxx> 33 34 #include <com/sun/star/uno/Reference.hxx> 35 #include <com/sun/star/lang/XServiceInfo.hpp> 36 #include <com/sun/star/accessibility/XAccessible.hpp> 37 #include <com/sun/star/accessibility/XAccessibleContext.hpp> 38 #include <com/sun/star/accessibility/XAccessibleComponent.hpp> 39 #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> 40 #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp> 41 #include <com/sun/star/accessibility/XAccessibleHypertext.hpp> 42 #include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp> 43 44 #include <comphelper/accessibletexthelper.hxx> 45 #include <comphelper/broadcasthelper.hxx> 46 #include "editeng/AccessibleParaManager.hxx" 47 #include "editeng/AccessibleImageBullet.hxx" 48 #include "editeng/unoedprx.hxx" 49 #include "editeng/editengdllapi.h" 50 51 namespace accessibility 52 { 53 typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::accessibility::XAccessible, 54 ::com::sun::star::accessibility::XAccessibleContext, 55 ::com::sun::star::accessibility::XAccessibleComponent, 56 ::com::sun::star::accessibility::XAccessibleEditableText, 57 ::com::sun::star::accessibility::XAccessibleEventBroadcaster, 58 ::com::sun::star::accessibility::XAccessibleTextAttributes, 59 ::com::sun::star::accessibility::XAccessibleHypertext, 60 ::com::sun::star::accessibility::XAccessibleMultiLineText, 61 ::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase; 62 63 /** This class implements the actual text paragraphs for the EditEngine/Outliner UAA 64 */ 65 class EDITENG_DLLPUBLIC AccessibleEditableTextPara : public ::comphelper::OBaseMutex, public AccessibleTextParaInterfaceBase, public ::comphelper::OCommonAccessibleText 66 { 67 68 protected: 69 // override OCommonAccessibleText methods 70 virtual ::rtl::OUString implGetText(); 71 virtual ::com::sun::star::lang::Locale implGetLocale(); 72 virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ); 73 virtual void implGetParagraphBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex ); 74 virtual void implGetLineBoundary( ::com::sun::star::i18n::Boundary& rBoundary, sal_Int32 nIndex ); 75 76 public: 77 /// Create accessible object for given parent 78 // --> OD 2006-01-11 #i27138# 79 // - add parameter <_pParaManager> (default value NULL) 80 // This has to be the the instance of <AccessibleParaManager>, which 81 // created and manages this accessible paragraph. 82 AccessibleEditableTextPara ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rParent, 83 const AccessibleParaManager* _pParaManager = NULL ); 84 // <-- 85 86 virtual ~AccessibleEditableTextPara (); 87 88 // XInterface 89 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface (const ::com::sun::star::uno::Type & rType) throw (::com::sun::star::uno::RuntimeException); 90 91 // XComponent 92 93 using WeakComponentImplHelperBase::addEventListener; 94 using WeakComponentImplHelperBase::removeEventListener; 95 96 // XAccessible 97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); 98 99 // XAccessibleContext 100 virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); 101 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); 102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent() throw (::com::sun::star::uno::RuntimeException); 103 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException); 104 virtual sal_Int16 SAL_CALL getAccessibleRole() throw (::com::sun::star::uno::RuntimeException); 105 /// Maximal length of text returned by getAccessibleDescription() 106 enum { MaxDescriptionLen = 40 }; 107 virtual ::rtl::OUString SAL_CALL getAccessibleDescription() throw (::com::sun::star::uno::RuntimeException); 108 virtual ::rtl::OUString SAL_CALL getAccessibleName() throw (::com::sun::star::uno::RuntimeException); 109 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() throw (::com::sun::star::uno::RuntimeException); 110 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); 111 virtual ::com::sun::star::lang::Locale SAL_CALL getLocale() throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); 112 113 // XAccessibleEventBroadcaster 114 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 115 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 116 117 // XAccessibleComponent 118 virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 119 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); 120 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException); 121 virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException); 122 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); 123 virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException); 124 virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); 125 virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); 126 virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); 127 128 // XAccessibleText (this comes implicitely inherited by XAccessibleEditableText AND by XAccessibleMultiLineText) 129 virtual sal_Int32 SAL_CALL getCaretPosition() throw (::com::sun::star::uno::RuntimeException); 130 virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 131 virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 132 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); 133 virtual ::com::sun::star::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 134 virtual sal_Int32 SAL_CALL getCharacterCount() throw (::com::sun::star::uno::RuntimeException); 135 virtual sal_Int32 SAL_CALL getIndexAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); 136 virtual ::rtl::OUString SAL_CALL getSelectedText() throw (::com::sun::star::uno::RuntimeException); 137 virtual sal_Int32 SAL_CALL getSelectionStart() throw (::com::sun::star::uno::RuntimeException); 138 virtual sal_Int32 SAL_CALL getSelectionEnd() throw (::com::sun::star::uno::RuntimeException); 139 virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 140 virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException); 141 virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 142 /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) 143 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); 144 /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) 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); 146 /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) 147 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); 148 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 149 150 // XAccessibleEditableText 151 virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 152 virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 153 virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 154 virtual sal_Bool SAL_CALL insertText( const ::rtl::OUString& sText, sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 155 virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const ::rtl::OUString& sReplacement ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 156 virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aAttributeSet ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 157 virtual sal_Bool SAL_CALL setText( const ::rtl::OUString& sText ) throw (::com::sun::star::uno::RuntimeException); 158 159 // XAccessibleTextAttributes 160 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException); 161 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 162 163 // XAccessibleHypertext 164 virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException); 165 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 166 virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 167 168 // XAccessibleMultiLineText 169 virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 170 virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); 171 virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException); 172 virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) throw (::com::sun::star::uno::RuntimeException); 173 174 // XServiceInfo 175 virtual ::rtl::OUString SAL_CALL getImplementationName (void) throw (::com::sun::star::uno::RuntimeException); 176 virtual sal_Bool SAL_CALL supportsService (const ::rtl::OUString& sServiceName) throw (::com::sun::star::uno::RuntimeException); 177 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames (void) throw (::com::sun::star::uno::RuntimeException); 178 179 // XServiceName 180 virtual ::rtl::OUString SAL_CALL getServiceName (void) throw (::com::sun::star::uno::RuntimeException); 181 182 /** Set the current index in the accessibility parent 183 184 @attention This method does not lock the SolarMutex, 185 leaving that to the calling code. This is because only 186 there potential deadlock situations can be resolved. Thus, 187 make sure SolarMutex is locked when calling this. 188 */ 189 void SetIndexInParent( sal_Int32 nIndex ); 190 191 /** Get the current index in the accessibility parent 192 193 @attention This method does not lock the SolarMutex, 194 leaving that to the calling code. This is because only 195 there potential deadlock situations can be resolved. Thus, 196 make sure SolarMutex is locked when calling this. 197 */ 198 sal_Int32 GetIndexInParent() const; 199 200 /** Set the current paragraph number 201 202 @attention This method does not lock the SolarMutex, 203 leaving that to the calling code. This is because only 204 there potential deadlock situations can be resolved. Thus, 205 make sure SolarMutex is locked when calling this. 206 */ 207 void SetParagraphIndex( sal_Int32 nIndex ); 208 209 /** Query the current paragraph number (0 - nParas-1) 210 211 @attention This method does not lock the SolarMutex, 212 leaving that to the calling code. This is because only 213 there potential deadlock situations can be resolved. Thus, 214 make sure SolarMutex is locked when calling this. 215 */ 216 sal_Int32 GetParagraphIndex() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 217 218 /** Set the edit engine offset 219 220 @attention This method does not lock the SolarMutex, 221 leaving that to the calling code. This is because only 222 there potential deadlock situations can be resolved. Thus, 223 make sure SolarMutex is locked when calling this. 224 */ 225 void SetEEOffset( const Point& rOffset ); 226 227 /** Set the EditEngine offset 228 229 @attention This method does not lock the SolarMutex, 230 leaving that to the calling code. This is because only 231 there potential deadlock situations can be resolved. Thus, 232 make sure SolarMutex is locked when calling this. 233 */ 234 void SetEditSource( SvxEditSourceAdapter* pEditSource ); 235 236 /** Dispose this object 237 238 Notifies and deregisters the listeners, drops all references. 239 */ 240 void Dispose(); 241 242 /// Calls all Listener objects to tell them the change. Don't hold locks when calling this! 243 virtual void FireEvent(const sal_Int16 nEventId, const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(), const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const; 244 245 /// Queries the given state on the internal state set 246 bool HasState( const sal_Int16 nStateId ); 247 /// Sets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this! 248 void SetState( const sal_Int16 nStateId ); 249 /// Unsets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this! 250 void UnSetState( const sal_Int16 nStateId ); 251 252 static Rectangle LogicToPixel( const Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder& rForwarder ); 253 254 SvxEditSourceAdapter& GetEditSource() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 255 256 /** Query the SvxTextForwarder for EditEngine access. 257 258 @attention This method does not lock the SolarMutex, 259 leaving that to the calling code. This is because only 260 there potential deadlock situations can be resolved. Thus, 261 make sure SolarMutex is locked when calling this. 262 */ 263 SvxAccessibleTextAdapter& GetTextForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 264 265 /** Query the SvxViewForwarder for EditEngine access. 266 267 @attention This method does not lock the SolarMutex, 268 leaving that to the calling code. This is because only 269 there potential deadlock situations can be resolved. Thus, 270 make sure SolarMutex is locked when calling this. 271 */ 272 SvxViewForwarder& GetViewForwarder() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 273 274 /** Query whether a GetEditViewForwarder( sal_False ) will return a forwarder 275 276 @attention This method does not lock the SolarMutex, 277 leaving that to the calling code. This is because only 278 there potential deadlock situations can be resolved. Thus, 279 make sure SolarMutex is locked when calling this. 280 */ 281 sal_Bool HaveEditView() const; 282 283 /** Query the SvxEditViewForwarder for EditEngine access. 284 285 @attention This method does not lock the SolarMutex, 286 leaving that to the calling code. This is because only 287 there potential deadlock situations can be resolved. Thus, 288 make sure SolarMutex is locked when calling this. 289 */ 290 SvxAccessibleTextEditViewAdapter& GetEditViewForwarder( sal_Bool bCreate = sal_False ) const SAL_THROW((::com::sun::star::uno::RuntimeException)); 291 292 /** Send a TEXT_CHANGED event for this paragraph 293 294 This method internally caters for calculating text 295 differences, and sends the appropriate Anys in the 296 Accessibility::TEXT_CHANGED event 297 */ 298 void TextChanged(); 299 300 private: 301 302 // declared, but not defined 303 AccessibleEditableTextPara( const AccessibleEditableTextPara& ); 304 AccessibleEditableTextPara& operator= ( const AccessibleEditableTextPara& ); 305 306 /** Calculate character range of similar attributes 307 308 @param nStartIndex 309 Therein, the start of the character range with the same attributes is returned 310 311 @param nEndIndex 312 Therein, the end (exclusively) of the character range with the same attributes is returned 313 314 @param nIndex 315 The character index at where to look for similar character attributes 316 317 @return sal_False, if the method was not able to determine the range 318 */ 319 sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nIndex ); 320 321 // syntactic sugar for FireEvent 322 void GotPropertyEvent( const ::com::sun::star::uno::Any& rNewValue, const sal_Int16 nEventId ) const; 323 void LostPropertyEvent( const ::com::sun::star::uno::Any& rOldValue, const sal_Int16 nEventId ) const; 324 325 /** Query the visibility state 326 327 @attention This method does not lock the SolarMutex, 328 leaving that to the calling code. This is because only 329 there potential deadlock situations can be resolved. Thus, 330 make sure SolarMutex is locked when calling this. 331 332 @return the visibility state. Per definition, a defunc object is no longer visible 333 */ 334 sal_Bool IsVisible() const; 335 336 int getNotifierClientId() const; 337 338 // retrieve text interface for given paragraph index 339 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleText > GetParaInterface( sal_Int32 nIndex ); 340 341 /// Do we have children? This is the case for image bullets 342 sal_Bool HaveChildren(); 343 344 /// Is the underlying object in edit mode 345 sal_Bool IsActive() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 346 347 const Point& GetEEOffset() const; 348 349 // Get text from forwarder 350 String GetText( sal_Int32 nIndex ) SAL_THROW((::com::sun::star::uno::RuntimeException)); 351 String GetTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) SAL_THROW((::com::sun::star::uno::RuntimeException)); 352 sal_uInt16 GetTextLen() const SAL_THROW((::com::sun::star::uno::RuntimeException)); 353 354 /** Get the current selection of this paragraph 355 356 @return sal_False, if nothing in this paragraph is selected 357 */ 358 sal_Bool GetSelection( sal_uInt16& nStartPos, sal_uInt16& nEndPos ) SAL_THROW((::com::sun::star::uno::RuntimeException)); 359 360 /** create selection from Accessible selection. 361 362 */ 363 ESelection MakeSelection( sal_Int32 nStartEEIndex, sal_Int32 nEndEEIndex ); 364 ESelection MakeSelection( sal_Int32 nEEIndex ); 365 ESelection MakeCursor( sal_Int32 nEEIndex ); 366 367 // check whether index value is within permitted range 368 369 /// Check whether 0<=nIndex<=n-1 370 void CheckIndex( sal_Int32 nIndex ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)); 371 /// Check whether 0<=nIndex<=n 372 void CheckPosition( sal_Int32 nIndex ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)); 373 /// Check whether 0<=nStart<=n and 0<=nEnd<=n 374 void CheckRange( sal_Int32 nStart, sal_Int32 nEnd ) SAL_THROW((::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)); 375 376 void _correctValues( const sal_Int32 nIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rValues ); 377 sal_Int32 SkipField(sal_Int32 nIndex, sal_Bool bForward); 378 // get overlapped field, extend return string. Only extend forward for now 379 sal_Bool ExtendByField( ::com::sun::star::accessibility::TextSegment& Segment ); 380 String GetFieldTypeNameAtIndex(sal_Int32 nIndex); 381 // the paragraph index in the edit engine (guarded by solar mutex) 382 sal_Int32 mnParagraphIndex; 383 384 // our current index in the parent (guarded by solar mutex) 385 sal_Int32 mnIndexInParent; 386 387 // the current edit source (guarded by solar mutex) 388 SvxEditSourceAdapter* mpEditSource; 389 390 // the possible child (for image bullets, guarded by solar mutex) 391 typedef WeakCppRef < ::com::sun::star::accessibility::XAccessible, AccessibleImageBullet > WeakBullet; 392 WeakBullet maImageBullet; 393 394 // the last string used for an Accessibility::TEXT_CHANGED event (guarded by solar mutex) 395 ::rtl::OUString maLastTextString; 396 397 // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex) 398 Point maEEOffset; 399 400 // the current state set (updated from SetState/UnSetState and guarded by solar mutex) 401 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; 402 403 /// The shape we're the accessible for (unguarded) 404 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxParent; 405 406 /// Our listeners (guarded by maMutex) 407 int mnNotifierClientId; 408 public: SetParagraphBackColorAccessible(const::com::sun::star::uno::Reference<::com::sun::star::accessibility::XAccessible> & ref)409 void SetParagraphBackColorAccessible(const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > & ref) 410 { m_xAccInfo = ref ;} 411 private: 412 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAccInfo; 413 //virtual sal_Bool IsShapeParaFocusable( ); 414 415 // --> OD 2006-01-11 #i27138# 416 // the paragraph manager, which created this instance - is NULL, if 417 // instance isn't created by AccessibleParaManager. 418 // Needed for method <getAccessibleRelationSet()> to retrieve predecessor 419 // paragraph and the successor paragraph. 420 const AccessibleParaManager* mpParaManager; 421 }; 422 423 } // end of namespace accessibility 424 425 #endif 426 427