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_EXCEL_VBA_HELPER_HXX 24 #define SC_EXCEL_VBA_HELPER_HXX 25 26 #include <vbahelper/vbahelper.hxx> 27 #include "docsh.hxx" 28 #include <com/sun/star/table/XCellRange.hpp> 29 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> 30 #include <com/sun/star/sheet/XSpreadsheet.hpp> 31 #include <ooo/vba/XHelperInterface.hpp> 32 33 class ScCellRangesBase; 34 35 namespace ooo { 36 namespace vba { 37 namespace excel { 38 39 // ============================================================================ 40 41 // nTabs empty means apply zoom to all sheets 42 void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ); 43 void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); 44 void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel ); 45 void implnCut( const css::uno::Reference< css::frame::XModel>& xModel ); 46 void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose); 47 ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; 48 ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; 49 ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); 50 SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); 51 52 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException ); 53 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException ); 54 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException ); 55 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell ) throw ( css::uno::RuntimeException ); 56 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab ) throw ( css::uno::RuntimeException ); 57 58 ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); 59 ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); 60 css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); 61 62 // ============================================================================ 63 64 class ScVbaCellRangeAccess 65 { 66 public: 67 static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj ); 68 }; 69 70 // ============================================================================ 71 72 } // namespace excel 73 } // namespace vba 74 } // namespace ooo 75 76 #endif 77