xref: /aoo41x/main/sc/source/ui/vba/vbaworksheet.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_VBA_WORKSHEET_HXX
24cdf0e10cSrcweir #define SC_VBA_WORKSHEET_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
27cdf0e10cSrcweir #include <comphelper/unwrapargs.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <com/sun/star/sheet/XSpreadsheet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp>
31cdf0e10cSrcweir #include <ooo/vba/excel/XWorksheet.hpp>
32cdf0e10cSrcweir #include <ooo/vba/excel/XComments.hpp>
33cdf0e10cSrcweir #include <ooo/vba/excel/XRange.hpp>
34cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
35cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
36cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
37cdf0e10cSrcweir #include <ooo/vba/excel/XOutline.hpp>
38cdf0e10cSrcweir #include <ooo/vba/excel/XPageSetup.hpp>
39cdf0e10cSrcweir #include <ooo/vba/excel/XHPageBreaks.hpp>
40cdf0e10cSrcweir #include <ooo/vba/excel/XVPageBreaks.hpp>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx>
43cdf0e10cSrcweir #include "address.hxx"
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace ooo { namespace vba { namespace excel {
46cdf0e10cSrcweir     class XChartObjects;
47cdf0e10cSrcweir     class XHyperlinks;
48cdf0e10cSrcweir } } }
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class ScVbaSheetObjectsBase;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1< ov::excel::XWorksheet >  WorksheetImpl_BASE;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir class ScVbaWorksheet : public WorksheetImpl_BASE
55cdf0e10cSrcweir {
56cdf0e10cSrcweir 	css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
57cdf0e10cSrcweir 	css::uno::Reference< css::frame::XModel > mxModel;
58cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XChartObjects > mxCharts;
59cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XHyperlinks > mxHlinks;
60cdf0e10cSrcweir 	::rtl::Reference< ScVbaSheetObjectsBase > mxButtons;
61cdf0e10cSrcweir 	bool mbVeryHidden;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
64cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	css::uno::Reference< css::container::XNameAccess > getFormControls();
67cdf0e10cSrcweir 	css::uno::Any getControlShape( const rtl::OUString& sName );
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > getFirstDBRangeProperties() throw (css::uno::RuntimeException);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir protected:
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext );
74cdf0e10cSrcweir public:
75cdf0e10cSrcweir 	ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,
76cdf0e10cSrcweir 		const css::uno::Reference< css::uno::XComponentContext >& xContext,
77cdf0e10cSrcweir 		const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet,
78cdf0e10cSrcweir 		const css::uno::Reference< css::frame::XModel >& xModel )throw (css::uno::RuntimeException)  ;
79cdf0e10cSrcweir 	ScVbaWorksheet( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	virtual ~ScVbaWorksheet();
82cdf0e10cSrcweir 
getModel()83cdf0e10cSrcweir 	virtual css::uno::Reference< css::frame::XModel > getModel()
84cdf0e10cSrcweir 	{ return mxModel; }
getSheet()85cdf0e10cSrcweir 	virtual css::uno::Reference< css::sheet::XSpreadsheet > getSheet()
86cdf0e10cSrcweir 	{ return mxSheet; }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     // Attributes
89cdf0e10cSrcweir 	virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
90cdf0e10cSrcweir 	virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
91cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
92cdf0e10cSrcweir 	virtual void SAL_CALL setVisible( sal_Int32 nVisible ) throw (css::uno::RuntimeException);
93cdf0e10cSrcweir 	virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
94cdf0e10cSrcweir 	virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
95cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
96cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException);
97cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException);
98cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException);
99cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ;
100cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
101cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
102cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
103cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
104cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
105cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
106cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
107cdf0e10cSrcweir  	virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
108cdf0e10cSrcweir  	virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException);
109cdf0e10cSrcweir  	virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException);
110cdf0e10cSrcweir 	virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException);
111cdf0e10cSrcweir 	virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException);
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     // Methods
114cdf0e10cSrcweir 	virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
115cdf0e10cSrcweir 	virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
116cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
117cdf0e10cSrcweir 	virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ;
118cdf0e10cSrcweir  	virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException);
119cdf0e10cSrcweir 	virtual void SAL_CALL Paste( const css::uno::Any& Destination, const css::uno::Any& Link ) throw (css::uno::RuntimeException);
120cdf0e10cSrcweir 	virtual void SAL_CALL Delete(  ) throw (css::uno::RuntimeException);
121cdf0e10cSrcweir 	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);
122cdf0e10cSrcweir 	virtual void SAL_CALL Unprotect( const css::uno::Any& Password ) throw (css::uno::RuntimeException);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	virtual void SAL_CALL Calculate(  ) throw (css::uno::RuntimeException);
125cdf0e10cSrcweir 	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);
126cdf0e10cSrcweir 	// Hacks (?)
127cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) throw (css::uno::RuntimeException);
128cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
129cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException);
132cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL PivotTables( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
133cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Comments( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
134cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
135cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL OLEObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
138cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Shapes( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Buttons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
141cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL CheckBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
142cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL DropDowns( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
143cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL GroupBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
144cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Labels( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
145cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL ListBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
146cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL OptionButtons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
147cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL ScrollBars( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
148cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL Spinners( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	virtual void SAL_CALL setEnableCalculation( ::sal_Bool EnableCalculation ) throw ( css::script::BasicErrorException, css::uno::RuntimeException);
151cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getEnableCalculation(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
152cdf0e10cSrcweir 	virtual void SAL_CALL ShowDataForm(  ) throw (css::uno::RuntimeException);
153cdf0e10cSrcweir 	// XInvocation
154cdf0e10cSrcweir 	virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
155cdf0e10cSrcweir 	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);
156cdf0e10cSrcweir 	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);
157cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
158cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
159cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
160cdf0e10cSrcweir     // CodeName
161cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getCodeName() throw (css::uno::RuntimeException);
162cdf0e10cSrcweir     sal_Int16 getSheetID() throw (css::uno::RuntimeException);
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	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);
165cdf0e10cSrcweir 	// XHelperInterface
166cdf0e10cSrcweir 	virtual rtl::OUString& getServiceImplName();
167cdf0e10cSrcweir 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
168cdf0e10cSrcweir };
169cdf0e10cSrcweir 
170cdf0e10cSrcweir #endif /* SC_VBA_WORKSHEET_HXX */
171cdf0e10cSrcweir 
172