From 79daf40ec696e0855d4a2894f048e44188cfbbb6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jun 2018 15:02:49 +0100 Subject: weld SvxAreaTabPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which itself has 5 sub tab pages Change-Id: If71e91248b5771af4845ad6dba997ac4c7841b5d Reviewed-on: https://gerrit.libreoffice.org/56112 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/inc/svxpixelctlaccessiblecontext.hxx | 191 +++++++----------------- svx/source/inc/svxrectctaccessiblecontext.hxx | 19 +-- 2 files changed, 66 insertions(+), 144 deletions(-) (limited to 'svx/source/inc') diff --git a/svx/source/inc/svxpixelctlaccessiblecontext.hxx b/svx/source/inc/svxpixelctlaccessiblecontext.hxx index 4f399ea4a7a8..23af17a5c2ea 100644 --- a/svx/source/inc/svxpixelctlaccessiblecontext.hxx +++ b/svx/source/inc/svxpixelctlaccessiblecontext.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -51,197 +52,121 @@ namespace com { namespace sun { namespace star { namespace awt { class XFocusListener; } } } }; class SvxPixelCtl; +class SvxPixelCtlAccessible; +typedef ::cppu::ImplHelper1 OAccessibleHelper_Base; -typedef ::cppu::WeakAggComponentImplHelper5< - css::accessibility::XAccessible, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleEventBroadcaster, - css::lang::XServiceInfo > - SvxPixelCtlAccessibleChild_BASE; - -class SvxPixelCtlAccessibleChild : - public ::cppu::BaseMutex, - public SvxPixelCtlAccessibleChild_BASE +class SvxPixelCtlAccessibleChild final : public ::comphelper::OAccessibleComponentHelper, + public OAccessibleHelper_Base { - SvxPixelCtl& mrParentWindow; - css::uno::Reference< css::accessibility::XAccessible > mxParent; - bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color - tools::Rectangle maBoundingBox; - /// index of child in parent - long mnIndexInParent; public: SvxPixelCtlAccessibleChild( SvxPixelCtl& rWindow, bool bPixelColorOrBG, const tools::Rectangle& rBounds, - const css::uno::Reference< css::accessibility::XAccessible >& xParent, + const rtl::Reference& xParent, long nIndexInParent ); - virtual ~SvxPixelCtlAccessibleChild() override; - //XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; + DECLARE_XINTERFACE( ) + DECLARE_XTYPEPROVIDER( ) + + //XAccessibleComponent + virtual void SAL_CALL grabFocus( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; //XAccessibleContext virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; - virtual css::lang::Locale SAL_CALL getLocale( ) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; + //XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; - //XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) override; - virtual css::awt::Point SAL_CALL getLocation( ) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; - virtual css::awt::Size SAL_CALL getSize( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override; - virtual void SAL_CALL grabFocus( ) override; - - //XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - - //Methods for XAccessibleEventBroadcaster - sal_uInt32 mnClientId; - - virtual void SAL_CALL - addAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - - virtual void SAL_CALL - removeAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - - //Solution: Add the event handling method - void FireAccessibleEvent (short nEventId, const css::uno::Any& rOld, const css::uno::Any& rNew); - virtual void SAL_CALL disposing() override; - - /// @throws css::uno::RuntimeException - tools::Rectangle GetBoundingBoxOnScreen(); - - /// @throws css::uno::RuntimeException - tools::Rectangle const & GetBoundingBox(); - - /// @returns true if it's disposed or in disposing - inline bool IsAlive() const; - /// @throws css::lang::DisposedException if it's not alive - void ThrowExceptionIfNotAlive(); - void CheckChild(); void SelectChild( bool bSelect); void ChangePixelColorOrBG(bool bPixelColorOrBG){ m_bPixelColorOrBG = bPixelColorOrBG ;} OUString GetName(); -}; +private: + virtual ~SvxPixelCtlAccessibleChild() override; -typedef ::cppu::WeakAggComponentImplHelper6< - css::accessibility::XAccessible, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleEventBroadcaster, - css::accessibility::XAccessibleSelection, - css::lang::XServiceInfo > - SvxPixelCtlAccessible_BASE; + virtual void SAL_CALL disposing() override; -class SvxPixelCtlAccessible : - public ::cppu::BaseMutex, - public SvxPixelCtlAccessible_BASE -{ - SvxPixelCtl& mrPixelCtl; + // OCommonAccessibleComponent + /// implements the calculation of the bounding rectangle + virtual css::awt::Rectangle implGetBounds( ) override; + SvxPixelCtl& mrParentWindow; + rtl::Reference mxParent; + bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color + tools::Rectangle maBoundingBox; + /// index of child in parent + long mnIndexInParent; +}; + +class SvxPixelCtlAccessible final : public ::comphelper::OAccessibleSelectionHelper, + public OAccessibleHelper_Base +{ public: - SvxPixelCtlAccessible(SvxPixelCtl& rWindow); - virtual ~SvxPixelCtlAccessible() override; + SvxPixelCtlAccessible(SvxPixelCtl* pPixelCtl); - //XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; + DECLARE_XINTERFACE( ) + DECLARE_XTYPEPROVIDER( ) + + //XAccessibleComponent + virtual void SAL_CALL grabFocus( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; + //XAccessible //XAccessibleContext virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) override; virtual sal_Int16 SAL_CALL getAccessibleRole( ) override; virtual OUString SAL_CALL getAccessibleDescription( ) override; virtual OUString SAL_CALL getAccessibleName( ) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; - virtual css::lang::Locale SAL_CALL getLocale( ) override; - + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override; - //XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) override; - virtual css::awt::Point SAL_CALL getLocation( ) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override; - virtual css::awt::Size SAL_CALL getSize( ) override; + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override; virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override; - virtual void SAL_CALL grabFocus( ) override; - //XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // XAccessibleSelection - void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override; - sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override; - void SAL_CALL clearAccessibleSelection( ) override; - void SAL_CALL selectAllAccessibleChildren( ) override; - sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override; - void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) override; - - //Methods for XAccessibleEventBroadcaster - sal_uInt32 mnClientId; - - virtual void SAL_CALL - addAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - - virtual void SAL_CALL - removeAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - //Solution: Add the event handling method - void FireAccessibleEvent (short nEventId, const css::uno::Any& rOld, const css::uno::Any& rNew); - virtual void SAL_CALL disposing() override; css::uno::Reference< css::accessibility::XAccessible > CreateChild (long nIndex, Point mPoint); void LoseFocus(); - /// @returns true if it's disposed or in disposing - inline bool IsAlive() const; +private: + virtual ~SvxPixelCtlAccessible() override; + + // OCommonAccessibleSelection + // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) + virtual bool implIsSelected(sal_Int32 nAccessibleChildIndex) override; + + // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx) + virtual void implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) override; -protected: + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds() override; + + virtual void SAL_CALL disposing() override; + + SvxPixelCtl* mpPixelCtl; css::uno::Reference< css::accessibility::XAccessible> m_xCurChild; + public: void NotifyChild(long nIndex, bool bSelect, bool bCheck); }; -inline bool SvxPixelCtlAccessible::IsAlive() const -{ - return !rBHelper.bDisposed && !rBHelper.bInDispose; -} - -inline bool SvxPixelCtlAccessibleChild::IsAlive() const -{ - return !rBHelper.bDisposed && !rBHelper.bInDispose; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/inc/svxrectctaccessiblecontext.hxx b/svx/source/inc/svxrectctaccessiblecontext.hxx index de5df8a46ad7..6e3fb5b509bd 100644 --- a/svx/source/inc/svxrectctaccessiblecontext.hxx +++ b/svx/source/inc/svxrectctaccessiblecontext.hxx @@ -545,8 +545,8 @@ typedef ::cppu::ImplHelper3 < css::accessibility::XAccessible, css::accessibility::XAccessibleAction > OAccessibleHelper_Base_3; -class RectCtlChildAccessibleContext : public ::comphelper::OAccessibleComponentHelper, - public OAccessibleHelper_Base_3 +class RectCtlChildAccessibleContext final : public ::comphelper::OAccessibleComponentHelper, + public OAccessibleHelper_Base_3 { public: RectCtlChildAccessibleContext( @@ -554,13 +554,6 @@ public: const OUString& rName, const OUString& rDescription, const tools::Rectangle& rBoundingBox, long nIndexInParent ); -protected: - virtual ~RectCtlChildAccessibleContext() override; - - // OCommonAccessibleComponent - /// implements the calculation of the bounding rectangle - still waiting to be overwritten - virtual css::awt::Rectangle implGetBounds( ) override; -public: DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) @@ -608,10 +601,14 @@ public: void setStateChecked(bool bChecked); void FireFocusEvent(); -protected: +private: + virtual ~RectCtlChildAccessibleContext() override; + virtual void SAL_CALL disposing() override; -private: + // OCommonAccessibleComponent + /// implements the calculation of the bounding rectangle + virtual css::awt::Rectangle implGetBounds( ) override; /** Description of this object. This is not a constant because it can be set from the outside. Furthermore, it changes according to the -- cgit