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 ); 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 ); 53 virtual ~ScVbaWorksheets() {} 54 55 bool isSelectedSheets(); 56 57 // XEnumerationAccess 58 virtual css::uno::Type SAL_CALL getElementType(); 59 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration(); 60 61 62 // XWorksheets 63 virtual css::uno::Any SAL_CALL getVisible(); 64 virtual void SAL_CALL setVisible( const css::uno::Any& _visible ); 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 ); 66 virtual void SAL_CALL Delete( ); 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 ); 68 virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); 69 virtual void SAL_CALL Select( const css::uno::Any& Replace ); 70 // ScVbaWorksheets_BASE 71 virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ); 72 virtual rtl::OUString& getServiceImplName(); 73 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 74 75 static bool nameExists( css::uno::Reference <css::sheet::XSpreadsheetDocument>& xSpreadDoc, const ::rtl::OUString & name, SCTAB& nTab ); 76 }; 77 78 #endif /* SC_VBA_WORKSHEETS_HXX */ 79