31#include <document.hxx>
41#include <com/sun/star/accessibility/AccessibleStateType.hpp>
42#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
43#include <com/sun/star/accessibility/XAccessibleTable.hpp>
53 const uno::Reference<XAccessible>& rxParent,
61 rxParent, pViewShell, rCellAddress,
nIndex, eSplitPos, pAccDoc));
67 const uno::Reference<XAccessible>& rxParent,
75 ::
accessibility::AccessibleStaticTextBase(CreateEditSource(pViewShell, rCellAddress, eSplitPos)),
76 mpViewShell(pViewShell),
126 return ::comphelper::concatSequences(
128 AccessibleStaticTextBase::getTypes(),
137 const awt::
Point& rPoint )
139 return AccessibleStaticTextBase::getAccessibleAtPoint(rPoint);
149 if (xAccessibleComponent.is())
151 xAccessibleComponent->grabFocus();
199 if( pItem && (pItem->
GetValue() != 0_deg100) )
217 return AccessibleStaticTextBase::getAccessibleChildCount();
220uno::Reference< XAccessible > SAL_CALL
223 return AccessibleStaticTextBase::getAccessibleChild(
nIndex);
230 sal_Int64 nParentStates = 0;
233 uno::Reference<XAccessibleContext> xParentContext =
getAccessibleParent()->getAccessibleContext();
234 nParentStates = xParentContext->getAccessibleStateSet();
236 sal_Int64 nStateSet = 0;
238 nStateSet |= AccessibleStateType::DEFUNC;
242 nStateSet |= AccessibleStateType::FOCUSED;
246 nStateSet |= AccessibleStateType::ENABLED;
247 nStateSet |= AccessibleStateType::MULTI_LINE;
248 nStateSet |= AccessibleStateType::MULTI_SELECTABLE;
250 nStateSet |= AccessibleStateType::OPAQUE;
251 nStateSet |= AccessibleStateType::SELECTABLE;
253 nStateSet |= AccessibleStateType::SELECTED;
255 nStateSet |= AccessibleStateType::SHOWING;
256 nStateSet |= AccessibleStateType::TRANSIENT;
258 nStateSet |= AccessibleStateType::VISIBLE;
263 nStateSet |= AccessibleStateType::EDITABLE;
264 nStateSet |= AccessibleStateType::RESIZABLE;
266 nStateSet |= AccessibleStateType::ENABLED;
267 nStateSet |= AccessibleStateType::MULTI_LINE;
268 nStateSet |= AccessibleStateType::MULTI_SELECTABLE;
269 nStateSet |= AccessibleStateType::FOCUSABLE;
271 nStateSet |= AccessibleStateType::OPAQUE;
272 nStateSet |= AccessibleStateType::SELECTABLE;
274 nStateSet |= AccessibleStateType::SELECTED;
276 nStateSet |= AccessibleStateType::SHOWING;
277 nStateSet |= AccessibleStateType::TRANSIENT;
279 nStateSet |= AccessibleStateType::VISIBLE;
284uno::Reference<XAccessibleRelationSet> SAL_CALL
303 return "ScAccessibleCell";
306uno::Sequence< OUString> SAL_CALL
309 const css::uno::Sequence<OUString> vals {
"com.sun.star.sheet.AccessibleCell" };
318 (nParentStates & AccessibleStateType::DEFUNC);
323 bool bEditable(
true);
324 if ( !(nParentStates & AccessibleStateType::EDITABLE) &&
389 return ::std::unique_ptr< SvxEditSource >();
391 ::std::unique_ptr< SvxEditSource > pEditSource (
new ScAccessibilityEditSource(std::make_unique<ScAccessibleCellTextData>(pViewShell, aCell, eSplitPos,
this)));
404 for (
bool bHasCell = aCellIter.
first(); bHasCell; bHasCell = aCellIter.
next())
417 AddRelation(aCellIter.
GetPos(), AccessibleRelationType::CONTROLLER_FOR, pRelationSet);
435 AddRelation( aRef, AccessibleRelationType::CONTROLLED_BY, pRelationSet);
441 const sal_uInt16 aRelationType,
448 const sal_uInt16 aRelationType,
455 const sal_uInt32
nCount(
static_cast<sal_uInt32
>(rRange.
aEnd.
Col() -
458 uno::Sequence < uno::Reference < uno::XInterface > > aTargetSet( nCount );
459 uno::Reference < uno::XInterface >* pTargetSet = aTargetSet.getArray();
461 for (sal_uInt32 nRow = rRange.
aStart.
Row(); nRow <= sal::static_int_cast<sal_uInt32>(rRange.
aEnd.
Row()); ++nRow)
463 for (sal_uInt32 nCol = rRange.
aStart.
Col(); nCol <= sal::static_int_cast<sal_uInt32>(rRange.
aEnd.
Col()); ++nCol)
465 pTargetSet[
nPos] = xTable->getAccessibleCellAt(nRow, nCol);
469 OSL_ENSURE(nCount == nPos,
"something went wrong");
470 AccessibleRelation aRelation;
471 aRelation.RelationType = aRelationType;
472 aRelation.TargetSet = aTargetSet;
478 return oldOUString.replaceAll(
u"\\",
u"\\\\")
479 .replaceAll(
u";",
u"\\;")
480 .replaceAll(
u"=",
u"\\=")
481 .replaceAll(
u",",
u"\\,")
482 .replaceAll(
u":",
u"\\:");
493 if (!strFor.isEmpty())
495 strFor = strFor.copy(1);
498 strFor =
"Formula:" + strFor +
506 strFor +=
"isdropdown:";
523 uno::Sequence< beans::PropertyValue > aAttribs = AccessibleStaticTextBase::getCharacterAttributes(
nIndex, aRequestedAttributes );
528 auto [
begin,
end] = asNonConstRange(aAttribs);
529 auto pAttrib = std::find_if(
begin,
end,
530 [](
const beans::PropertyValue& rAttrib) {
return "ParaLeftMargin" == rAttrib.Name; });
532 pAttrib->Value <<= nParaIndent;
577 for (
i=0;
i<nRangeCount;
i++)
581 bool bTextBelow = ( aRange.
aStart.
Row() == 0 );
585 bHasScenario = (aRange.
aStart.
Col() == nPosX && aRange.
aEnd.
Row() == nPosY-1);
591 if( bHasScenario )
return true;
static OUString ReplaceFourChar(const OUString &oldOUString)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
OUString getShadowAttrs() const
OUString GetAllDisplayNote() const
OUString getBorderAttrs()
virtual bool isVisible() override
@descr This base class provides an implementation of the AccessibleCell service.
ScTabViewShell * mpViewShell
static rtl::Reference< ScAccessibleCell > create(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int64 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or NULL if index is invalid.
ScAccessibleCell(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int64 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
ScAccessibleDocument * mpAccDoc
::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell *pViewShell, ScAddress aCell, ScSplitPos eSplitPos)
void FillDependents(utl::AccessibleRelationSetHelper *pRelationSet)
virtual ~ScAccessibleCell() override
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
static ScDocument * GetDocument(ScTabViewShell *mpViewShell)
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual void Init() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual void SAL_CALL grabFocus() override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
virtual bool IsEditable(sal_Int64 nParentStates) override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
void FillPrecedents(utl::AccessibleRelationSetHelper *pRelationSet)
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
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
void AddRelation(const ScAddress &rCell, const sal_uInt16 aRelationType, ::utl::AccessibleRelationSetHelper *pRelationSet)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
void IsObjectValid() const
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
===== XAccessible =====================================================
virtual void SAL_CALL disposing() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
css::uno::Reference< css::accessibility::XAccessible > mxParent
Reference to the parent object.
rtl::Reference< utl::AccessibleRelationSetHelper > GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
@descr This base class provides an implementation of the AccessibleTable service.
bool IsScAddrFormulaSel(const ScAddress &addr) const
Walk through all cells in an area.
ScFormulaCell * getFormulaCell()
const ScAddress & GetPos() const
Iterator for references in a formula cell.
bool GetNextRef(ScRange &rRange)
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
ScSheetLimits & GetSheetLimits() const
void MarkScenario(SCTAB nSrcTab, SCTAB nDestTab, ScMarkData &rDestMark, bool bResetMark=true, ScScenarioFlags nNeededBits=ScScenarioFlags::NONE) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uInt32 nIndex) const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC void ExtendTotalMerge(ScRange &rRange) const
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC SCTAB GetTableCount() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
bool HasAutoFilter() const
bool GetProtection() const
bool Contains(const ScAddress &) const
is Address& fully in Range?
void AddAccessibilityObject(SfxListener &rObject)
void RemoveAccessibilityObject(SfxListener &rObject)
OUString GetFormula(const ScAddress &rAddress)
ScViewData & GetViewData()
ScGridWindow * GetActiveWin()
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
ScAddress GetCurPos() const
Degree100 GetValue() const
const Color & GetColor() const
void SetEventSource(const css::uno::Reference< css::accessibility::XAccessible > &rInterface)
tools::Rectangle GetParagraphBoundingBox() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
void AddRelation(const css::accessibility::AccessibleRelation &rRelation)
tools::Rectangle GetWindowExtentsAbsolute() const
vcl::Window * GetAccessibleParentWindow() const
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::unique_ptr< sal_Int32[]> pData
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
enumrange< T >::Iterator begin(enumrange< T >)
IMPLEMENT_GET_IMPLEMENTATION_ID(DrawController)
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
This is very similar to ScCellValue, except that it references the original value instead of copying ...
ScFormulaCell * getFormula() const
#define IMPLEMENT_FORWARD_XINTERFACE3(classname, refcountbase, baseclass2, baseclass3)