20#include <AccessibleContextBase.hxx>
21#include <com/sun/star/accessibility/AccessibleEventId.hpp>
22#include <com/sun/star/accessibility/AccessibleStateType.hpp>
23#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp>
40 uno::Reference<XAccessible> xParent,
41 const sal_Int16 aRole)
52 if (!
IsDefunc() && !rBHelper.bInDispose)
64 uno::Reference< XAccessibleContext > xKeepAlive(
this);
68 uno::Reference< XAccessibleEventBroadcaster > xBroadcaster (
mxParent->getAccessibleContext(), uno::UNO_QUERY);
69 if (xBroadcaster.is())
70 xBroadcaster->addAccessibleEventListener(
this);
82 uno::Reference< XAccessibleContext > xKeepAlive(
this);
93 uno::Reference< XAccessibleEventBroadcaster > xBroadcaster (
mxParent->getAccessibleContext(), uno::UNO_QUERY);
94 if (xBroadcaster.is())
95 xBroadcaster->removeAccessibleEventListener(
this);
105 if (rHint.
GetId() == SfxHintId::Dying)
114uno::Reference< XAccessibleContext> SAL_CALL
132 OSL_FAIL(
"not implemented");
133 return uno::Reference<XAccessible>();
168 bool bShowing(
false);
171 uno::Reference<XAccessibleComponent> xParentComponent (
mxParent->getAccessibleContext(), uno::UNO_QUERY);
172 if (xParentComponent.is())
176 bShowing = aBounds.
Overlaps(aParentBounds);
189 OSL_FAIL(
"not implemented");
206 OSL_FAIL(
"should be implemented in the abrevated class");
210uno::Reference<XAccessible> SAL_CALL
213 OSL_FAIL(
"should be implemented in the abrevated class");
214 return uno::Reference<XAccessible>();
217uno::Reference<XAccessible> SAL_CALL
236 uno::Reference<XAccessibleContext> xParentContext (
238 if (xParentContext.is())
240 sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
241 for (sal_Int64
i=0;
i<nChildCount; ++
i)
243 uno::Reference<XAccessible> xChild (xParentContext->getAccessibleChild (
i));
244 if (xChild.is() && xChild.get() ==
this)
270 AccessibleEventObject
aEvent;
271 aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED;
272 aEvent.Source = uno::Reference< XAccessibleContext >(
this);
274 aEvent.NewValue <<= sDescription;
292 OSL_ENSURE(!
sName.isEmpty(),
"We should give always a name.");
296 AccessibleEventObject
aEvent;
297 aEvent.EventId = AccessibleEventId::NAME_CHANGED;
298 aEvent.Source = uno::Reference< XAccessibleContext >(
this);
310uno::Reference<XAccessibleRelationSet> SAL_CALL
328 uno::Reference<XAccessibleContext> xParentContext (
330 if (xParentContext.is())
331 return xParentContext->getLocale ();
336 throw IllegalAccessibleComponentStateException ();
343 const uno::Reference<XAccessibleEventListener>& xListener)
360 const uno::Reference<XAccessibleEventListener>& xListener)
370 if ( !nListenerCount )
384 const lang::EventObject& rSource )
392 const AccessibleEventObject& )
399 return "ScAccessibleContextBase";
407uno::Sequence< OUString> SAL_CALL
410 return {
"com.sun.star.accessibility.Accessible",
411 "com.sun.star.accessibility.AccessibleContext"};
419 OSL_FAIL(
"should be implemented in the abrevated class");
425 OSL_FAIL(
"should be implemented in the abrevated class");
437 AccessibleEventObject
aEvent;
438 aEvent.EventId = AccessibleEventId::STATE_CHANGED;
440 aEvent.NewValue <<= AccessibleStateType::FOCUSED;
447 AccessibleEventObject
aEvent;
448 aEvent.EventId = AccessibleEventId::STATE_CHANGED;
450 aEvent.OldValue <<= AccessibleStateType::FOCUSED;
457 OSL_FAIL(
"not implemented");
463 OSL_FAIL(
"not implemented");
469 if (rBHelper.bDisposed || rBHelper.bInDispose)
470 throw lang::DisposedException();
cppu::WeakComponentImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleEventBroadcaster, css::lang::XServiceInfo, css::accessibility::XAccessibleEventListener > ScAccessibleContextBaseWeakImpl
@descr This base class provides an implementation of the AccessibleContext service.
constexpr OUStringLiteral sServiceName
unotools::WeakReference< AnimationNode > mxParent
virtual tools::Rectangle GetBoundingBoxOnScreen() const
Return the object's current bounding box relative to the desktop.
virtual ~ScAccessibleContextBase() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
OUString msDescription
Description of this object.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
void IsObjectValid() const
virtual css::awt::Size SAL_CALL getSize() override
virtual OUString SAL_CALL getAccessibleDescription() override
Return this object's description.
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
===== XAccessible =====================================================
virtual OUString createAccessibleDescription()
Return this object's description.
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
virtual void SAL_CALL disposing() override
OUString msName
Name of this object.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or NULL if index is invalid.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual void SAL_CALL grabFocus() override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
virtual css::awt::Rectangle SAL_CALL getBounds() override
void CommitFocusLost() const
Calls all FocusListener to tell they that the focus is lost.
sal_uInt32 mnClientId
client id in the AccessibleEventNotifier queue
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================
virtual css::lang::Locale SAL_CALL getLocale() override
Return the parents locale or throw exception if this object has no parent yet/anymore.
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
void CommitFocusGained() const
Calls all FocusListener to tell they that the focus is gained.
css::uno::Reference< css::accessibility::XAccessible > mxParent
Reference to the parent object.
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
Return this objects index among the parents children.
virtual sal_Int32 SAL_CALL getBackground() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
virtual OUString createAccessibleName()
Return the object's current name.
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Return this object's role.
virtual tools::Rectangle GetBoundingBox() const
Return the object's current bounding box relative to the parent object.
ScAccessibleContextBase(css::uno::Reference< css::accessibility::XAccessible > xParent, const sal_Int16 aRole)
void CommitChange(const css::accessibility::AccessibleEventObject &rEvent) const
Calls all Listener to tell they the change.
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual sal_Int32 SAL_CALL getForeground() override
sal_Int16 maRole
This is the role of this object.
virtual OUString SAL_CALL getAccessibleName() override
Return the object's current name.
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static TClientId registerClient()
static void revokeClient(const TClientId _nClient)
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
css::awt::Size AWTSize(const Size &rVCLSize)
css::awt::Point AWTPoint(const ::Point &rVCLPoint)
css::awt::Rectangle AWTRectangle(const ::tools::Rectangle &rVCLRect)
inline ::tools::Rectangle VCLRectangle(const css::awt::Rectangle &rAWTRect)
inline ::Point VCLPoint(const css::awt::Point &rAWTPoint)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)