1*de7b3f82SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*de7b3f82SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*de7b3f82SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*de7b3f82SAndrew Rist * distributed with this work for additional information 6*de7b3f82SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*de7b3f82SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*de7b3f82SAndrew Rist * "License"); you may not use this file except in compliance 9*de7b3f82SAndrew Rist * with the License. You may obtain a copy of the License at 10*de7b3f82SAndrew Rist * 11*de7b3f82SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*de7b3f82SAndrew Rist * 13*de7b3f82SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*de7b3f82SAndrew Rist * software distributed under the License is distributed on an 15*de7b3f82SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*de7b3f82SAndrew Rist * KIND, either express or implied. See the License for the 17*de7b3f82SAndrew Rist * specific language governing permissions and limitations 18*de7b3f82SAndrew Rist * under the License. 19*de7b3f82SAndrew Rist * 20*de7b3f82SAndrew Rist *************************************************************/ 21*de7b3f82SAndrew Rist 22*de7b3f82SAndrew Rist 23cdf0e10cSrcweir #ifndef CHART_DIAGRAMWRAPPER_HXX 24cdf0e10cSrcweir #define CHART_DIAGRAMWRAPPER_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "WrappedPropertySet.hxx" 27cdf0e10cSrcweir #include "ServiceMacros.hxx" 28cdf0e10cSrcweir #include "DiagramHelper.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13) 31cdf0e10cSrcweir #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13 32cdf0e10cSrcweir #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13 33cdf0e10cSrcweir #include "comphelper/implbase_var.hxx" 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include <comphelper/uno3.hxx> 37cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx> 38cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp> 39cdf0e10cSrcweir #include <com/sun/star/chart2/XDiagram.hpp> 40cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 41cdf0e10cSrcweir #include <com/sun/star/chart/XDiagramPositioning.hpp> 42cdf0e10cSrcweir #include <com/sun/star/chart2/XDiagramProvider.hpp> 43cdf0e10cSrcweir #include <com/sun/star/chart2/XChartTypeTemplate.hpp> 44cdf0e10cSrcweir #include <com/sun/star/chart2/XChartTypeManager.hpp> 45cdf0e10cSrcweir #include <com/sun/star/chart/XDiagram.hpp> 46cdf0e10cSrcweir #include <com/sun/star/chart/XAxisSupplier.hpp> 47cdf0e10cSrcweir #include <com/sun/star/chart/XAxisZSupplier.hpp> 48cdf0e10cSrcweir #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> 49cdf0e10cSrcweir #include <com/sun/star/chart/XTwoAxisYSupplier.hpp> 50cdf0e10cSrcweir #include <com/sun/star/chart/XStatisticDisplay.hpp> 51cdf0e10cSrcweir #include <com/sun/star/chart/X3DDisplay.hpp> 52cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 53cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 54cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp> 55cdf0e10cSrcweir #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp> 56cdf0e10cSrcweir 57cdf0e10cSrcweir #include <com/sun/star/chart/X3DDefaultSetter.hpp> 58cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 59cdf0e10cSrcweir 60cdf0e10cSrcweir namespace chart 61cdf0e10cSrcweir { 62cdf0e10cSrcweir namespace wrapper 63cdf0e10cSrcweir { 64cdf0e10cSrcweir 65cdf0e10cSrcweir class Chart2ModelContact; 66cdf0e10cSrcweir 67cdf0e10cSrcweir class DiagramWrapper : public ::comphelper::ImplInheritanceHelper13< 68cdf0e10cSrcweir WrappedPropertySet 69cdf0e10cSrcweir , ::com::sun::star::chart::XDiagram 70cdf0e10cSrcweir , ::com::sun::star::chart::XAxisSupplier 71cdf0e10cSrcweir , ::com::sun::star::chart::XAxisZSupplier 72cdf0e10cSrcweir , ::com::sun::star::chart::XTwoAxisXSupplier // : XAxisXSupplier 73cdf0e10cSrcweir , ::com::sun::star::chart::XTwoAxisYSupplier // : XAxisYSupplier 74cdf0e10cSrcweir , ::com::sun::star::chart::XStatisticDisplay 75cdf0e10cSrcweir , ::com::sun::star::chart::X3DDisplay 76cdf0e10cSrcweir , ::com::sun::star::chart::X3DDefaultSetter 77cdf0e10cSrcweir , ::com::sun::star::lang::XServiceInfo 78cdf0e10cSrcweir , ::com::sun::star::lang::XComponent 79cdf0e10cSrcweir // , ::com::sun::star::lang::XEventListener 80cdf0e10cSrcweir , ::com::sun::star::chart::XDiagramPositioning 81cdf0e10cSrcweir , ::com::sun::star::chart2::XDiagramProvider 82cdf0e10cSrcweir , ::com::sun::star::chart::XSecondAxisTitleSupplier 83cdf0e10cSrcweir > 84cdf0e10cSrcweir { 85cdf0e10cSrcweir public: 86cdf0e10cSrcweir DiagramWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ); 87cdf0e10cSrcweir virtual ~DiagramWrapper(); 88cdf0e10cSrcweir 89cdf0e10cSrcweir /// XServiceInfo declarations 90cdf0e10cSrcweir APPHELPER_XSERVICEINFO_DECL() 91cdf0e10cSrcweir 92cdf0e10cSrcweir // ____ XComponent ____ 93cdf0e10cSrcweir virtual void SAL_CALL dispose() 94cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 96cdf0e10cSrcweir ::com::sun::star::lang::XEventListener >& xListener ) 97cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 98cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 99cdf0e10cSrcweir ::com::sun::star::lang::XEventListener >& aListener ) 100cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir 102cdf0e10cSrcweir // ____ XDiagram ____ 103cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getDiagramType() 104cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 106cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 nRow ) 107cdf0e10cSrcweir throw (::com::sun::star::lang::IndexOutOfBoundsException, 108cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 110cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow ) 111cdf0e10cSrcweir throw (::com::sun::star::lang::IndexOutOfBoundsException, 112cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir 114cdf0e10cSrcweir // ____ XShape (base of XDiagram) ____ 115cdf0e10cSrcweir virtual ::com::sun::star::awt::Point SAL_CALL getPosition() 116cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 117cdf0e10cSrcweir virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) 118cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 119cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getSize() 120cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 121cdf0e10cSrcweir virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) 122cdf0e10cSrcweir throw (::com::sun::star::beans::PropertyVetoException, 123cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 124cdf0e10cSrcweir 125cdf0e10cSrcweir // ____ XShapeDescriptor (base of XShape) ____ 126cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getShapeType() 127cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 128cdf0e10cSrcweir 129cdf0e10cSrcweir // ____ XAxisSupplier ____ 130cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 131cdf0e10cSrcweir ::com::sun::star::chart::XAxis > SAL_CALL getAxis( sal_Int32 nDimensionIndex ) 132cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 133cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 134cdf0e10cSrcweir ::com::sun::star::chart::XAxis > SAL_CALL getSecondaryAxis( sal_Int32 nDimensionIndex ) 135cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 136cdf0e10cSrcweir 137cdf0e10cSrcweir // ____ XAxisZSupplier ____ 138cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 139cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle() 140cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 141cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 142cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getZMainGrid() 143cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 144cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 145cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getZHelpGrid() 146cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 147cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 148cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getZAxis() 149cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 150cdf0e10cSrcweir 151cdf0e10cSrcweir // ____ XTwoAxisXSupplier ____ 152cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 153cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryXAxis() 154cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 155cdf0e10cSrcweir 156cdf0e10cSrcweir // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____ 157cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 158cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getXAxisTitle() 159cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 160cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 161cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getXAxis() 162cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 163cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 164cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getXMainGrid() 165cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 166cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 167cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getXHelpGrid() 168cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 169cdf0e10cSrcweir 170cdf0e10cSrcweir // ____ XTwoAxisYSupplier ____ 171cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 172cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryYAxis() 173cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 174cdf0e10cSrcweir 175cdf0e10cSrcweir // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____ 176cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 177cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getYAxisTitle() 178cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 179cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 180cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getYAxis() 181cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 182cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 183cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getYHelpGrid() 184cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 185cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 186cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getYMainGrid() 187cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 188cdf0e10cSrcweir 189cdf0e10cSrcweir // ____ XSecondAxisTitleSupplier ____ 190cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 191cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getSecondXAxisTitle() 192cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 193cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 194cdf0e10cSrcweir ::com::sun::star::drawing::XShape > SAL_CALL getSecondYAxisTitle() 195cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 196cdf0e10cSrcweir 197cdf0e10cSrcweir // ____ XStatisticDisplay ____ 198cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 199cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getUpBar() 200cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 201cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 202cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getDownBar() 203cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 204cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 205cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getMinMaxLine() 206cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 207cdf0e10cSrcweir 208cdf0e10cSrcweir // ____ X3DDisplay ____ 209cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 210cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getWall() 211cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 212cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 213cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor() 214cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 215cdf0e10cSrcweir 216cdf0e10cSrcweir // ____ X3DDefaultSetter ____ 217cdf0e10cSrcweir virtual void SAL_CALL set3DSettingsToDefault() throw (::com::sun::star::uno::RuntimeException); 218cdf0e10cSrcweir virtual void SAL_CALL setDefaultRotation() throw (::com::sun::star::uno::RuntimeException); 219cdf0e10cSrcweir virtual void SAL_CALL setDefaultIllumination() throw (::com::sun::star::uno::RuntimeException); 220cdf0e10cSrcweir 221cdf0e10cSrcweir // // ____ XEventListener ____ 222cdf0e10cSrcweir // virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) 223cdf0e10cSrcweir // throw (::com::sun::star::uno::RuntimeException); 224cdf0e10cSrcweir 225cdf0e10cSrcweir // ____ XDiagramPositioning ____ 226cdf0e10cSrcweir 227cdf0e10cSrcweir virtual void SAL_CALL setAutomaticDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException); 228cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isAutomaticDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException); 229cdf0e10cSrcweir virtual void SAL_CALL setDiagramPositionExcludingAxes( const ::com::sun::star::awt::Rectangle& PositionRect ) throw (::com::sun::star::uno::RuntimeException); 230cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL isExcludingDiagramPositioning( ) throw (::com::sun::star::uno::RuntimeException); 231cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL calculateDiagramPositionExcludingAxes( ) throw (::com::sun::star::uno::RuntimeException); 232cdf0e10cSrcweir virtual void SAL_CALL setDiagramPositionIncludingAxes( const ::com::sun::star::awt::Rectangle& PositionRect ) throw (::com::sun::star::uno::RuntimeException); 233cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL calculateDiagramPositionIncludingAxes( ) throw (::com::sun::star::uno::RuntimeException); 234cdf0e10cSrcweir virtual void SAL_CALL setDiagramPositionIncludingAxesAndAxisTitles( const ::com::sun::star::awt::Rectangle& PositionRect ) throw (::com::sun::star::uno::RuntimeException); 235cdf0e10cSrcweir virtual ::com::sun::star::awt::Rectangle SAL_CALL calculateDiagramPositionIncludingAxesAndAxisTitles( ) throw (::com::sun::star::uno::RuntimeException); 236cdf0e10cSrcweir 237cdf0e10cSrcweir // ____ XDiagramProvider ____ 238cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 239cdf0e10cSrcweir ::com::sun::star::chart2::XDiagram > SAL_CALL getDiagram() 240cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 241cdf0e10cSrcweir virtual void SAL_CALL setDiagram( const ::com::sun::star::uno::Reference< 242cdf0e10cSrcweir ::com::sun::star::chart2::XDiagram >& xDiagram ) 243cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 244cdf0e10cSrcweir 245cdf0e10cSrcweir protected: 246cdf0e10cSrcweir // ____ WrappedPropertySet ____ 247cdf0e10cSrcweir virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence(); 248cdf0e10cSrcweir virtual const std::vector< WrappedProperty* > createWrappedProperties(); 249cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getInnerPropertySet(); 250cdf0e10cSrcweir 251cdf0e10cSrcweir private: 252cdf0e10cSrcweir void updateFromModel(); 253cdf0e10cSrcweir 254cdf0e10cSrcweir ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 255cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; 256cdf0e10cSrcweir 257cdf0e10cSrcweir ::com::sun::star::uno::Reference< 258cdf0e10cSrcweir ::com::sun::star::chart::XAxis > m_xXAxis; 259cdf0e10cSrcweir ::com::sun::star::uno::Reference< 260cdf0e10cSrcweir ::com::sun::star::chart::XAxis > m_xYAxis; 261cdf0e10cSrcweir ::com::sun::star::uno::Reference< 262cdf0e10cSrcweir ::com::sun::star::chart::XAxis > m_xZAxis; 263cdf0e10cSrcweir ::com::sun::star::uno::Reference< 264cdf0e10cSrcweir ::com::sun::star::chart::XAxis > m_xSecondXAxis; 265cdf0e10cSrcweir ::com::sun::star::uno::Reference< 266cdf0e10cSrcweir ::com::sun::star::chart::XAxis > m_xSecondYAxis; 267cdf0e10cSrcweir 268cdf0e10cSrcweir ::com::sun::star::uno::Reference< 269cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xWall; 270cdf0e10cSrcweir ::com::sun::star::uno::Reference< 271cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xFloor; 272cdf0e10cSrcweir 273cdf0e10cSrcweir ::com::sun::star::uno::Reference< 274cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xMinMaxLineWrapper; 275cdf0e10cSrcweir ::com::sun::star::uno::Reference< 276cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xUpBarWrapper; 277cdf0e10cSrcweir ::com::sun::star::uno::Reference< 278cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xDownBarWrapper; 279cdf0e10cSrcweir }; 280cdf0e10cSrcweir 281cdf0e10cSrcweir } // namespace wrapper 282cdf0e10cSrcweir } // namespace chart 283cdf0e10cSrcweir 284cdf0e10cSrcweir // CHART_DIAGRAMWRAPPER_HXX 285cdf0e10cSrcweir #endif 286