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