28#include <com/sun/star/accessibility/AccessibleRole.hpp>
29#include <com/sun/star/accessibility/AccessibleStateType.hpp>
30#include <com/sun/star/accessibility/AccessibleEventId.hpp>
55, maShapeTreeInfo( rShapeTreeInfo )
57, mxCell(
std::move( xCell ))
66 DBG_ASSERT(
mpText ==
nullptr,
"svx::AccessibleCell::~AccessibleCell(), not disposed!?" );
74 if( !((pView !=
nullptr) && (pWindow !=
nullptr) &&
mxCell.is()))
78 if(
mxCell->CanCreateEditOutlinerParaObject() ||
mxCell->GetOutlinerParaObject() !=
nullptr )
85 mpText->SetEventSource(
this);
92 bool bStateHasChanged =
false;
94 if (aState == AccessibleStateType::FOCUSED &&
mpText !=
nullptr)
98 bool bIsFocused =
mpText->HaveFocus ();
100 bStateHasChanged = (bIsFocused !=
mpText->HaveFocus ());
105 return bStateHasChanged;
111 bool bStateHasChanged =
false;
113 if (aState == AccessibleStateType::FOCUSED &&
mpText !=
nullptr)
117 bool bIsFocused =
mpText->HaveFocus ();
119 bStateHasChanged = (bIsFocused !=
mpText->HaveFocus ());
124 return bStateHasChanged;
133 return AccessibleCellBase::queryInterface( aType );
139 AccessibleCellBase::acquire();
145 AccessibleCellBase::release();
158 return mpText !=
nullptr ?
mpText->GetChildCount () : 0;
183 ::osl::MutexGuard aGuard (
m_aMutex);
184 sal_Int64 nStateSet = 0;
186 if (rBHelper.bDisposed ||
mpText ==
nullptr)
197 mnStateSet |= AccessibleStateType::FOCUSED;
199 mnStateSet &= ~AccessibleStateType::FOCUSED;
203 mnStateSet &= ~AccessibleStateType::VISIBLE;
205 mnStateSet |= AccessibleStateType::VISIBLE;
209 css::uno::Reference<XAccessible> xTempAcc = getAccessibleParent();
212 css::uno::Reference<XAccessibleContext>
213 xTempAccContext = xTempAcc->getAccessibleContext();
214 if( xTempAccContext.is() )
216 if (xTempAccContext->getAccessibleStateSet() & AccessibleStateType::EDITABLE)
218 mnStateSet |= AccessibleStateType::EDITABLE;
219 mnStateSet |= AccessibleStateType::RESIZABLE;
220 mnStateSet |= AccessibleStateType::MOVEABLE;
224 nStateSet = mnStateSet;
250 ::osl::MutexGuard aGuard (
m_aMutex);
253 for (sal_Int64
i = 0;
i < nChildCount; ++
i)
258 Reference<XAccessibleComponent> xChildComponent (xChild->getAccessibleContext(), uno::UNO_QUERY);
259 if (xChildComponent.is())
261 awt::Rectangle aBBox (xChildComponent->getBounds());
262 if ( (aPoint.X >= aBBox.X)
263 && (aPoint.Y >= aBBox.Y)
264 && (aPoint.X < aBBox.X+aBBox.Width)
265 && (aPoint.Y < aBBox.Y+aBBox.Height) )
273 return uno::Reference<XAccessible>();
280 ::osl::MutexGuard aGuard (
m_aMutex);
283 css::awt::Rectangle aBoundingBox;
287 const ::tools::Rectangle aCellRect(
mxCell->getCellRect() );
291 throw uno::RuntimeException (
"AccessibleCell has no valid view forwarder", getXWeak());
297 Reference<XAccessibleComponent> xParentComponent ( getAccessibleParent(), uno::UNO_QUERY);
298 if (xParentComponent.is())
301 awt::Point aParentLocation (xParentComponent->getLocationOnScreen());
302 int x = aPixelPosition.
getX() - aParentLocation.X;
303 int y = aPixelPosition.
getY() - aParentLocation.Y;
307 awt::Size aParentSize (xParentComponent->getSize());
314 SAL_INFO(
"svx",
"parent does not support component");
315 aBoundingBox = awt::Rectangle (aPixelPosition.
getX(), aPixelPosition.
getY(),aPixelSize.
getWidth(), aPixelSize.
getHeight());
326 css::awt::Rectangle aBoundingBox(
getBounds());
327 return css::awt::Point(aBoundingBox.X, aBoundingBox.Y);
339 Reference<XAccessibleComponent> xParentComponent( getAccessibleParent(), uno::UNO_QUERY);
340 if(xParentComponent.is())
342 css::awt::Point aParentLocation(xParentComponent->getLocationOnScreen());
343 aLocation.X += aParentLocation.X;
344 aLocation.Y += aParentLocation.Y;
348 SAL_WARN(
"svx",
"parent does not support XAccessibleComponent");
358 awt::Rectangle aBoundingBox (
getBounds());
359 return awt::Size (aBoundingBox.Width, aBoundingBox.Height);
374 return sal_Int32(0x0ffffffL);
415 ::osl::MutexGuard aGuard (
m_aMutex);
416 if (rBHelper.bDisposed || rBHelper.bInDispose)
418 Reference<XInterface> xSource(
static_cast<XComponent *
>(
this) );
419 lang::EventObject aEventObj(xSource);
420 rxListener->disposing(aEventObj);
426 mpText->AddEventListener (rxListener);
436 mpText->RemoveEventListener (rxListener);
445 return "AccessibleCell";
452 const css::uno::Sequence<OUString> vals {
"com.sun.star.drawing.AccessibleCell" };
464 CommitChange(AccessibleEventId::VISIBLE_DATA_CHANGED,
Any(),
Any(), -1);
478 ::osl::MutexGuard aGuard (
m_aMutex);
482 mnStateSet &= ~AccessibleStateType::FOCUSED;
496 AccessibleContextBase::dispose ();
514 static_cast<sal_uInt16
>(nCol)));
519 (
static_cast<sal_uInt16
>(nCol) / 26) - 1))
521 (
static_cast<sal_uInt16
>(nCol) % 26))) );
529 sal_Int32 nC = nCol % 26;
531 static_cast<sal_uInt16
>(nC)));
533 nCol = nCol / 26 - 1;
536 static_cast<sal_uInt16
>(nCol)));
540 return aBuf.makeStringAndClear();
552 sal_Int32 nRow = 0, nCol = 0;
561 return AccessibleCellBase::getAccessibleName();
constexpr tools::Long getX() const
constexpr tools::Long getY() const
constexpr tools::Long getHeight() const
constexpr tools::Long getWidth() const
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Forward the request to the shape.
sdr::table::CellRef mxCell
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual bool SetState(sal_Int64 aState) override
virtual OUString SAL_CALL getAccessibleName() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual css::awt::Size SAL_CALL getSize() override
AccessibleCell(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, sdr::table::CellRef xCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo &rShapeTreeInfo)
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
virtual void ViewForwarderChanged() override
This method is called to indicate a change of the specified view forwarder, specifically,...
std::unique_ptr< AccessibleTextHelper > mpText
The accessible text engine. May be NULL if it can not be created.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Int32 SAL_CALL getForeground() override
AccessibleTableShape * pAccTable
virtual OUString SAL_CALL getToolTipText() override
static OUString getCellName(sal_Int32 nCol, sal_Int32 nRow)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The implementation below is at the moment straightforward.
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual bool ResetState(sal_Int64 aState) override
virtual sal_Int32 SAL_CALL getBackground() override
AccessibleShapeTreeInfo maShapeTreeInfo
Bundle of information passed to all shapes in a document tree.
virtual css::awt::Point SAL_CALL getLocation() override
virtual ~AccessibleCell() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return a copy of the state set.
virtual void SAL_CALL acquire() noexcept override
sal_Int32 mnIndexInParent
the index in parent.
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
The children of this cell come from the paragraphs of text.
virtual void SAL_CALL grabFocus() override
virtual OUString SAL_CALL getTitledBorderText() override
virtual void SAL_CALL disposing() override
This method is called from the component helper base class while disposing.
virtual OUString SAL_CALL getToolTipText() override
virtual void SAL_CALL grabFocus() override
virtual OUString SAL_CALL getTitledBorderText() override
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual bool SetState(sal_Int64 aState)
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual bool ResetState(sal_Int64 aState)
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
const IAccessibleViewForwarder * GetViewForwarder() const
Return the current view forwarder.
SdrView * GetSdrView() const
Return the current SdrView.
vcl::Window * GetWindow() const
Return the current Window.
void getColumnAndRow(sal_Int64 nChildIndex, sal_Int32 &rnColumn, sal_Int32 &rnRow)
Helper class for objects containing EditEngine/Outliner text.
virtual Point LogicToPixel(const Point &rPoint) const =0
Transform the specified point from internal coordinates in 100th of mm to an absolute screen position...
::OutputDevice const * GetOutDev() const
#define DBG_ASSERT(sCon, aError)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
::cppu::ImplInheritanceHelper< AccessibleContextBase, css::accessibility::XAccessibleExtendedComponent > AccessibleCellBase
OUString reverseString(std::u16string_view rStr)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)