xref: /AOO41X/main/sc/source/ui/vba/vbaworksheet.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef SC_VBA_WORKSHEET_HXX
28*cdf0e10cSrcweir #define SC_VBA_WORKSHEET_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
31*cdf0e10cSrcweir #include <comphelper/unwrapargs.hxx>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #include <com/sun/star/sheet/XSpreadsheet.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp>
35*cdf0e10cSrcweir #include <ooo/vba/excel/XWorksheet.hpp>
36*cdf0e10cSrcweir #include <ooo/vba/excel/XComments.hpp>
37*cdf0e10cSrcweir #include <ooo/vba/excel/XRange.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
41*cdf0e10cSrcweir #include <ooo/vba/excel/XOutline.hpp>
42*cdf0e10cSrcweir #include <ooo/vba/excel/XPageSetup.hpp>
43*cdf0e10cSrcweir #include <ooo/vba/excel/XHPageBreaks.hpp>
44*cdf0e10cSrcweir #include <ooo/vba/excel/XVPageBreaks.hpp>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx>
47*cdf0e10cSrcweir #include "address.hxx"
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir namespace ooo { namespace vba { namespace excel {
50*cdf0e10cSrcweir     class XChartObjects;
51*cdf0e10cSrcweir     class XHyperlinks;
52*cdf0e10cSrcweir } } }
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir class ScVbaSheetObjectsBase;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1< ov::excel::XWorksheet >  WorksheetImpl_BASE;
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir class ScVbaWorksheet : public WorksheetImpl_BASE
59*cdf0e10cSrcweir {
60*cdf0e10cSrcweir 	css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
61*cdf0e10cSrcweir 	css::uno::Reference< css::frame::XModel > mxModel;
62*cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XChartObjects > mxCharts;
63*cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XHyperlinks > mxHlinks;
64*cdf0e10cSrcweir 	::rtl::Reference< ScVbaSheetObjectsBase > mxButtons;
65*cdf0e10cSrcweir 	bool mbVeryHidden;
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
68*cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	css::uno::Reference< css::container::XNameAccess > getFormControls();
71*cdf0e10cSrcweir 	css::uno::Any getControlShape( const rtl::OUString& sName );
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > getFirstDBRangeProperties() throw (css::uno::RuntimeException);
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir protected:
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext );
78*cdf0e10cSrcweir public:
79*cdf0e10cSrcweir 	ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,
80*cdf0e10cSrcweir 		const css::uno::Reference< css::uno::XComponentContext >& xContext,
81*cdf0e10cSrcweir 		const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet,
82*cdf0e10cSrcweir 		const css::uno::Reference< css::frame::XModel >& xModel )throw (css::uno::RuntimeException)  ;
83*cdf0e10cSrcweir 	ScVbaWorksheet( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 	virtual ~ScVbaWorksheet();
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 	virtual css::uno::Reference< css::frame::XModel > getModel()
88*cdf0e10cSrcweir 	{ return mxModel; }
89*cdf0e10cSrcweir 	virtual css::uno::Reference< css::sheet::XSpreadsheet > getSheet()
90*cdf0e10cSrcweir 	{ return mxSheet; }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     // Attributes
93*cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
94*cdf0e10cSrcweir 	virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
95*cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
96*cdf0e10cSrcweir 	virtual void SAL_CALL setVisible( sal_Int32 nVisible ) throw (css::uno::RuntimeException);
97*cdf0e10cSrcweir 	virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
98*cdf0e10cSrcweir 	virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
99*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
100*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException);
101*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException);
102*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException);
103*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ;
104*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
105*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
106*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
107*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
108*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
109*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
110*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
111*cdf0e10cSrcweir  	virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
112*cdf0e10cSrcweir  	virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException);
113*cdf0e10cSrcweir  	virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException);
114*cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException);
115*cdf0e10cSrcweir 	virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException);
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir     // Methods
118*cdf0e10cSrcweir 	virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
119*cdf0e10cSrcweir 	virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
120*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
121*cdf0e10cSrcweir 	virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ;
122*cdf0e10cSrcweir  	virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException);
123*cdf0e10cSrcweir 	virtual void SAL_CALL Paste( const css::uno::Any& Destination, const css::uno::Any& Link ) throw (css::uno::RuntimeException);
124*cdf0e10cSrcweir 	virtual void SAL_CALL Delete(  ) throw (css::uno::RuntimeException);
125*cdf0e10cSrcweir 	virtual void SAL_CALL Protect( const css::uno::Any& Password, const css::uno::Any& DrawingObjects, const css::uno::Any& Contents, const css::uno::Any& Scenarios, const css::uno::Any& UserInterfaceOnly ) throw (css::uno::RuntimeException);
126*cdf0e10cSrcweir 	virtual void SAL_CALL Unprotect( const css::uno::Any& Password ) throw (css::uno::RuntimeException);
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 	virtual void SAL_CALL Calculate(  ) throw (css::uno::RuntimeException);
129*cdf0e10cSrcweir 	virtual void SAL_CALL CheckSpelling( const css::uno::Any& CustomDictionary,const css::uno::Any& IgnoreUppercase,const css::uno::Any& AlwaysSuggest, const css::uno::Any& SpellingLang ) throw (css::uno::RuntimeException);
130*cdf0e10cSrcweir 	// Hacks (?)
131*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) throw (css::uno::RuntimeException);
132*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
133*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException);
136*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL PivotTables( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
137*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Comments( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
138*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
139*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL OLEObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
142*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Shapes( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Buttons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
145*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL CheckBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
146*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL DropDowns( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
147*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL GroupBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
148*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Labels( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
149*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL ListBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
150*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL OptionButtons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
151*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL ScrollBars( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
152*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Spinners( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	virtual void SAL_CALL setEnableCalculation( ::sal_Bool EnableCalculation ) throw ( css::script::BasicErrorException, css::uno::RuntimeException);
155*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getEnableCalculation(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
156*cdf0e10cSrcweir 	virtual void SAL_CALL ShowDataForm(  ) throw (css::uno::RuntimeException);
157*cdf0e10cSrcweir 	// XInvocation
158*cdf0e10cSrcweir 	virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
159*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
160*cdf0e10cSrcweir 	virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
161*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
162*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
163*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
164*cdf0e10cSrcweir     // CodeName
165*cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getCodeName() throw (css::uno::RuntimeException);
166*cdf0e10cSrcweir     sal_Int16 getSheetID() throw (css::uno::RuntimeException);
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	virtual void SAL_CALL PrintOut( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, const css::uno::Any& IgnorePrintAreas ) throw (css::uno::RuntimeException);
169*cdf0e10cSrcweir 	// XHelperInterface
170*cdf0e10cSrcweir 	virtual rtl::OUString& getServiceImplName();
171*cdf0e10cSrcweir 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
172*cdf0e10cSrcweir };
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir #endif /* SC_VBA_WORKSHEET_HXX */
175*cdf0e10cSrcweir 
176