GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / sc / source / ui / vba / excelvbahelper.hxx
blobaa3114d0fde77a1a93d8a8b6527813886bdc5458
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef SC_EXCEL_VBA_HELPER_HXX
20 #define SC_EXCEL_VBA_HELPER_HXX
22 #include <vbahelper/vbahelper.hxx>
23 #include "docsh.hxx"
24 #include <com/sun/star/sheet/XDatabaseRange.hpp>
25 #include <com/sun/star/sheet/XUnnamedDatabaseRanges.hpp>
26 #include <com/sun/star/table/XCellRange.hpp>
27 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
28 #include <com/sun/star/sheet/XSpreadsheet.hpp>
29 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
30 #include <com/sun/star/lang/XUnoTunnel.hpp>
31 #include <ooo/vba/XHelperInterface.hpp>
33 class ScCellRangesBase;
35 namespace ooo {
36 namespace vba {
37 namespace excel {
39 // ============================================================================
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 );
52 css::uno::Reference< css::sheet::XUnnamedDatabaseRanges > GetUnnamedDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException );
54 css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet ) throw ( css::uno::RuntimeException );
55 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet ) throw ( css::uno::RuntimeException );
56 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException );
57 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException );
58 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCell >& xCell ) throw ( css::uno::RuntimeException );
59 css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::frame::XModel >& xModel, SCTAB nTab ) throw ( css::uno::RuntimeException );
61 ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException );
62 void setUpDocumentModules( const css::uno::Reference< css::sheet::XSpreadsheetDocument >& xDoc );
64 // ============================================================================
66 class ScVbaCellRangeAccess
68 public:
69 static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj );
72 // Extracts a implementation object ( via XUnoTunnel ) from an uno object
73 // by default will throw if unsuccessful.
74 template < typename ImplObject >
75 ImplObject* getImplFromDocModuleWrapper( const css::uno::Reference< css::uno::XInterface >& rxWrapperIf, bool bThrow = true ) throw (css::uno::RuntimeException)
77 ImplObject* pObj = NULL;
78 css::uno::Reference< css::lang::XUnoTunnel > xTunnel( rxWrapperIf, css::uno::UNO_QUERY );
79 if ( xTunnel.is() )
80 pObj = reinterpret_cast<ImplObject*>( xTunnel->getSomething(ImplObject::getUnoTunnelId()));
81 if ( bThrow && !pObj )
82 throw css::uno::RuntimeException("Internal error, can't exctract implementation object", rxWrapperIf );
83 return pObj;
85 // ============================================================================
87 } // namespace excel
88 } // namespace vba
89 } // namespace ooo
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */