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 // ============================================================================ 25 26 #ifndef _SC_ACCESSIBLECSVCONTROL_HXX 27 #define _SC_ACCESSIBLECSVCONTROL_HXX 28 29 #include <com/sun/star/accessibility/XAccessibleText.hpp> 30 #include <com/sun/star/accessibility/XAccessibleTable.hpp> 31 #include <com/sun/star/accessibility/XAccessibleSelection.hpp> 32 #include <tools/gen.hxx> 33 #include <tools/string.hxx> 34 #include <rtl/ustrbuf.hxx> 35 #include <cppuhelper/implbase1.hxx> 36 #include <cppuhelper/implbase2.hxx> 37 #include <editeng/AccessibleStaticTextBase.hxx> 38 #include <comphelper/uno3.hxx> 39 #include "AccessibleContextBase.hxx" 40 41 42 // ============================================================================ 43 44 class ScCsvControl; 45 namespace utl { class AccessibleStateSetHelper; } 46 47 /** Accessible base class used for CSV controls. */ 48 class ScAccessibleCsvControl : public ScAccessibleContextBase 49 { 50 protected: 51 typedef ::com::sun::star::uno::Reference< 52 ::com::sun::star::accessibility::XAccessible > XAccessibleRef; 53 typedef ::com::sun::star::uno::Reference< 54 ::com::sun::star::accessibility::XAccessibleRelationSet > XAccessibleRelationSetRef; 55 typedef ::com::sun::star::uno::Reference< 56 ::com::sun::star::accessibility::XAccessibleStateSet > XAccessibleStateSetRef; 57 58 typedef ::com::sun::star::awt::Point AwtPoint; 59 typedef ::com::sun::star::awt::Size AwtSize; 60 typedef ::com::sun::star::awt::Rectangle AwtRectangle; 61 62 private: 63 ScCsvControl* mpControl; /// Pointer to the VCL control. 64 65 public: 66 explicit ScAccessibleCsvControl( 67 const XAccessibleRef& rxParent, 68 ScCsvControl& rControl, 69 sal_uInt16 nRole ); 70 virtual ~ScAccessibleCsvControl(); 71 72 using ScAccessibleContextBase::disposing; 73 virtual void SAL_CALL disposing(); 74 75 // XAccessibleComponent --------------------------------------------------- 76 77 /** Returns the child at the specified point (cell returns NULL). */ 78 virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint ); 79 80 /** Returns true, if the control is visible. */ 81 virtual sal_Bool SAL_CALL isVisible(); 82 83 /** Sets the focus to this control. */ 84 virtual void SAL_CALL grabFocus(); 85 86 // events ----------------------------------------------------------------- 87 public: 88 /** Sends a GetFocus or LoseFocus event to all listeners. */ 89 virtual void SendFocusEvent( bool bFocused ); 90 /** Sends a caret changed event to all listeners. */ 91 virtual void SendCaretEvent(); 92 /** Sends a visible area changed event to all listeners. */ 93 virtual void SendVisibleEvent(); 94 /** Sends a selection changed event to all listeners. */ 95 virtual void SendSelectionEvent(); 96 /** Sends a table model changed event for changed cell contents to all listeners. */ 97 virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows ); 98 /** Sends a table model changed event for an inserted column to all listeners. */ 99 virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); 100 /** Sends a table model changed event for a removed column to all listeners. */ 101 virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); 102 103 // helpers ---------------------------------------------------------------- 104 protected: 105 /** Returns this object's current bounding box relative to the desktop. */ 106 virtual Rectangle GetBoundingBoxOnScreen() const; 107 /** Returns this object's current bounding box relative to the parent object. */ 108 virtual Rectangle GetBoundingBox() const; 109 110 /** Creates a new UUID in rSeq, if it is empty. Locks mutex internally. */ 111 void getUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq ); 112 113 /** Returns whether the object is alive. Must be called with locked mutex. */ implIsAlive() const114 inline bool implIsAlive() const { return !rBHelper.bDisposed && !rBHelper.bInDispose && mpControl; } 115 /** Throws an exception, if the object is disposed/disposing or any pointer 116 is missing. Should be used with locked mutex! */ 117 void ensureAlive() const; 118 119 /** Returns the VCL control. Assumes a living object. */ 120 ScCsvControl& implGetControl() const; 121 122 /** Returns the first child of rxParentObj, which has the role nRole. */ 123 XAccessibleRef implGetChildByRole( const XAccessibleRef& rxParentObj, sal_uInt16 nRole ); 124 /** Creates a StateSetHelper and fills it with DEFUNC, OPAQUE, ENABLED, SHOWING and VISIBLE. */ 125 ::utl::AccessibleStateSetHelper* implCreateStateSet(); 126 127 /** Disposes the object. This is a helper called from destructors only. */ 128 void implDispose(); 129 130 /** Converts the control-relative position to an absolute screen position. */ 131 Point implGetAbsPos( const Point& rPos ) const; 132 }; 133 134 135 // ============================================================================ 136 137 class ScCsvRuler; 138 139 typedef ::cppu::ImplHelper1< 140 ::com::sun::star::accessibility::XAccessibleText > 141 ScAccessibleCsvRulerImpl; 142 143 /** Accessible class representing the CSV ruler control. */ 144 class ScAccessibleCsvRuler : public ScAccessibleCsvControl, public ScAccessibleCsvRulerImpl 145 { 146 protected: 147 typedef ::com::sun::star::uno::Sequence< 148 ::com::sun::star::beans::PropertyValue > PropertyValueSeq; 149 150 private: 151 ::rtl::OUStringBuffer maBuffer; /// Contains the text representation of the ruler. 152 153 public: 154 explicit ScAccessibleCsvRuler( ScCsvRuler& rRuler ); 155 virtual ~ScAccessibleCsvRuler(); 156 157 // XAccessibleComponent ----------------------------------------------------- 158 159 virtual sal_Int32 SAL_CALL getForeground( ); 160 161 virtual sal_Int32 SAL_CALL getBackground( ); 162 163 // XAccessibleContext ----------------------------------------------------- 164 165 /** Returns the child count (the ruler does not have children). */ 166 virtual sal_Int32 SAL_CALL getAccessibleChildCount(); 167 168 /** Throws an exception (the ruler does not have childern). */ 169 virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ); 170 171 /** Returns the relation to the grid control. */ 172 virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet(); 173 174 /** Returns the current set of states. */ 175 virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet(); 176 177 // XAccessibleText -------------------------------------------------------- 178 179 /** Return the position of the caret. */ 180 virtual sal_Int32 SAL_CALL getCaretPosition(); 181 182 /** Sets the position of the caret. */ 183 virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ); 184 185 /** Returns the specified character. */ 186 virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ); 187 188 /** Returns the attributes of the specified character. */ 189 virtual PropertyValueSeq SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ); 190 191 /** Returns the screen coordinates of the specified character. */ 192 virtual AwtRectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ); 193 194 /** Returns the count of characters. */ 195 virtual sal_Int32 SAL_CALL getCharacterCount(); 196 197 /** Returns the character index at the specified coordinate (object's coordinate system). */ 198 virtual sal_Int32 SAL_CALL getIndexAtPoint( const AwtPoint& rPoint ); 199 200 /** Returns the selected text (ruler returns empty string). */ 201 virtual ::rtl::OUString SAL_CALL getSelectedText(); 202 203 /** Returns the start index of the selection (ruler returns -1). */ 204 virtual sal_Int32 SAL_CALL getSelectionStart(); 205 206 /** Returns the end index of the selection (ruler returns -1). */ 207 virtual sal_Int32 SAL_CALL getSelectionEnd(); 208 209 /** Selects a part of the text (ruler does nothing). */ 210 virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ); 211 212 /** Returns the entire text. */ 213 virtual ::rtl::OUString SAL_CALL getText(); 214 215 /** Returns the specified range [Start,End) of the text. */ 216 virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ); 217 218 /** Returns the specified text portion. */ 219 virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ); 220 virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ); 221 virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ); 222 223 /** Copies the specified text range into the clipboard (ruler does nothing). */ 224 virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ); 225 226 // XInterface ------------------------------------------------------------- 227 228 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ); 229 230 virtual void SAL_CALL acquire() throw(); 231 232 virtual void SAL_CALL release() throw(); 233 234 // XServiceInfo ----------------------------------------------------------- 235 236 /** Returns an identifier for the implementation of this object. */ 237 virtual ::rtl::OUString SAL_CALL getImplementationName(); 238 239 // XTypeProvider ---------------------------------------------------------- 240 241 /** Returns a sequence with all supported interface types. */ 242 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(); 243 244 /** Returns an implementation ID. */ 245 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(); 246 247 // events ----------------------------------------------------------------- 248 public: 249 /** Sends a caret changed event to all listeners. */ 250 virtual void SendCaretEvent(); 251 252 // helpers ---------------------------------------------------------------- 253 private: 254 /** Returns this object's name. */ 255 virtual ::rtl::OUString SAL_CALL createAccessibleName(); 256 /** Returns this object's description. */ 257 virtual ::rtl::OUString SAL_CALL createAccessibleDescription(); 258 259 /** Throws an exception, if the specified character position is invalid (outside 0..len-1). */ 260 void ensureValidIndex( sal_Int32 nIndex ) const; 261 /** Throws an exception, if the specified character position is invalid (outside 0..len). */ 262 void ensureValidIndexWithEnd( sal_Int32 nIndex ) const; 263 /** Throws an exception, if the specified character range [Start,End) is invalid. 264 @descr If Start>End, swaps Start and End before checking. */ 265 void ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& rnEndIndex ) const; 266 267 /** Returns the VCL ruler control. Assumes a living object. */ 268 ScCsvRuler& implGetRuler() const; 269 270 /** Builds the entire string buffer. */ 271 void constructStringBuffer(); 272 /** Returns the character count of the text. */ 273 sal_Int32 implGetTextLength() const; 274 275 /** Returns true, if the character at the specified index has a split. */ 276 bool implHasSplit( sal_Int32 nApiPos ); 277 278 /** Returns the first character index with equal formatting as at nApiPos. */ 279 sal_Int32 implGetFirstEqualFormatted( sal_Int32 nApiPos ); 280 /** Returns the last character index with equal formatting as at nApiPos. */ 281 sal_Int32 implGetLastEqualFormatted( sal_Int32 nApiPos ); 282 }; 283 284 285 // ============================================================================ 286 287 class ScCsvGrid; 288 289 typedef ::cppu::ImplHelper2< 290 ::com::sun::star::accessibility::XAccessibleTable, 291 ::com::sun::star::accessibility::XAccessibleSelection > 292 ScAccessibleCsvGridImpl; 293 294 /** Accessible class representing the CSV grid control. */ 295 class ScAccessibleCsvGrid : public ScAccessibleCsvControl, public ScAccessibleCsvGridImpl 296 { 297 protected: 298 typedef ::com::sun::star::uno::Reference< 299 ::com::sun::star::accessibility::XAccessibleTable > XAccessibleTableRef; 300 301 public: 302 explicit ScAccessibleCsvGrid( ScCsvGrid& rGrid ); 303 virtual ~ScAccessibleCsvGrid(); 304 305 // XAccessibleComponent --------------------------------------------------- 306 307 /** Returns the cell at the specified point. */ 308 virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint ); 309 310 virtual sal_Int32 SAL_CALL getForeground( ); 311 312 virtual sal_Int32 SAL_CALL getBackground( ); 313 314 // XAccessibleContext ----------------------------------------------------- 315 316 /** Returns the child count (count of cells in the table). */ 317 virtual sal_Int32 SAL_CALL getAccessibleChildCount(); 318 319 /** Returns the specified child cell. */ 320 virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ); 321 322 /** Returns the relation to the ruler control. */ 323 virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet(); 324 325 /** Returns the current set of states. */ 326 virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet(); 327 328 // XAccessibleTable ------------------------------------------------------- 329 330 /** Returns the number of rows in the table. */ 331 virtual sal_Int32 SAL_CALL getAccessibleRowCount(); 332 333 /** Returns the number of columns in the table. */ 334 virtual sal_Int32 SAL_CALL getAccessibleColumnCount(); 335 336 /** Returns the description of the specified row in the table. */ 337 virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ); 338 339 /** Returns the description text of the specified column in the table. */ 340 virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ); 341 342 /** Returns the number of rows occupied at a specified row and column. 343 @descr Returns always 1 (Merged cells not supported). */ 344 virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ); 345 346 /** Returns the number of rows occupied at a specified row and column. 347 @descr Returns always 1 (Merged cells not supported). */ 348 virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ); 349 350 /** Returns the row headers as an AccessibleTable. */ 351 virtual XAccessibleTableRef SAL_CALL getAccessibleRowHeaders(); 352 353 /** Returns the column headers as an AccessibleTable. */ 354 virtual XAccessibleTableRef SAL_CALL getAccessibleColumnHeaders(); 355 356 /** Returns the selected rows as a sequence. */ 357 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows(); 358 359 /** Returns the selected columns as a sequence. */ 360 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns(); 361 362 /** Returns true, if the specified row is selected. */ 363 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ); 364 365 /** Returns true, if the specified column is selected. */ 366 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ); 367 368 /** Returns the accessible cell object at the specified position. */ 369 virtual XAccessibleRef SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ); 370 371 /** Returns the caption object of the table. */ 372 virtual XAccessibleRef SAL_CALL getAccessibleCaption(); 373 374 /** Returns the summary description object of the table. */ 375 virtual XAccessibleRef SAL_CALL getAccessibleSummary(); 376 377 /** Returns true, if the cell at a specified position is selected. */ 378 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ); 379 380 /** Returns the child index of the cell at the specified position. */ 381 virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ); 382 383 /** Returns the row index of the specified child. */ 384 virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ); 385 386 /** Returns the column index of the specified child. */ 387 virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ); 388 389 // XAccessibleSelection --------------------------------------------------- 390 391 /** Selects the specified child (selects the entire column or the entire table). */ 392 virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ); 393 394 /** Returns true, if the specified child is selected. */ 395 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ); 396 397 /** Deselects all cells. */ 398 virtual void SAL_CALL clearAccessibleSelection(); 399 400 /** Selects all cells. */ 401 virtual void SAL_CALL selectAllAccessibleChildren(); 402 403 /** Returns the count of selected children. */ 404 virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(); 405 406 /** Returns the child with the specified index in all selected children. */ 407 virtual XAccessibleRef SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ); 408 409 /** Deselects the child with the specified index in all selected children. */ 410 virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ); 411 412 // XInterface ------------------------------------------------------------- 413 414 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ); 415 416 virtual void SAL_CALL acquire() throw(); 417 418 virtual void SAL_CALL release() throw(); 419 420 // XServiceInfo ----------------------------------------------------------- 421 422 /** Returns an identifier for the implementation of this object. */ 423 virtual ::rtl::OUString SAL_CALL getImplementationName(); 424 425 // XTypeProvider ---------------------------------------------------------- 426 427 /** Returns a sequence with all supported interface types. */ 428 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(); 429 430 /** Returns an implementation ID. */ 431 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(); 432 433 // events ----------------------------------------------------------------- 434 public: 435 /** Sends a GetFocus or LoseFocus event to all listeners. */ 436 virtual void SendFocusEvent( bool bFocused ); 437 /** Sends a table model changed event for changed cell contents to all listeners. */ 438 virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows ); 439 /** Sends a table model changed event for an inserted column to all listeners. */ 440 virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); 441 /** Sends a table model changed event for a removed column to all listeners. */ 442 virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); 443 444 // helpers ---------------------------------------------------------------- 445 private: 446 /** Returns this object's name. */ 447 virtual ::rtl::OUString SAL_CALL createAccessibleName(); 448 /** Returns this object's description. */ 449 virtual ::rtl::OUString SAL_CALL createAccessibleDescription(); 450 451 /** Throws an exception, if nIndex is not a valid child index. */ 452 void ensureValidIndex( sal_Int32 nIndex ) const; 453 /** Throws an exception, if the specified position is invalid. */ 454 void ensureValidPosition( sal_Int32 nRow, sal_Int32 nColumn ) const; 455 456 /** Returns the VCL grid control. Assumes a living object. */ 457 ScCsvGrid& implGetGrid() const; 458 459 /** Returns true, if the specified column (including header) is selected. */ 460 bool implIsColumnSelected( sal_Int32 nColumn ) const; 461 /** Selects the specified column (including header). */ 462 void implSelectColumn( sal_Int32 nColumn, bool bSelect ); 463 464 /** Returns the count of visible rows in the table (including header). */ 465 sal_Int32 implGetRowCount() const; 466 /** Returns the total column count in the table (including header). */ 467 sal_Int32 implGetColumnCount() const; 468 /** Returns the count of selected columns in the table. */ 469 sal_Int32 implGetSelColumnCount() const; 470 /** Returns the total cell count in the table (including header). */ implGetCellCount() const471 inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); } 472 473 /** Returns the row index from cell index (including header). */ implGetRow(sal_Int32 nIndex) const474 inline sal_Int32 implGetRow( sal_Int32 nIndex ) const { return nIndex / implGetColumnCount(); } 475 /** Returns the column index from cell index (including header). */ implGetColumn(sal_Int32 nIndex) const476 inline sal_Int32 implGetColumn( sal_Int32 nIndex ) const { return nIndex % implGetColumnCount(); } 477 /** Returns the absolute column index of the nSelColumn-th selected column. */ 478 sal_Int32 implGetSelColumn( sal_Int32 nSelColumn ) const; 479 /** Returns the child index from cell position (including header). */ implGetIndex(sal_Int32 nRow,sal_Int32 nColumn) const480 inline sal_Int32 implGetIndex( sal_Int32 nRow, sal_Int32 nColumn ) const { return nRow * implGetColumnCount() + nColumn; } 481 482 /** Returns the contents of the specified cell (including header). Indexes must be valid. */ 483 String implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const; 484 /** Creates a new accessible object of the specified cell. Indexes must be valid. */ 485 ScAccessibleCsvControl* implCreateCellObj( sal_Int32 nRow, sal_Int32 nColumn ) const; 486 }; 487 488 489 // ============================================================================ 490 491 /** Accessible class representing a cell of the CSV grid control. */ 492 class ScAccessibleCsvCell : public ScAccessibleCsvControl, public accessibility::AccessibleStaticTextBase 493 { 494 protected: 495 typedef ::com::sun::star::uno::Sequence< 496 ::com::sun::star::beans::PropertyValue > PropertyValueSeq; 497 typedef ::std::auto_ptr< SvxEditSource > SvxEditSourcePtr; 498 499 private: 500 String maCellText; /// The text contents of this cell. 501 sal_Int32 mnLine; /// The grid line index (core index). 502 sal_uInt32 mnColumn; /// The grid column index (core index). 503 sal_Int32 mnIndex; /// The index of the cell in the table. 504 505 public: 506 explicit ScAccessibleCsvCell( 507 ScCsvGrid& rGrid, 508 const String& rCellText, 509 sal_Int32 nRow, sal_Int32 nColumn ); 510 virtual ~ScAccessibleCsvCell(); 511 512 using ScAccessibleCsvControl::disposing; 513 virtual void SAL_CALL disposing(); 514 515 // XAccessibleComponent --------------------------------------------------- 516 517 /** Sets the focus to the column of this cell. */ 518 virtual void SAL_CALL grabFocus(); 519 520 virtual sal_Int32 SAL_CALL getForeground( ); 521 522 virtual sal_Int32 SAL_CALL getBackground( ); 523 524 // XAccessibleContext ----------------------------------------------------- 525 526 /** Returns the child count. */ 527 virtual sal_Int32 SAL_CALL getAccessibleChildCount(); 528 529 /** Returns the specified child. */ 530 virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ); 531 532 /** Returns the index of this cell in the table. */ 533 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(); 534 535 /** Returns the relation to the ruler control. */ 536 virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet(); 537 538 /** Returns the current set of states. */ 539 virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet(); 540 541 // XInterface ------------------------------------------------------------- 542 543 DECLARE_XINTERFACE() 544 545 // XTypeProvider ---------------------------------------------------------- 546 547 DECLARE_XTYPEPROVIDER() 548 549 // XServiceInfo ----------------------------------------------------------- 550 551 /** Returns an identifier for the implementation of this object. */ 552 virtual ::rtl::OUString SAL_CALL getImplementationName(); 553 554 // helpers ---------------------------------------------------------------- 555 protected: 556 /** Returns this object's current bounding box relative to the desktop. */ 557 virtual Rectangle GetBoundingBoxOnScreen() const; 558 /** Returns this object's current bounding box relative to the parent object. */ 559 virtual Rectangle GetBoundingBox() const; 560 561 private: 562 /** Returns this object's name. */ 563 virtual ::rtl::OUString SAL_CALL createAccessibleName(); 564 /** Returns this object's description. */ 565 virtual ::rtl::OUString SAL_CALL createAccessibleDescription(); 566 567 /** Returns the VCL grid control. Assumes a living object. */ 568 ScCsvGrid& implGetGrid() const; 569 /** Returns the pixel position of the cell (rel. to parent), regardless of visibility. */ 570 Point implGetRealPos() const; 571 /** Returns the width of the character count */ 572 sal_uInt32 implCalcPixelWidth(sal_uInt32 nChars) const; 573 /** Returns the pixel size of the cell, regardless of visibility. */ 574 Size implGetRealSize() const; 575 /** Returns the bounding box of the cell relative in the table. */ 576 Rectangle implGetBoundingBox() const; 577 578 /** Creates the edit source the text helper needs. */ 579 ::std::auto_ptr< SvxEditSource > implCreateEditSource(); 580 }; 581 582 583 // ============================================================================ 584 585 #endif 586