xref: /aoo41x/main/sc/source/ui/vba/vbaworksheets.hxx (revision 38d50f7b)
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 
23 #ifndef SC_VBA_WORKSHEETS_HXX
24 #define SC_VBA_WORKSHEETS_HXX
25 
26 #include <cppuhelper/implbase1.hxx>
27 
28 #include <ooo/vba/excel/XWorksheets.hpp>
29 #include <com/sun/star/sheet/XSpreadsheets.hpp>
30 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
31 #include <com/sun/star/container/XEnumerationAccess.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 
34 #include <vbahelper/vbacollectionimpl.hxx>
35 
36 #include "address.hxx"
37 
38 class ScModelObj;
39 
40 
41 typedef CollTestImplHelper< ov::excel::XWorksheets > ScVbaWorksheets_BASE;
42 
43 class ScVbaWorksheets : public ScVbaWorksheets_BASE
44 {
45 	css::uno::Reference< css::frame::XModel > mxModel;
46 	css::uno::Reference< css::sheet::XSpreadsheets > m_xSheets;
47 protected:
48 	// ScVbaWorksheets_BASE
49 	virtual css::uno::Any getItemByStringIndex( const rtl::OUString& sIndex ) throw (css::uno::RuntimeException);
50 public:
51 	ScVbaWorksheets( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xSheets, const css::uno::Reference< css::frame::XModel >& xModel );
52 	ScVbaWorksheets( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XEnumerationAccess >& xEnum,  const css::uno::Reference< css::frame::XModel >& xModel );
~ScVbaWorksheets()53 	virtual ~ScVbaWorksheets() {}
54 
55 	bool isSelectedSheets();
56 
57 	// XEnumerationAccess
58 	virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
59 	virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
60 
61 
62 	// XWorksheets
63 	virtual css::uno::Any SAL_CALL getVisible() throw (css::uno::RuntimeException);
64 	virtual void SAL_CALL setVisible( const css::uno::Any& _visible ) throw (css::uno::RuntimeException);
65 	virtual css::uno::Any SAL_CALL Add( const css::uno::Any& Before, const css::uno::Any& After, const css::uno::Any& Count, const css::uno::Any& Type ) throw (css::uno::RuntimeException);
66 	virtual void SAL_CALL Delete(  ) throw (css::uno::RuntimeException);
67 	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 ) throw (css::uno::RuntimeException);
68 	virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
69 	virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException);
70 	// ScVbaWorksheets_BASE
71 	virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw
72 (css::uno::RuntimeException);
73 	virtual rtl::OUString& getServiceImplName();
74 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
75 
76     static bool nameExists( css::uno::Reference <css::sheet::XSpreadsheetDocument>& xSpreadDoc, const ::rtl::OUString & name, SCTAB& nTab ) throw ( css::lang::IllegalArgumentException );
77 };
78 
79 #endif /* SC_VBA_WORKSHEETS_HXX */
80