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#include <com/sun/star/document/XDocumentProperties.hpp>
25#include <ooo/vba/excel/XApplication.hpp>
26
27#include <vector>
28#include <global.hxx>
29
30namespace com::sun::star::frame { class XModel; }
31namespace com::sun::star::uno { class XComponentContext; }
32
33namespace com::sun::star::sheet { class XDatabaseRange; }
34namespace com::sun::star::sheet { class XUnnamedDatabaseRanges; }
35namespace com::sun::star::table { class XCell; }
36namespace com::sun::star::table { class XCellRange; }
37namespace com::sun::star::sheet { class XSheetCellRangeContainer; }
38namespace com::sun::star::sheet { class XSpreadsheet; }
39namespace com::sun::star::sheet { class XSpreadsheetDocument; }
40namespace ooo::vba { class XHelperInterface; }
41
42class ScCellRangesBase;
43class ScTabViewShell;
44class SfxViewFrame;
45
46namespace ooo::vba::excel {
47
48// nTabs empty means apply zoom to all sheets
49void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs );
50void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel );
51void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel );
52void implnCut( const css::uno::Reference< css::frame::XModel>& xModel );
53void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bTranspose);
54ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
55ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ;
56ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext );
57SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel );
58
60css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( const ScDocShell* pShell );
61
63css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet );
65css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet );
67css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges );
69css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange );
71css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell );
73css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab );
74
76ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange );
77void setUpDocumentModules( const css::uno::Reference< css::sheet::XSpreadsheetDocument >& xDoc );
78
80 const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< ooo::vba::excel::XApplication >& xApplication,
81 const css::uno::Any& Type, const css::uno::Any& FileName, const css::uno::Any& Quality,
82 const css::uno::Any& IncludeDocProperties, const css::uno::Any& From,
83 const css::uno::Any& To, const css::uno::Any& OpenAfterPublish);
84
86 const css::uno::Reference< css::frame::XModel >& xModel,
87 const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo);
88
90{
91public:
92 static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
93};
94
95// Extracts an implementation object (via XUnoTunnel) from a UNO object.
96// Will throw if unsuccessful.
98template < typename ImplObject >
99 ImplObject* getImplFromDocModuleWrapper( const css::uno::Reference< css::uno::XInterface >& rxWrapperIf )
100 {
101 ImplObject* pObj = comphelper::getFromUnoTunnel<ImplObject>(rxWrapperIf);
102 if ( !pObj )
103 throw css::uno::RuntimeException("Internal error, can't extract implementation object", rxWrapperIf );
104 return pObj;
105 }
106
107} // namespace ooo::vba::excel
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SfxItemSet * GetDataSet(ScCellRangesBase *pRangeObj)
ScPasteFunc
Definition: global.hxx:181
InsertDeleteFlags
Definition: global.hxx:149
Type
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)
void ExportAsFixedFormatHelper(const uno::Reference< frame::XModel > &xModel, const css::uno::Reference< XApplication > &xApplication, const css::uno::Any &Type, const css::uno::Any &FileName, const css::uno::Any &Quality, const css::uno::Any &IncludeDocProperties, const css::uno::Any &From, const css::uno::Any &To, const css::uno::Any &OpenAfterPublish)
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)
void SetDocInfoState(const uno::Reference< frame::XModel > &xModel, const uno::Reference< css::document::XDocumentProperties > &i_xOldDocProps)
uno::Reference< XHelperInterface > getUnoSheetModuleObj(const uno::Reference< table::XCellRange > &xRange)
sal_Int16 SCTAB
Definition: types.hxx:22