LibreOffice Module sc (master) 1
excelvbahelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include <sal/config.h>
22
24
25#include <vector>
26#include <global.hxx>
27
28namespace com::sun::star::frame { class XModel; }
29namespace com::sun::star::uno { class XComponentContext; }
30
31namespace com::sun::star::sheet { class XDatabaseRange; }
32namespace com::sun::star::sheet { class XUnnamedDatabaseRanges; }
33namespace com::sun::star::table { class XCell; }
34namespace com::sun::star::table { class XCellRange; }
35namespace com::sun::star::sheet { class XSheetCellRangeContainer; }
36namespace com::sun::star::sheet { class XSpreadsheet; }
37namespace com::sun::star::sheet { class XSpreadsheetDocument; }
38namespace ooo::vba { class XHelperInterface; }
39
41class ScTabViewShell;
42class SfxViewFrame;
43
44namespace ooo::vba::excel {
45
46// nTabs empty means apply zoom to all sheets
47void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
48void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
49void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
50void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
51void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose);
52ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
53ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
54ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
55SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
56
58css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( const ScDocShell* pShell );
59
61css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet );
63css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet );
65css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges );
67css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange );
69css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell );
71css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab );
72
74ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange );
75void setUpDocumentModules( const css::uno::Reference< css::sheet::XSpreadsheetDocument >& xDoc );
76
78{
79public:
80 static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
81};
82
83// Extracts an implementation object (via XUnoTunnel) from a UNO object.
84// Will throw if unsuccessful.
86template < typename ImplObject >
87 ImplObject* getImplFromDocModuleWrapper( const css::uno::Reference< css::uno::XInterface >& rxWrapperIf )
88 {
89 ImplObject* pObj = comphelper::getFromUnoTunnel<ImplObject>(rxWrapperIf);
90 if ( !pObj )
91 throw css::uno::RuntimeException("Internal error, can't extract implementation object", rxWrapperIf );
92 return pObj;
93 }
94
95} // namespace ooo::vba::excel
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SfxItemSet * GetDataSet(ScCellRangesBase *pRangeObj)
ScPasteFunc
Definition: global.hxx:180
InsertDeleteFlags
Definition: global.hxx:149
ScDocShell * GetDocShellFromRange(const uno::Reference< uno::XInterface > &xRange)
ScTabViewShell * getCurrentBestViewShell(const uno::Reference< uno::XComponentContext > &xContext)
void setUpDocumentModules(const uno::Reference< sheet::XSpreadsheetDocument > &xDoc)
uno::Reference< sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges(const ScDocShell *pShell)
void implnCut(const uno::Reference< frame::XModel > &xModel)
ScDocShell * getDocShell(const css::uno::Reference< css::frame::XModel > &xModel)
void implnPasteSpecial(const uno::Reference< frame::XModel > &xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose)
SfxViewFrame * getViewFrame(const uno::Reference< frame::XModel > &xModel)
void implnPaste(const uno::Reference< frame::XModel > &xModel)
ScTabViewShell * getBestViewShell(const css::uno::Reference< css::frame::XModel > &xModel)
void implSetZoom(const uno::Reference< frame::XModel > &xModel, sal_Int16 nZoom, std::vector< SCTAB > &nTabs)
uno::Reference< sheet::XDatabaseRange > GetAutoFiltRange(const ScDocShell *pShell, sal_Int16 nSheet)
ImplObject * getImplFromDocModuleWrapper(const css::uno::Reference< css::uno::XInterface > &rxWrapperIf)
void implnCopy(const uno::Reference< frame::XModel > &xModel)
uno::Reference< XHelperInterface > getUnoSheetModuleObj(const uno::Reference< table::XCellRange > &xRange)
sal_Int16 SCTAB
Definition: types.hxx:22