From f246eb7405930e70753ea5a65ffe9529e46542a2 Mon Sep 17 00:00:00 2001 From: Thomas Benisch Date: Tue, 21 Jul 2009 14:09:00 +0000 Subject: #i12587# Inserting/editing arbitrary text objects in chart --- chart2/source/controller/inc/AccessibleBase.hxx | 20 +++++++++++---- .../source/controller/inc/AccessibleChartView.hxx | 15 ++++++++--- chart2/source/controller/inc/ObjectHierarchy.hxx | 30 ++++++++++++---------- 3 files changed, 43 insertions(+), 22 deletions(-) (limited to 'chart2/source/controller/inc') diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx index c7101385da0d..17143f287a10 100644 --- a/chart2/source/controller/inc/AccessibleBase.hxx +++ b/chart2/source/controller/inc/AccessibleBase.hxx @@ -30,6 +30,8 @@ #ifndef _CHART2_ACCESSIBLEBASE_HXX_ #define _CHART2_ACCESSIBLEBASE_HXX_ +#include "ObjectIdentifier.hxx" + #include #include #include @@ -53,6 +55,12 @@ class SfxItemSet; class SdrObject; +class SdrView; + +namespace accessibility +{ +class IAccessibleViewForwarder; +} namespace chart { @@ -60,11 +68,11 @@ namespace chart class AccessibleBase; class ObjectHierarchy; -typedef rtl::OUString AccessibleUniqueId; +typedef ObjectIdentifier AccessibleUniqueId; struct AccessibleElementInfo { - AccessibleUniqueId m_aCID; + AccessibleUniqueId m_aOID; ::com::sun::star::uno::WeakReference< ::com::sun::star::chart2::XChartDocument > m_xChartDocument; @@ -78,6 +86,8 @@ struct AccessibleElementInfo ::boost::shared_ptr< ObjectHierarchy > m_spObjectHierarchy; AccessibleBase * m_pParent; + SdrView* m_pSdrView; + ::accessibility::IAccessibleViewForwarder* m_pViewForwarder; }; @@ -176,7 +186,7 @@ protected: greater than the index of the removed element get an index one less than before. */ - void RemoveChildById( const ::rtl::OUString & rId ); + void RemoveChildByOId( const ObjectIdentifier& rOId ); /** Retrieve the pixel coordinates of logical coordinates (0,0) of the current logic coordinate system. This can be used for @@ -328,14 +338,14 @@ private: /** type of the hash containing a vector index for every AccessibleUniqueId of the object in the child list */ - typedef ::std::map< ::rtl::OUString, tAccessible > ChildCIDMap; + typedef ::std::map< ObjectIdentifier, tAccessible > ChildOIDMap; bool m_bIsDisposed; const bool m_bMayHaveChildren; bool m_bChildrenInitialized; ChildListVectorType m_aChildList; - ChildCIDMap m_aChildCIDMap; + ChildOIDMap m_aChildOIDMap; ::comphelper::AccessibleEventNotifier::TClientId m_nEventNotifierId; diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx index 22d5f7a41252..633b7b220193 100644 --- a/chart2/source/controller/inc/AccessibleChartView.hxx +++ b/chart2/source/controller/inc/AccessibleChartView.hxx @@ -47,13 +47,17 @@ #include +namespace accessibility +{ +class IAccessibleViewForwarder; +} + //............................................................................. namespace chart { //............................................................................. class ExplicitValueProvider; -class ObjectHierarchy; namespace impl { @@ -71,13 +75,15 @@ public: AccessibleChartView( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext ); + AccessibleChartView( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext >& xContext, SdrView* pView ); virtual ~AccessibleChartView(); // ____ lang::XServiceInfo ____ APPHELPER_XSERVICEINFO_DECL() APPHELPER_SERVICE_FACTORY_HELPER( AccessibleChartView ) -protected: // ____ WeakComponentHelper (called from XComponent::dispose()) ____ virtual void SAL_CALL disposing(); @@ -115,6 +121,7 @@ protected: virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException); +protected: // ________ AccessibleChartElement ________ virtual ::com::sun::star::awt::Point GetUpperLeftOnScreen() const; @@ -144,7 +151,9 @@ private: // members ::com::sun::star::accessibility::XAccessible > m_xParent; ::boost::shared_ptr< ObjectHierarchy > m_spObjectHierarchy; - AccessibleUniqueId m_aCurrentSelectionCID; + AccessibleUniqueId m_aCurrentSelectionOID; + SdrView* m_pSdrView; + ::accessibility::IAccessibleViewForwarder* m_pViewForwarder; //no default constructor AccessibleChartView(); diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx index f0614f7a6d86..b4a2bdbbfb69 100644 --- a/chart2/source/controller/inc/ObjectHierarchy.hxx +++ b/chart2/source/controller/inc/ObjectHierarchy.hxx @@ -30,6 +30,8 @@ #ifndef CHART2_OBJECTHIERARCHY_HXX #define CHART2_OBJECTHIERARCHY_HXX +#include "ObjectIdentifier.hxx" + #include #include #include @@ -50,8 +52,8 @@ class ImplObjectHierarchy; class ObjectHierarchy { public: - typedef ::rtl::OUString tCID; - typedef ::std::vector< tCID > tChildContainer; + typedef ObjectIdentifier tOID; + typedef ::std::vector< tOID > tChildContainer; /** @param bFlattenDiagram If , the content of the diaram (data series, wall, floor, @@ -65,20 +67,20 @@ public: bool bFlattenDiagram = false ); ~ObjectHierarchy(); - static tCID getRootNodeCID(); - static bool isRootNode( const tCID & rCID ); + static tOID getRootNodeOID(); + static bool isRootNode( const tOID& rOID ); - /// equal to getChildren( getRootNodeCID()) + /// equal to getChildren( getRootNodeOID()) tChildContainer getTopLevelChildren() const; - bool hasChildren( const tCID & rParent ) const; - tChildContainer getChildren( const tCID & rParent ) const; + bool hasChildren( const tOID& rParent ) const; + tChildContainer getChildren( const tOID& rParent ) const; - tChildContainer getSiblings( const tCID & rNode ) const; + tChildContainer getSiblings( const tOID& rNode ) const; /// The result is empty, if the node cannot be found in the tree - tCID getParent( const tCID & rNode ) const; + tOID getParent( const tOID& rNode ) const; /// @returns -1, if no parent can be determined - sal_Int32 getIndexInParent( const tCID & rNode ) const; + sal_Int32 getIndexInParent( const tOID& rNode ) const; private: @@ -88,16 +90,16 @@ private: class ObjectKeyNavigation { public: - explicit ObjectKeyNavigation( const ObjectHierarchy::tCID & rCurrentCID, + explicit ObjectKeyNavigation( const ObjectHierarchy::tOID & rCurrentOID, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > & xChartDocument, ExplicitValueProvider * pExplicitValueProvider = 0 ); bool handleKeyEvent( const ::com::sun::star::awt::KeyEvent & rEvent ); - ObjectHierarchy::tCID getCurrentSelection() const; + ObjectHierarchy::tOID getCurrentSelection() const; private: - void setCurrentSelection( const ObjectHierarchy::tCID & rCID ); + void setCurrentSelection( const ObjectHierarchy::tOID& rOID ); bool first(); bool last(); bool next(); @@ -107,7 +109,7 @@ private: bool veryFirst(); bool veryLast(); - ObjectHierarchy::tCID m_aCurrentCID; + ObjectHierarchy::tOID m_aCurrentOID; ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xChartDocument; ExplicitValueProvider * m_pExplicitValueProvider; -- cgit