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