1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir #ifndef SC_VBA_CHART_HXX 24cdf0e10cSrcweir #define SC_VBA_CHART_HXX 25cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 26cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 27cdf0e10cSrcweir #include <com/sun/star/table/XTableChart.hpp> 28cdf0e10cSrcweir #include <com/sun/star/chart/XChartDocument.hpp> 29cdf0e10cSrcweir #include <com/sun/star/chart/XAxisXSupplier.hpp> 30cdf0e10cSrcweir #include <com/sun/star/chart/XAxisYSupplier.hpp> 31cdf0e10cSrcweir #include <com/sun/star/chart/XAxisZSupplier.hpp> 32cdf0e10cSrcweir #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> 33cdf0e10cSrcweir #include <com/sun/star/chart/XTwoAxisYSupplier.hpp> 34cdf0e10cSrcweir #include <ooo/vba/excel/XChart.hpp> 35cdf0e10cSrcweir #include <ooo/vba/excel/XDataLabels.hpp> 36cdf0e10cSrcweir #include <ooo/vba/excel/XSeries.hpp> 37cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx> 38cdf0e10cSrcweir 39cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1<ov::excel::XChart > ChartImpl_BASE; 40cdf0e10cSrcweir 41cdf0e10cSrcweir class ScVbaChart : public ChartImpl_BASE 42cdf0e10cSrcweir { 43cdf0e10cSrcweir friend class ScVbaAxis; 44cdf0e10cSrcweir 45cdf0e10cSrcweir css::uno::Reference< css::chart::XChartDocument > mxChartDocument; 46cdf0e10cSrcweir css::uno::Reference< css::table::XTableChart > mxTableChart; 47cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > mxDiagramPropertySet; 48cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > mxChartPropertySet; 49cdf0e10cSrcweir css::uno::Reference< css::chart::XAxisXSupplier > xAxisXSupplier; 50cdf0e10cSrcweir css::uno::Reference< css::chart::XAxisYSupplier> xAxisYSupplier; 51cdf0e10cSrcweir css::uno::Reference< css::chart::XAxisZSupplier > xAxisZSupplier; 52cdf0e10cSrcweir css::uno::Reference< css::chart::XTwoAxisXSupplier > xTwoAxisXSupplier; 53cdf0e10cSrcweir css::uno::Reference< css::chart::XTwoAxisYSupplier > xTwoAxisYSupplier; 54cdf0e10cSrcweir 55cdf0e10cSrcweir css::uno::Sequence< rtl::OUString > getDefaultSeriesDescriptions( sal_Int32 nCount ); 56cdf0e10cSrcweir css::uno::Sequence< css::uno::Sequence< double > > dblValues; 57cdf0e10cSrcweir void setDefaultChartType()throw ( css::script::BasicErrorException ) ; 58cdf0e10cSrcweir void setDiagram( const rtl::OUString& _sDiagramType) throw( css::script::BasicErrorException ); 59cdf0e10cSrcweir bool isStacked() throw ( css::uno::RuntimeException ); 60cdf0e10cSrcweir bool is100PercentStacked() throw ( css::uno::RuntimeException ); 61cdf0e10cSrcweir sal_Int32 getStackedType( sal_Int32 _nStacked, sal_Int32 _n100PercentStacked, sal_Int32 _nUnStacked ) throw ( css::uno::RuntimeException ); 62cdf0e10cSrcweir 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 ); 63cdf0e10cSrcweir sal_Int32 getStockUpDownValue(sal_Int32 _nUpDown, sal_Int32 _nNotUpDown) throw (css::script::BasicErrorException); 64cdf0e10cSrcweir bool hasMarkers() throw ( css::script::BasicErrorException ); 65cdf0e10cSrcweir sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); 66cdf0e10cSrcweir void assignDiagramAttributes(); setDefaultSeriesDescriptionLabels()67cdf0e10cSrcweir void setDefaultSeriesDescriptionLabels(){} 68cdf0e10cSrcweir public: 69cdf0e10cSrcweir 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 ); 70cdf0e10cSrcweir 71cdf0e10cSrcweir // Non-interface xDiagramPropertySet()72cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() { return mxDiagramPropertySet; } 73cdf0e10cSrcweir bool isSeriesIndexValid(sal_Int32 _seriesindex) throw( css::script::BasicErrorException ); 74cdf0e10cSrcweir bool areIndicesValid(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( css::script::BasicErrorException ); 75cdf0e10cSrcweir void setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( css::script::BasicErrorException ); 76cdf0e10cSrcweir sal_Int32 getSeriesIndex(rtl::OUString _sseriesname) throw ( css::script::BasicErrorException ); 77cdf0e10cSrcweir sal_Int32 getSeriesCount() throw ( css::script::BasicErrorException ); 78cdf0e10cSrcweir rtl::OUString getSeriesName(sal_Int32 _index) throw ( css::script::BasicErrorException ); 79cdf0e10cSrcweir double getValue(sal_Int32 _seriesIndex, sal_Int32 _valindex) throw ( css::script::BasicErrorException ); 80cdf0e10cSrcweir sal_Int32 getValuesCount(sal_Int32 _seriesIndex) throw ( css::script::BasicErrorException ); 81cdf0e10cSrcweir css::uno::Reference< ov::excel::XDataLabels > DataLabels( const css::uno::Reference< ov::excel::XSeries > _oSeries ) throw ( css::script::BasicErrorException ); 82cdf0e10cSrcweir bool getHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet )throw ( css::script::BasicErrorException ); 83cdf0e10cSrcweir void setHasDataCaption( const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, bool _bHasDataLabels )throw ( css::script::BasicErrorException ); 84cdf0e10cSrcweir bool is3D() throw ( css::uno::RuntimeException ); 85cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > getAxisPropertySet(sal_Int32 _nAxisType, sal_Int32 _nAxisGroup) throw ( css::script::BasicErrorException ); 86cdf0e10cSrcweir // Methods 87cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); 88cdf0e10cSrcweir virtual css::uno::Any SAL_CALL SeriesCollection(const css::uno::Any&) throw (css::uno::RuntimeException); 89cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getChartType() throw ( css::uno::RuntimeException, css::script::BasicErrorException); 90cdf0e10cSrcweir virtual void SAL_CALL setChartType( ::sal_Int32 _charttype ) throw ( css::uno::RuntimeException, css::script::BasicErrorException); 91cdf0e10cSrcweir virtual void SAL_CALL Activate( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 92cdf0e10cSrcweir 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); 93cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL Location( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 94cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getLocation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 95cdf0e10cSrcweir virtual void SAL_CALL setLocation( ::sal_Int32 where, const css::uno::Any& Name ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 96cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getHasTitle( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 97cdf0e10cSrcweir virtual void SAL_CALL setHasTitle( ::sal_Bool bTitle ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 98cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getHasLegend( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 99cdf0e10cSrcweir virtual void SAL_CALL setHasLegend( ::sal_Bool bLegend ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 100cdf0e10cSrcweir virtual void SAL_CALL setPlotBy( ::sal_Int32 xlRowCol ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 101cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getPlotBy( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 102cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XChartTitle > SAL_CALL getChartTitle( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 103cdf0e10cSrcweir virtual css::uno::Any SAL_CALL Axes( const css::uno::Any& Type, const css::uno::Any& AxisGroup ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 104cdf0e10cSrcweir // XHelperInterface 105cdf0e10cSrcweir virtual rtl::OUString& getServiceImplName(); 106cdf0e10cSrcweir virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 107cdf0e10cSrcweir 108cdf0e10cSrcweir }; 109cdf0e10cSrcweir 110cdf0e10cSrcweir #endif //SC_VBA_WINDOW_HXX 111