xref: /aoo41x/main/sc/source/ui/vba/vbaworkbook.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_WORKBOOK_HXX
28 #define SC_VBA_WORKBOOK_HXX
29 
30 #include <com/sun/star/frame/XModel.hpp>
31 #include <ooo/vba/excel/XWorkbook.hpp>
32 #include <vbahelper/vbahelperinterface.hxx>
33 #include <vbahelper/vbadocumentbase.hxx>
34 
35 class ScModelObj;
36 
37 typedef cppu::ImplInheritanceHelper1< VbaDocumentBase, ov::excel::XWorkbook > ScVbaWorkbook_BASE;
38 
39 class ScVbaWorkbook : public ScVbaWorkbook_BASE
40 {
41 	static css::uno::Sequence< sal_Int32 > ColorData;
42 	void initColorData( const css::uno::Sequence< sal_Int32 >& sColors );
43 	void init();
44 protected:
45 
46 	ScVbaWorkbook( 	const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext);
47 public:
48 	ScVbaWorkbook( 	const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
49 			css::uno::Reference< css::frame::XModel > xModel );
50 	ScVbaWorkbook( 	css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext );
51 	virtual ~ScVbaWorkbook() {}
52 
53     // Attributes
54 	virtual ::sal_Bool SAL_CALL getProtectStructure() throw (css::uno::RuntimeException);
55 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() throw (css::uno::RuntimeException);
56 	virtual ::sal_Bool SAL_CALL getPrecisionAsDisplayed() throw (css::uno::RuntimeException);
57 	virtual void SAL_CALL setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) throw (css::uno::RuntimeException);
58 
59 	// Methods
60 	virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
61 	virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
62 	virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
63     virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
64     // Amelia Wang
65     virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
66 
67 	virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException);
68 	virtual void SAL_CALL ResetColors(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
69 	virtual css::uno::Any SAL_CALL Colors( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
70 	virtual ::sal_Int32 SAL_CALL FileFormat(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
71 	virtual void SAL_CALL SaveCopyAs( const rtl::OUString& Filename ) throw ( css::uno::RuntimeException);
72     // code name
73     virtual ::rtl::OUString SAL_CALL getCodeName() throw ( css::uno::RuntimeException);
74 
75 	// XHelperInterface
76 	virtual rtl::OUString& getServiceImplName();
77 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
78 };
79 
80 #endif /* SC_VBA_WORKBOOK_HXX */
81