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