1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef SC_VBA_CHART_HXX 28 #define SC_VBA_CHART_HXX 29 #include <cppuhelper/implbase1.hxx> 30 #include <com/sun/star/uno/XComponentContext.hpp> 31 #include <com/sun/star/table/XTableChart.hpp> 32 #include <com/sun/star/chart/XChartDocument.hpp> 33 #include <com/sun/star/chart/XAxisXSupplier.hpp> 34 #include <com/sun/star/chart/XAxisYSupplier.hpp> 35 #include <com/sun/star/chart/XAxisZSupplier.hpp> 36 #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> 37 #include <com/sun/star/chart/XTwoAxisYSupplier.hpp> 38 #include <ooo/vba/excel/XChart.hpp> 39 #include <ooo/vba/excel/XDataLabels.hpp> 40 #include <ooo/vba/excel/XSeries.hpp> 41 #include <vbahelper/vbahelperinterface.hxx> 42 43 typedef InheritedHelperInterfaceImpl1<ov::excel::XChart > ChartImpl_BASE; 44 45 class ScVbaChart : public ChartImpl_BASE 46 { 47 friend class ScVbaAxis; 48 49 css::uno::Reference< css::chart::XChartDocument > mxChartDocument; 50 css::uno::Reference< css::table::XTableChart > mxTableChart; 51 css::uno::Reference< css::beans::XPropertySet > mxDiagramPropertySet; 52 css::uno::Reference< css::beans::XPropertySet > mxChartPropertySet; 53 css::uno::Reference< css::chart::XAxisXSupplier > xAxisXSupplier; 54 css::uno::Reference< css::chart::XAxisYSupplier> xAxisYSupplier; 55 css::uno::Reference< css::chart::XAxisZSupplier > xAxisZSupplier; 56 css::uno::Reference< css::chart::XTwoAxisXSupplier > xTwoAxisXSupplier; 57 css::uno::Reference< css::chart::XTwoAxisYSupplier > xTwoAxisYSupplier; 58 59 css::uno::Sequence< rtl::OUString > getDefaultSeriesDescriptions( sal_Int32 nCount ); 60 css::uno::Sequence< css::uno::Sequence< double > > dblValues; 61 void setDefaultChartType()throw ( css::script::BasicErrorException ) ; 62 void setDiagram( const rtl::OUString& _sDiagramType) throw( css::script::BasicErrorException ); 63 bool isStacked() throw ( css::uno::RuntimeException ); 64 bool is100PercentStacked() throw ( css::uno::RuntimeException ); 65 sal_Int32 getStackedType( sal_Int32 _nStacked, sal_Int32 _n100PercentStacked, sal_Int32 _nUnStacked ) throw ( css::uno::RuntimeException ); 66 sal_Int32 getSolidType(sal_Int32 _nDeep, sal_Int32 _nVertiStacked, sal_Int32 _nVerti100PercentStacked, sal_Int32 _nVertiUnStacked, sal_Int32 _nHoriStacked, sal_Int32 _nHori100PercentStacked, sal_Int32 _nHoriUnStacked) throw ( css::script::BasicErrorException ); 67 sal_Int32 getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw (css::script::BasicErrorException); 68 bool hasMarkers() throw ( css::script::BasicErrorException ); 69 sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); 70 void assignDiagramAttributes(); 71 void setDefaultSeriesDescriptionLabels(){} 72 public: 73 ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart ); 74 75 // Non-interface 76 css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() { return mxDiagramPropertySet; } 77 bool isSeriesIndexValid(sal_Int32 _seriesindex) throw( css::script::BasicErrorException ); 78 bool areIndicesValid(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( css::script::BasicErrorException ); 79 void setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( css::script::BasicErrorException ); 80 sal_Int32 getSeriesIndex(rtl::OUString _sseriesname) throw ( css::script::BasicErrorException ); 81 sal_Int32 getSeriesCount() throw ( css::script::BasicErrorException ); 82 rtl::OUString getSeriesName(sal_Int32 _index) throw ( css::script::BasicErrorException ); 83 double getValue(sal_Int32 _seriesIndex, sal_Int32 _valindex) throw ( css::script::BasicErrorException ); 84 sal_Int32 getValuesCount(sal_Int32 _seriesIndex) throw ( css::script::BasicErrorException ); 85 css::uno::Reference< ov::excel::XDataLabels > DataLabels( const css::uno::Reference< ov::excel::XSeries > _oSeries ) throw ( css::script::BasicErrorException ); 86 bool getHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet )throw ( css::script::BasicErrorException ); 87 void setHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, bool _bHasDataLabels )throw ( css::script::BasicErrorException ); 88 bool is3D() throw ( css::uno::RuntimeException ); 89 css::uno::Reference< css::beans::XPropertySet > getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) throw ( css::script::BasicErrorException ); 90 // Methods 91 virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); 92 virtual css::uno::Any SAL_CALL SeriesCollection(const css::uno::Any&) throw (css::uno::RuntimeException); 93 virtual ::sal_Int32 SAL_CALL getChartType() throw ( css::uno::RuntimeException, css::script::BasicErrorException); 94 virtual void SAL_CALL setChartType( ::sal_Int32 _charttype ) throw ( css::uno::RuntimeException, css::script::BasicErrorException); 95 virtual void SAL_CALL Activate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 96 virtual void SAL_CALL setSourceData( const css::uno::Reference< ::ooo::vba::excel::XRange >& range, const css::uno::Any& PlotBy ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 97 virtual ::sal_Int32 SAL_CALL Location( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 98 virtual ::sal_Int32 SAL_CALL getLocation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 99 virtual void SAL_CALL setLocation( ::sal_Int32 where, const css::uno::Any& Name ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 100 virtual ::sal_Bool SAL_CALL getHasTitle( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 101 virtual void SAL_CALL setHasTitle( ::sal_Bool bTitle ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 102 virtual ::sal_Bool SAL_CALL getHasLegend( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 103 virtual void SAL_CALL setHasLegend( ::sal_Bool bLegend ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 104 virtual void SAL_CALL setPlotBy( ::sal_Int32 xlRowCol ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 105 virtual ::sal_Int32 SAL_CALL getPlotBy( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 106 virtual css::uno::Reference< ov::excel::XChartTitle > SAL_CALL getChartTitle( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 107 virtual css::uno::Any SAL_CALL Axes( const css::uno::Any& Type, const css::uno::Any& AxisGroup ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 108 // XHelperInterface 109 virtual rtl::OUString& getServiceImplName(); 110 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 111 112 }; 113 114 #endif //SC_VBA_WINDOW_HXX 115