diff options
Diffstat (limited to 'sc/source/ui/inc/AccessibleContextBase.hxx')
-rw-r--r-- | sc/source/ui/inc/AccessibleContextBase.hxx | 87 |
1 files changed, 15 insertions, 72 deletions
diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx index d683dee6c2d2..526727e4a242 100644 --- a/sc/source/ui/inc/AccessibleContextBase.hxx +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -25,35 +25,21 @@ #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/accessiblecomponenthelper.hxx> +#include <cppuhelper/implbase.hxx> #include <cppuhelper/interfacecontainer.h> #include <svl/lstner.hxx> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/implbase1.hxx> #include <rtl/ref.hxx> namespace tools { class Rectangle; } class AbsoluteScreenPixelRectangle; -/** @descr - This base class provides an implementation of the - <code>AccessibleContext</code> service. -*/ -typedef cppu::WeakComponentImplHelper< - css::accessibility::XAccessible, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleEventBroadcaster, - css::lang::XServiceInfo - > ScAccessibleContextBaseWeakImpl; - class ScAccessibleContextBase - : public cppu::BaseMutex, - public ScAccessibleContextBaseWeakImpl, - public SfxListener + : public cppu::ImplInheritanceHelper<comphelper::OAccessibleComponentHelper, + css::accessibility::XAccessible, css::lang::XServiceInfo>, + public SfxListener { -class ScAccessibleContextBaseEventListener; public: //===== internal ======================================================== @@ -83,23 +69,13 @@ public: virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext() override; - ///===== XAccessibleComponent ============================================ - - virtual sal_Bool SAL_CALL containsPoint( - const css::awt::Point& rPoint ) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > - SAL_CALL getAccessibleAtPoint( - const css::awt::Point& rPoint ) override; - - virtual css::awt::Rectangle SAL_CALL getBounds( ) override; + // OAccessibleComponentHelper + virtual css::awt::Rectangle implGetBounds() override; - virtual css::awt::Point SAL_CALL getLocation( ) override; + ///===== XAccessibleComponent ============================================ virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; - virtual css::awt::Size SAL_CALL getSize( ) override; - virtual void SAL_CALL grabFocus( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; @@ -108,21 +84,10 @@ public: ///===== XAccessibleContext ============================================== - /// Return the number of currently visible children. - virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; - - /// Return the specified child or NULL if index is invalid. - virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL - getAccessibleChild(sal_Int64 nIndex) override; - /// Return a reference to the parent. virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleParent() override; - /// Return this objects index among the parents children. - virtual sal_Int64 SAL_CALL - getAccessibleIndexInParent() override; - /// Return this object's role. virtual sal_Int16 SAL_CALL getAccessibleRole() override; @@ -148,20 +113,6 @@ public: virtual css::lang::Locale SAL_CALL getLocale() override; - ///===== XAccessibleEventBroadcaster ===================================== - - /** Add listener that is informed of future changes of name, - description and so on events. - */ - virtual void SAL_CALL - addAccessibleEventListener( - const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override; - - // Remove an existing event listener. - virtual void SAL_CALL - removeAccessibleEventListener( - const css::uno::Reference<css::accessibility::XAccessibleEventListener>& xListener) override; - ///===== XServiceInfo ==================================================== /** Returns an identifier for the implementation of this object. @@ -196,17 +147,17 @@ protected: /// Return the object's current bounding box relative to the desktop. /// /// @throws css::uno::RuntimeException - virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const; + virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() const = 0; /// Return the object's current bounding box relative to the parent object. /// /// @throws css::uno::RuntimeException - virtual tools::Rectangle GetBoundingBox() const; + virtual tools::Rectangle GetBoundingBox() const = 0; public: - /// Calls all Listener to tell they the change. - void - CommitChange(const css::accessibility::AccessibleEventObject& rEvent) const; + /// Calls all listeners to notify them about the change. + void CommitChange(const sal_Int16 nEventId, const css::uno::Any& rOldValue, + const css::uno::Any& rNewValue, sal_Int32 nIndexHint = -1); /// Use this method to set initial Name without notification void SetName(const OUString& rName) { msName = rName; } @@ -218,16 +169,13 @@ public: protected: /// Calls all FocusListener to tell they that the focus is gained. - void CommitFocusGained() const; + void CommitFocusGained(); /// Calls all FocusListener to tell they that the focus is lost. - void CommitFocusLost() const; + void CommitFocusLost(); bool IsDefunc() const { return rBHelper.bDisposed; } - /// @throws css::lang::DisposedException - void IsObjectValid() const; - /// Reference to the parent object. css::uno::Reference<css::accessibility::XAccessible> mxParent; @@ -243,14 +191,9 @@ private: */ OUString msName; - /// client id in the AccessibleEventNotifier queue - sal_uInt32 mnClientId; - /** This is the role of this object. */ sal_Int16 maRole; - - rtl::Reference<ScAccessibleContextBaseEventListener> mxEventListener; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |