LibreOffice Module sc (master)  1
AccessibleCell.cxx
Go to the documentation of this file.
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 #include <memory>
21 #include <sal/config.h>
22 
23 #include <AccessibleCell.hxx>
24 #include <scitems.hxx>
25 
26 #include <AccessibleText.hxx>
27 #include <AccessibleDocument.hxx>
28 #include <tabvwsh.hxx>
29 #include <document.hxx>
30 #include <attrib.hxx>
31 #include <editsrc.hxx>
32 #include <dociter.hxx>
33 #include <markdata.hxx>
34 #include <cellvalue.hxx>
35 #include <formulaiter.hxx>
36 #include <validat.hxx>
37 
40 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
41 #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
42 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
43 #include <editeng/brushitem.hxx>
44 #include <vcl/svapp.hxx>
45 
47 
48 using namespace ::com::sun::star;
49 using namespace ::com::sun::star::accessibility;
50 
52  const uno::Reference<XAccessible>& rxParent,
53  ScTabViewShell* pViewShell,
54  const ScAddress& rCellAddress,
55  sal_Int32 nIndex,
56  ScSplitPos eSplitPos,
57  ScAccessibleDocument* pAccDoc)
58 {
60  rxParent, pViewShell, rCellAddress, nIndex, eSplitPos, pAccDoc));
61  x->Init();
62  return x;
63 }
64 
66  const uno::Reference<XAccessible>& rxParent,
67  ScTabViewShell* pViewShell,
68  const ScAddress& rCellAddress,
69  sal_Int32 nIndex,
70  ScSplitPos eSplitPos,
71  ScAccessibleDocument* pAccDoc)
72  :
73  ScAccessibleCellBase(rxParent, GetDocument(pViewShell), rCellAddress, nIndex),
74  ::accessibility::AccessibleStaticTextBase(CreateEditSource(pViewShell, rCellAddress, eSplitPos)),
75  mpViewShell(pViewShell),
76  mpAccDoc(pAccDoc),
77  meSplitPos(eSplitPos)
78 {
79  if (pViewShell)
80  pViewShell->AddAccessibilityObject(*this);
81 }
82 
84 {
85  if (!ScAccessibleContextBase::IsDefunc() && !rBHelper.bInDispose)
86  {
87  // increment refcount to prevent double call off dtor
88  osl_atomic_increment( &m_refCount );
89  // call dispose to inform object which have a weak reference to this object
90  dispose();
91  }
92 }
93 
95 {
97 
98  SetEventSource(this);
99 }
100 
102 {
103  SolarMutexGuard aGuard;
104  // dispose in AccessibleStaticTextBase
105  Dispose();
106 
107  if (mpViewShell)
108  {
110  mpViewShell = nullptr;
111  }
112  mpAccDoc = nullptr;
113 
115 }
116 
117  //===== XInterface =====================================================
118 
120 
121  //===== XTypeProvider ===================================================
122 
123 IMPLEMENT_FORWARD_XTYPEPROVIDER3( ScAccessibleCell, ScAccessibleCellBase, AccessibleStaticTextBase, ScAccessibleCellAttributeImpl )
124 
125  //===== XAccessibleComponent ============================================
126 
127 uno::Reference< XAccessible > SAL_CALL ScAccessibleCell::getAccessibleAtPoint(
128  const awt::Point& rPoint )
129 {
130  return AccessibleStaticTextBase::getAccessibleAtPoint(rPoint);
131 }
132 
134 {
135  SolarMutexGuard aGuard;
136  IsObjectValid();
137  if (getAccessibleParent().is() && mpViewShell)
138  {
139  uno::Reference<XAccessibleComponent> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY);
140  if (xAccessibleComponent.is())
141  {
142  xAccessibleComponent->grabFocus();
144  }
145  }
146 }
147 
149 {
150  tools::Rectangle aCellRect(GetBoundingBox());
151  if (mpViewShell)
152  {
154  if (pWindow)
155  {
156  tools::Rectangle aRect = pWindow->GetWindowExtentsRelative(nullptr);
157  aCellRect.setX(aCellRect.getX() + aRect.getX());
158  aCellRect.setY(aCellRect.getY() + aRect.getY());
159  }
160  }
161  return aCellRect;
162 }
163 
165 {
166  tools::Rectangle aCellRect;
167  if (mpViewShell)
168  {
169  tools::Long nSizeX, nSizeY;
171  maCellAddress.Col(), maCellAddress.Row(), nSizeX, nSizeY);
172  aCellRect.SetSize(Size(nSizeX, nSizeY));
174 
176  if (pWindow)
177  {
179  aRect.Move(-aRect.Left(), -aRect.Top());
180  aCellRect = aRect.Intersection(aCellRect);
181  }
182 
183  /* #i19430# Gnopernicus reads text partly if it sticks out of the cell
184  boundaries. This leads to wrong results in cases where the cell
185  text is rotated, because rotation is not taken into account when
186  calculating the visible part of the text. In these cases we will
187  simply expand the cell size to the width of the unrotated text. */
188  if (mpDoc)
189  {
191  if( pItem && (pItem->GetValue() != 0) )
192  {
194  if( !aParaRect.IsEmpty() && (aCellRect.GetWidth() < aParaRect.GetWidth()) )
195  aCellRect.SetSize( Size( aParaRect.GetWidth(), aCellRect.GetHeight() ) );
196  }
197  }
198  }
199  if (aCellRect.IsEmpty())
200  aCellRect.SetPos(Point(-1, -1));
201  return aCellRect;
202 }
203 
204  //===== XAccessibleContext ==============================================
205 
206 sal_Int32 SAL_CALL
208 {
209  return AccessibleStaticTextBase::getAccessibleChildCount();
210 }
211 
212 uno::Reference< XAccessible > SAL_CALL
214 {
215  return AccessibleStaticTextBase::getAccessibleChild(nIndex);
216 }
217 
218 uno::Reference<XAccessibleStateSet> SAL_CALL
220 {
221  SolarMutexGuard aGuard;
222  uno::Reference<XAccessibleStateSet> xParentStates;
223  if (getAccessibleParent().is())
224  {
225  uno::Reference<XAccessibleContext> xParentContext = getAccessibleParent()->getAccessibleContext();
226  xParentStates = xParentContext->getAccessibleStateSet();
227  }
229  if (IsDefunc(xParentStates))
230  pStateSet->AddState(AccessibleStateType::DEFUNC);
231  else
232  {
233  if (IsFormulaMode())
234  {
235  pStateSet->AddState(AccessibleStateType::ENABLED);
236  pStateSet->AddState(AccessibleStateType::MULTI_LINE);
237  pStateSet->AddState(AccessibleStateType::MULTI_SELECTABLE);
238  if (IsOpaque())
239  pStateSet->AddState(AccessibleStateType::OPAQUE);
240  pStateSet->AddState(AccessibleStateType::SELECTABLE);
241  if (IsSelected())
242  pStateSet->AddState(AccessibleStateType::SELECTED);
243  if (isShowing())
244  pStateSet->AddState(AccessibleStateType::SHOWING);
245  pStateSet->AddState(AccessibleStateType::TRANSIENT);
246  if (isVisible())
247  pStateSet->AddState(AccessibleStateType::VISIBLE);
248  return pStateSet;
249  }
250  if (IsEditable(xParentStates))
251  {
252  pStateSet->AddState(AccessibleStateType::EDITABLE);
253  pStateSet->AddState(AccessibleStateType::RESIZABLE);
254  }
255  pStateSet->AddState(AccessibleStateType::ENABLED);
256  pStateSet->AddState(AccessibleStateType::MULTI_LINE);
257  pStateSet->AddState(AccessibleStateType::MULTI_SELECTABLE);
258  pStateSet->AddState(AccessibleStateType::FOCUSABLE);
259  if (IsOpaque())
260  pStateSet->AddState(AccessibleStateType::OPAQUE);
261  pStateSet->AddState(AccessibleStateType::SELECTABLE);
262  if (IsSelected())
263  pStateSet->AddState(AccessibleStateType::SELECTED);
264  if (isShowing())
265  pStateSet->AddState(AccessibleStateType::SHOWING);
266  pStateSet->AddState(AccessibleStateType::TRANSIENT);
267  if (isVisible())
268  pStateSet->AddState(AccessibleStateType::VISIBLE);
269  }
270  return pStateSet;
271 }
272 
273 uno::Reference<XAccessibleRelationSet> SAL_CALL
275 {
276  SolarMutexGuard aGuard;
277  IsObjectValid();
278  utl::AccessibleRelationSetHelper* pRelationSet = nullptr;
279  if (mpAccDoc)
280  pRelationSet = mpAccDoc->GetRelationSet(&maCellAddress);
281  if (!pRelationSet)
282  pRelationSet = new utl::AccessibleRelationSetHelper();
283  FillDependents(pRelationSet);
284  FillPrecedents(pRelationSet);
285  return pRelationSet;
286 }
287 
288  //===== XServiceInfo ====================================================
289 
291 {
292  return "ScAccessibleCell";
293 }
294 
295 uno::Sequence< OUString> SAL_CALL
297 {
298  uno::Sequence< OUString > aSequence = ScAccessibleContextBase::getSupportedServiceNames();
299  sal_Int32 nOldSize(aSequence.getLength());
300  aSequence.realloc(nOldSize + 1);
301 
302  aSequence[nOldSize] = "com.sun.star.sheet.AccessibleCell";
303 
304  return aSequence;
305 }
306 
307  //==== internal =========================================================
308 
310  const uno::Reference<XAccessibleStateSet>& rxParentStates)
311 {
312  return ScAccessibleContextBase::IsDefunc() || (mpDoc == nullptr) || (mpViewShell == nullptr) || !getAccessibleParent().is() ||
313  (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC));
314 }
315 
317  const uno::Reference<XAccessibleStateSet>& rxParentStates)
318 {
319  bool bEditable(true);
320  if (rxParentStates.is() && !rxParentStates->contains(AccessibleStateType::EDITABLE) &&
321  mpDoc)
322  {
323  // here I have to test whether the protection of the table should influence this cell.
325  if (pItem)
326  bEditable = !pItem->GetProtection();
327  }
328  return bEditable;
329 }
330 
332 {
333  // test whether there is a background color
334  bool bOpaque(true);
335  if (mpDoc)
336  {
338  if (pItem)
339  bOpaque = pItem->GetColor() != COL_TRANSPARENT;
340  }
341  return bOpaque;
342 }
343 
345 {
346  if (IsFormulaMode())
347  {
348  const ScAccessibleSpreadsheet *pSheet =static_cast<const ScAccessibleSpreadsheet*>(mxParent.get());
349  if (pSheet)
350  {
351  return pSheet->IsScAddrFormulaSel(maCellAddress);
352  }
353  return false;
354  }
355 
356  bool bResult(false);
357  if (mpViewShell)
358  {
359  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
360  bResult = rMarkdata.IsCellMarked(maCellAddress.Col(), maCellAddress.Row());
361  }
362  return bResult;
363 }
364 
366 {
367  ScDocument* pDoc = nullptr;
368  if (pViewShell)
369  pDoc = &pViewShell->GetViewData().GetDocument();
370  return pDoc;
371 }
372 
373 ::std::unique_ptr< SvxEditSource > ScAccessibleCell::CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos)
374 {
375  if (IsFormulaMode())
376  {
377  return ::std::unique_ptr< SvxEditSource >();
378  }
379  ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(std::make_unique<ScAccessibleCellTextData>(pViewShell, aCell, eSplitPos, this)));
380 
381  return pEditSource;
382 }
383 
385 {
386  if (!mpDoc)
387  return;
388 
389  ScRange aRange(0, 0, maCellAddress.Tab(), mpDoc->MaxCol(), mpDoc->MaxRow(), maCellAddress.Tab());
390  ScCellIterator aCellIter(*mpDoc, aRange);
391 
392  for (bool bHasCell = aCellIter.first(); bHasCell; bHasCell = aCellIter.next())
393  {
394  if (aCellIter.getType() == CELLTYPE_FORMULA)
395  {
396  bool bFound = false;
397  ScDetectiveRefIter aIter(*mpDoc, aCellIter.getFormulaCell());
398  ScRange aRef;
399  while ( !bFound && aIter.GetNextRef( aRef ) )
400  {
401  if (aRef.In(maCellAddress))
402  bFound = true;
403  }
404  if (bFound)
405  AddRelation(aCellIter.GetPos(), AccessibleRelationType::CONTROLLER_FOR, pRelationSet);
406  }
407  }
408 }
409 
411 {
412  if (!mpDoc)
413  return;
414 
416  if (aCell.meType == CELLTYPE_FORMULA)
417  {
418  ScFormulaCell* pCell = aCell.mpFormula;
419  ScDetectiveRefIter aIter(*mpDoc, pCell);
420  ScRange aRef;
421  while ( aIter.GetNextRef( aRef ) )
422  {
423  AddRelation( aRef, AccessibleRelationType::CONTROLLED_BY, pRelationSet);
424  }
425  }
426 }
427 
428 void ScAccessibleCell::AddRelation(const ScAddress& rCell,
429  const sal_uInt16 aRelationType,
430  utl::AccessibleRelationSetHelper* pRelationSet)
431 {
432  AddRelation(ScRange(rCell, rCell), aRelationType, pRelationSet);
433 }
434 
435 void ScAccessibleCell::AddRelation(const ScRange& rRange,
436  const sal_uInt16 aRelationType,
437  utl::AccessibleRelationSetHelper* pRelationSet)
438 {
439  uno::Reference < XAccessibleTable > xTable ( getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY );
440  if (!xTable.is())
441  return;
442 
443  const sal_uInt32 nCount(static_cast<sal_uInt32>(rRange.aEnd.Col() -
444  rRange.aStart.Col() + 1) * (rRange.aEnd.Row() -
445  rRange.aStart.Row() + 1));
446  uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount );
447  uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray();
448  sal_uInt32 nPos(0);
449  for (sal_uInt32 nRow = rRange.aStart.Row(); nRow <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Row()); ++nRow)
450  {
451  for (sal_uInt32 nCol = rRange.aStart.Col(); nCol <= sal::static_int_cast<sal_uInt32>(rRange.aEnd.Col()); ++nCol)
452  {
453  pTargetSet[nPos] = xTable->getAccessibleCellAt(nRow, nCol);
454  ++nPos;
455  }
456  }
457  OSL_ENSURE(nCount == nPos, "something went wrong");
458  AccessibleRelation aRelation;
459  aRelation.RelationType = aRelationType;
460  aRelation.TargetSet = aTargetSet;
461  pRelationSet->AddRelation(aRelation);
462 }
463 
464 static OUString ReplaceOneChar(const OUString& oldOUString, const OUString& replacedChar, const OUString& replaceStr)
465 {
466  int iReplace = oldOUString.lastIndexOf(replacedChar);
467  OUString aRet = oldOUString;
468  while(iReplace > -1)
469  {
470  aRet = aRet.replaceAt(iReplace, 1, replaceStr);
471  iReplace = aRet.lastIndexOf(replacedChar, iReplace);
472  }
473  return aRet;
474 }
475 
476 static OUString ReplaceFourChar(const OUString& oldOUString)
477 {
478  OUString aRet = ReplaceOneChar(oldOUString, "\\", "\\\\");
479  aRet = ReplaceOneChar(aRet, ";", "\\;");
480  aRet = ReplaceOneChar(aRet, "=", "\\=");
481  aRet = ReplaceOneChar(aRet, ",", "\\,");
482  aRet = ReplaceOneChar(aRet, ":", "\\:");
483  return aRet;
484 }
485 
487 {
488  SolarMutexGuard aGuard;
489 
490  uno::Any strRet;
491  if (mpViewShell)
492  {
493  OUString strFor = mpViewShell->GetFormula(maCellAddress) ;
494  if (!strFor.isEmpty())
495  {
496  strFor = strFor.copy(1);
497  strFor = ReplaceFourChar(strFor);
498  }
499  strFor = "Formula:" + strFor +
500  ";Note:" +
502  getShadowAttrs() + //the string returned contains the spliter ";"
503  getBorderAttrs();//the string returned contains the spliter ";"
504  //end of cell attributes
505  if( mpDoc )
506  {
507  strFor += "isdropdown:";
508  if( IsDropdown() )
509  strFor += "true";
510  else
511  strFor += "false";
512  strFor += ";";
513  }
514  strRet <<= strFor ;
515  }
516  return strRet;
517 }
518 
519 // cell has its own ParaIndent property, so when calling character attributes on cell, the ParaIndent should replace the ParaLeftMargin if its value is not zero.
520 uno::Sequence< beans::PropertyValue > SAL_CALL ScAccessibleCell::getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes )
521 {
522  SolarMutexGuard aGuard;
523 
524  uno::Sequence< beans::PropertyValue > aAttribs = AccessibleStaticTextBase::getCharacterAttributes( nIndex, aRequestedAttributes );
525 
526  sal_uInt16 nParaIndent = mpDoc->GetAttr( maCellAddress, ATTR_INDENT )->GetValue();
527  if (nParaIndent > 0)
528  {
529  auto pAttrib = std::find_if(aAttribs.begin(), aAttribs.end(),
530  [](const beans::PropertyValue& rAttrib) { return "ParaLeftMargin" == rAttrib.Name; });
531  if (pAttrib != aAttribs.end())
532  pAttrib->Value <<= nParaIndent;
533  }
534  return aAttribs;
535 }
536 
538 {
539  ScAccessibleSpreadsheet* pSheet = static_cast<ScAccessibleSpreadsheet*>(mxParent.get());
540  if (pSheet)
541  {
542  return pSheet->IsFormulaMode();
543  }
544  return false;
545 }
546 
548 {
549  sal_uInt16 nPosX = maCellAddress.Col();
550  sal_uInt16 nPosY = sal_uInt16(maCellAddress.Row());
551  sal_uInt16 nTab = maCellAddress.Tab();
552  sal_uInt32 nValidation = mpDoc->GetAttr( nPosX, nPosY, nTab, ATTR_VALIDDATA )->GetValue();
553  if( nValidation )
554  {
555  const ScValidationData* pData = mpDoc->GetValidationEntry( nValidation );
556  if( pData && pData->HasSelectionList() )
557  return true;
558  }
559  const ScMergeFlagAttr* pAttr = mpDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG );
560  if( pAttr->HasAutoFilter() )
561  {
562  return true;
563  }
564  else
565  {
566  sal_uInt16 nTabCount = mpDoc->GetTableCount();
567  if ( nTab+1<nTabCount && mpDoc->IsScenario(nTab+1) && !mpDoc->IsScenario(nTab) )
568  {
569  SCTAB i;
570  ScMarkData aMarks(mpDoc->GetSheetLimits());
571  for (i=nTab+1; i<nTabCount && mpDoc->IsScenario(i); i++)
572  mpDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
573  ScRangeList aRanges;
574  aMarks.FillRangeListWithMarks( &aRanges, false );
575  bool bHasScenario;
576  SCTAB nRangeCount = aRanges.size();
577  for (i=0; i<nRangeCount; i++)
578  {
579  ScRange aRange = aRanges[i];
580  mpDoc->ExtendTotalMerge( aRange );
581  bool bTextBelow = ( aRange.aStart.Row() == 0 );
582  // MT IA2: Not used: sal_Bool bIsInScen = sal_False;
583  if ( bTextBelow )
584  {
585  bHasScenario = (aRange.aStart.Col() == nPosX && aRange.aEnd.Row() == nPosY-1);
586  }
587  else
588  {
589  bHasScenario = (aRange.aStart.Col() == nPosX && aRange.aStart.Row() == nPosY+1);
590  }
591  if( bHasScenario ) return true;
592  }
593  }
594  }
595  return false;
596 }
597 
598 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3046
void SetPos(const Point &rPoint)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual bool isVisible() override
ScAddress aStart
Definition: address.hxx:500
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
virtual void SAL_CALL grabFocus() override
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
SCROW Row() const
Definition: address.hxx:262
std::unique_ptr< ContentProperties > pData
ScTabViewShell * mpViewShell
static ScDocument * GetDocument(ScTabViewShell *mpViewShell)
static rtl::Reference< ScAccessibleCell > create(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int32 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
ULONG m_refCount
vcl::Window * GetAccessibleParentWindow() const
void AddAccessibilityObject(SfxListener &rObject)
Definition: tabvwshh.cxx:207
long Long
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
tools::Long getY() const
tools::Long GetWidth() const
ScAddress aEnd
Definition: address.hxx:501
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:104
bool HasSelectionList() const
Returns true, if the validation cell will show a selection list.
Definition: validat.cxx:711
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
void FillDependents(utl::AccessibleRelationSetHelper *pRelationSet)
float x
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
Definition: tabview3.cxx:358
ScSplitPos
Definition: viewdata.hxx:45
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
Definition: markdata.cxx:285
void AddRelation(const ScAddress &rCell, const sal_uInt16 aRelationType,::utl::AccessibleRelationSetHelper *pRelationSet)
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
bool IsEmpty() const
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uLong nIndex) const
Definition: documen4.cxx:871
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
static OUString ReplaceOneChar(const OUString &oldOUString, const OUString &replacedChar, const OUString &replaceStr)
bool IsDropdown() const
tools::Long Left() const
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
int nCount
virtual bool IsEditable(const css::uno::Reference< css::accessibility::XAccessibleStateSet > &rxParentStates) override
Walk through all cells in an area.
Definition: dociter.hxx:208
ScFormulaCell * mpFormula
Definition: cellvalue.hxx:111
SCTAB Tab() const
Definition: address.hxx:271
void AddRelation(const css::accessibility::AccessibleRelation &rRelation)
tools::Long getX() const
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
void setX(tools::Long x)
ScViewData & GetViewData()
Definition: tabview.hxx:332
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4714
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
ScAccessibleDocument * mpAccDoc
const Color & GetColor() const
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
virtual void SAL_CALL disposing() override
void setY(tools::Long y)
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
Definition: tabview.hxx:370
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
int i
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
Definition: viewdata.cxx:2313
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
Iterator for references in a formula cell.
Definition: formulaiter.hxx:32
void SetSize(const Size &rSize)
ScSheetLimits & GetSheetLimits() const
Definition: document.hxx:874
size_t size() const
Definition: rangelst.hxx:90
OUString GetFormula(const ScAddress &rAddress)
Definition: tabvwsh.cxx:105
void MarkScenario(SCTAB nSrcTab, SCTAB nDestTab, ScMarkData &rDestMark, bool bResetMark=true, ScScenarioFlags nNeededBits=ScScenarioFlags::NONE) const
Definition: documen3.cxx:847
This base class provides an implementation of the AccessibleCell service.
This base class provides an implementation of the AccessibleTable service.
tools::Long Top() const
#define IMPLEMENT_FORWARD_XINTERFACE3(classname, refcountbase, baseclass2, baseclass3)
bool IsScAddrFormulaSel(const ScAddress &addr) const
bool IsOpaque() const
static OUString ReplaceFourChar(const OUString &oldOUString)
SCCOL Col() const
Definition: address.hxx:267
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
CellType meType
Definition: cellvalue.hxx:106
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
OUString GetAllDisplayNote() const
virtual void SAL_CALL disposing() override
virtual void Init() override
bool GetNextRef(ScRange &rRange)
Definition: formulaiter.cxx:52
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:427
void RemoveAccessibilityObject(SfxListener &rObject)
Definition: tabvwshh.cxx:217
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
bool GetProtection() const
Definition: attrib.hxx:144
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
tools::Rectangle GetParagraphBoundingBox() const
OUString getShadowAttrs() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
Definition: viewdata.cxx:2641
SC_DLLPUBLIC void ExtendTotalMerge(ScRange &rRange) const
Definition: document.cxx:5618
::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell *pViewShell, ScAddress aCell, ScSplitPos eSplitPos)
void FillPrecedents(utl::AccessibleRelationSetHelper *pRelationSet)
css::uno::Reference< css::accessibility::XAccessible > mxParent
Reference to the parent object.
tools::Long GetHeight() const
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
bool HasAutoFilter() const
Definition: attrib.hxx:104
void dispose()
utl::AccessibleRelationSetHelper * GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
ScAccessibleCell(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int32 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
void AddState(sal_Int16 aState)
virtual ~ScAccessibleCell() override
void SetEventSource(const css::uno::Reference< css::accessibility::XAccessible > &rInterface)
sal_uInt16 nPos
sal_Int16 SCTAB
Definition: types.hxx:23
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
===== XAccessible =====================================================