xref: /aoo41x/main/sc/source/ui/vba/excelvbahelper.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef SC_EXCEL_VBA_HELPER_HXX
28 #define SC_EXCEL_VBA_HELPER_HXX
29 
30 #include <vbahelper/vbahelper.hxx>
31 #include "docsh.hxx"
32 #include <com/sun/star/table/XCellRange.hpp>
33 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
34 #include <com/sun/star/sheet/XSpreadsheet.hpp>
35 #include <ooo/vba/XHelperInterface.hpp>
36 
37 class ScCellRangesBase;
38 
39 namespace ooo {
40 namespace vba {
41 namespace excel {
42 
43 // ============================================================================
44 
45 // nTabs empty means apply zoom to all sheets
46 void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
47 void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
48 void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
49 void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
50 void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
51 ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
52 ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
53 ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
54 SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
55 
56 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException );
57 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
58 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
59 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell ) throw ( css::uno::RuntimeException );
60 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab ) throw ( css::uno::RuntimeException );
61 
62 ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
63 ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
64 css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
65 
66 // ============================================================================
67 
68 class ScVbaCellRangeAccess
69 {
70 public:
71     static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
72 };
73 
74 // ============================================================================
75 
76 } // namespace excel
77 } // namespace vba
78 } // namespace ooo
79 
80 #endif
81