xref: /aoo41x/main/sc/source/ui/vba/vbachartobject.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_CHARTOBJECT_HXX
24 #define SC_VBA_CHARTOBJECT_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/drawing/XDrawPageSupplier.hpp>
29 #include <com/sun/star/container/XNamed.hpp>
30 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
31 #include <ooo/vba/excel/XChartObject.hpp>
32 #include <vbahelper/vbahelperinterface.hxx>
33 #include <memory>
34 
35 typedef InheritedHelperInterfaceImpl1<ov::excel::XChartObject > ChartObjectImpl_BASE;
36 
37 class ScVbaChartObject : public ChartObjectImpl_BASE
38 {
39 
40 	css::uno::Reference< css::table::XTableChart  > xTableChart;
41 	css::uno::Reference< css::document::XEmbeddedObjectSupplier > xEmbeddedObjectSupplier;
42 	css::uno::Reference< css::beans::XPropertySet > xPropertySet;
43 	css::uno::Reference< css::drawing::XDrawPageSupplier > xDrawPageSupplier;
44 	css::uno::Reference< css::drawing::XDrawPage > xDrawPage;
45 	css::uno::Reference< css::drawing::XShape > xShape;
46 	css::uno::Reference< css::container::XNamed > xNamed;
47 	rtl::OUString sPersistName;
48 	std::auto_ptr<ov::ShapeHelper> oShapeHelper;
49 	css::uno::Reference< css::container::XNamed > xNamedShape;
50 	rtl::OUString getPersistName();
51 	css::uno::Reference< css::drawing::XShape > setShape() throw ( css::script::BasicErrorException );
52 public:
53 	ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier );
54 	virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
55 	virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw (css::uno::RuntimeException);
56 	virtual css::uno::Reference< ov::excel::XChart > SAL_CALL getChart() throw (css::uno::RuntimeException);
57 	virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException );
58 	virtual void Activate() throw ( css::script::BasicErrorException );
59 	// XHelperInterface
60 	virtual rtl::OUString& getServiceImplName();
61 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
62 	// non interface methods
63 	double getHeight();
64 	void setHeight( double _fheight ) throw ( css::script::BasicErrorException );
65 	double getWidth();
66 	void setWidth( double _fwidth ) throw ( css::script::BasicErrorException );
67 	double getLeft();
68 	void setLeft( double _fleft );
69 	double getTop();
70 	void setTop( double _ftop );
71 	// should make this part of the XHelperInterface with a default
72 	// implementation returning NULL
73 	css::uno::Reference< css::uno::XInterface > getUnoObject() throw ( css::script::BasicErrorException );
74 };
75 
76 #endif //SC_VBA_WINDOW_HXX
77