LibreOffice Module sc (master) 1
vbaworksheet.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 <ooo/vba/excel/XWorksheet.hpp>
22#include <rtl/ref.hxx>
23
25#include <types.hxx>
26
27namespace com::sun::star::frame { class XModel; }
28namespace com::sun::star::sheet { class XSpreadsheet; }
29namespace com::sun::star::uno { class XComponentContext; }
30namespace ooo::vba::excel { class XOutline; }
31namespace ooo::vba::excel { class XPageSetup; }
32namespace ooo::vba::excel { class XRange; }
33
34namespace ooo::vba::excel {
35 class XChartObjects;
36 class XHyperlinks;
37}
38
40
42
44{
45 css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
46 css::uno::Reference< css::frame::XModel > mxModel;
47 css::uno::Reference< ov::excel::XChartObjects > mxCharts;
48 css::uno::Reference< ov::excel::XHyperlinks > mxHlinks;
51
53 css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset);
55 css::uno::Reference< ov::excel::XRange > getSheetRange();
56
57 css::uno::Reference< css::container::XNameAccess > getFormControls() const;
58 css::uno::Any getControlShape( std::u16string_view sName );
59
60 css::uno::Any getButtons( const css::uno::Any &rIndex, bool bOptionButtons );
61
62public:
64 ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,
65 const css::uno::Reference< css::uno::XComponentContext >& xContext,
66 css::uno::Reference< css::sheet::XSpreadsheet > xSheet,
67 css::uno::Reference< css::frame::XModel > xModel ) ;
70 ScVbaWorksheet( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext );
71
72 virtual ~ScVbaWorksheet() override;
73
74 const css::uno::Reference< css::frame::XModel >& getModel() const
75 { return mxModel; }
76 const css::uno::Reference< css::sheet::XSpreadsheet >& getSheet() const
77 { return mxSheet; }
78 static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
79 css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc( const OUString& );
80 css::uno::Reference< ov::excel::XWorksheet > createSheetCopy(css::uno::Reference< ov::excel::XWorksheet> const & xSheet, bool bAfter);
81
82 // Attributes
83 virtual OUString SAL_CALL getName() override;
84 virtual void SAL_CALL setName( const OUString &rName ) override;
85 virtual sal_Int32 SAL_CALL getVisible() override;
86 virtual void SAL_CALL setVisible( sal_Int32 nVisible ) override;
87 virtual ::sal_Int32 SAL_CALL getStandardWidth() override;
88 virtual ::sal_Int32 SAL_CALL getStandardHeight() override;
89 virtual sal_Bool SAL_CALL getProtectionMode() override;
90 virtual sal_Bool SAL_CALL getProtectContents() override;
91 virtual sal_Bool SAL_CALL getProtectDrawingObjects() override;
92 virtual sal_Bool SAL_CALL getProtectScenarios() override;
93 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() override ;
94 virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) override;
95 virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) override;
96 virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) override;
97 virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) override;
98 virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) override;
99 virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() override;
100 virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() override;
101 virtual sal_Int16 SAL_CALL getIndex() override;
102 virtual sal_Int32 SAL_CALL getEnableSelection() override;
103 virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) override;
104 virtual sal_Bool SAL_CALL getAutoFilterMode() override;
105 virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) override;
106
107 // Methods
108 virtual void SAL_CALL Activate() override;
109 virtual void SAL_CALL Select() override;
110 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) override;
111 virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) override ;
112 virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) override;
113 virtual void SAL_CALL Paste( const css::uno::Any& Destination, const css::uno::Any& Link ) override;
114 virtual void SAL_CALL Delete( ) override;
115 virtual void SAL_CALL Protect( const css::uno::Any& Password, const css::uno::Any& DrawingObjects, const css::uno::Any& Contents, const css::uno::Any& Scenarios, const css::uno::Any& UserInterfaceOnly ) override;
116 virtual void SAL_CALL Unprotect( const css::uno::Any& Password ) override;
117
118 virtual void SAL_CALL Calculate( ) override;
119 virtual void SAL_CALL CheckSpelling( const css::uno::Any& CustomDictionary,const css::uno::Any& IgnoreUppercase,const css::uno::Any& AlwaysSuggest, const css::uno::Any& SpellingLang ) override;
120 // Hacks (?)
121 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) override;
122 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any& aIndex ) override;
123 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any& aIndex ) override;
124
125 virtual css::uno::Any SAL_CALL Evaluate( const OUString& Name ) override;
126 virtual css::uno::Any SAL_CALL PivotTables( const css::uno::Any& Index ) override;
127 virtual css::uno::Any SAL_CALL Comments( const css::uno::Any& Index ) override;
128 virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) override;
129 virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) override;
130
131 virtual css::uno::Any SAL_CALL OLEObjects( const css::uno::Any& Index ) override;
132 virtual css::uno::Any SAL_CALL Shapes( const css::uno::Any& aIndex ) override;
133
134 virtual css::uno::Any SAL_CALL Buttons( const css::uno::Any& rIndex ) override;
135 virtual css::uno::Any SAL_CALL CheckBoxes( const css::uno::Any& rIndex ) override;
136 virtual css::uno::Any SAL_CALL DropDowns( const css::uno::Any& rIndex ) override;
137 virtual css::uno::Any SAL_CALL GroupBoxes( const css::uno::Any& rIndex ) override;
138 virtual css::uno::Any SAL_CALL Labels( const css::uno::Any& rIndex ) override;
139 virtual css::uno::Any SAL_CALL ListBoxes( const css::uno::Any& rIndex ) override;
140 virtual css::uno::Any SAL_CALL OptionButtons( const css::uno::Any& rIndex ) override;
141 virtual css::uno::Any SAL_CALL ScrollBars( const css::uno::Any& rIndex ) override;
142 virtual css::uno::Any SAL_CALL Spinners( const css::uno::Any& rIndex ) override;
143
144 virtual void SAL_CALL setEnableCalculation( sal_Bool EnableCalculation ) override;
145 virtual sal_Bool SAL_CALL getEnableCalculation( ) override;
146 virtual void SAL_CALL ShowDataForm( ) override;
147 // XInvocation
148 virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) override;
149 virtual css::uno::Any SAL_CALL invoke( const OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) override;
150 virtual void SAL_CALL setValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
151 virtual css::uno::Any SAL_CALL getValue( const OUString& aPropertyName ) override;
152 virtual sal_Bool SAL_CALL hasMethod( const OUString& aName ) override;
153 virtual sal_Bool SAL_CALL hasProperty( const OUString& aName ) override;
154 // CodeName
155 virtual OUString SAL_CALL getCodeName() override;
157 sal_Int16 getSheetID() const;
158
159 virtual void SAL_CALL PrintOut( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, const css::uno::Any& IgnorePrintAreas ) override;
160 virtual void SAL_CALL ExportAsFixedFormat(const css::uno::Any& Type, const css::uno::Any& FileName, const css::uno::Any& Quality,
161 const css::uno::Any& IncludeDocProperties, const css::uno::Any& IgnorePrintAreas, const css::uno::Any& From,
162 const css::uno::Any& To, const css::uno::Any& OpenAfterPublish, const css::uno::Any& FixedFormatExtClassPtr) override;
163 // XHelperInterface
164 virtual OUString getServiceImplName() override;
165 virtual css::uno::Sequence<OUString> getServiceNames() override;
166 // XUnoTunnel
167 virtual ::sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8 >& rId ) override;
168};
169
170/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
Base class for collections containing a specific type of drawing object embedded in a sheet (workshee...
virtual void SAL_CALL Paste(const css::uno::Any &Destination, const css::uno::Any &Link) override
virtual css::uno::Any SAL_CALL Evaluate(const OUString &Name) override
virtual void SAL_CALL setVisible(sal_Int32 nVisible) override
ScVbaWorksheet(css::uno::Sequence< css::uno::Any > const &aArgs, css::uno::Reference< css::uno::XComponentContext >const &xContext)
virtual css::uno::Any SAL_CALL invoke(const OUString &aFunctionName, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< ::sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override
css::uno::Reference< ov::excel::XChartObjects > mxCharts
virtual void SAL_CALL Protect(const css::uno::Any &Password, const css::uno::Any &DrawingObjects, const css::uno::Any &Contents, const css::uno::Any &Scenarios, const css::uno::Any &UserInterfaceOnly) override
::rtl::Reference< ScVbaSheetObjectsBase > mxButtons[2]
virtual void SAL_CALL Copy(const css::uno::Any &Before, const css::uno::Any &After) override
virtual sal_Bool SAL_CALL hasProperty(const OUString &aName) override
virtual void SAL_CALL setName(const OUString &rName) override
virtual void SAL_CALL setEnableCalculation(sal_Bool EnableCalculation) override
virtual css::uno::Any SAL_CALL ChartObjects(const css::uno::Any &Index) override
virtual css::uno::Any SAL_CALL Spinners(const css::uno::Any &rIndex) override
virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline() override
virtual ::sal_Int32 SAL_CALL getStandardWidth() override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual css::uno::Any SAL_CALL OLEObjects(const css::uno::Any &Index) override
virtual sal_Int16 SAL_CALL getIndex() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual ~ScVbaWorksheet() override
virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection() override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() override
virtual sal_Bool SAL_CALL getProtectionMode() override
virtual void SAL_CALL Unprotect(const css::uno::Any &Password) override
virtual ::sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rId) override
sal_Int16 getSheetID() const
virtual css::uno::Any SAL_CALL ListBoxes(const css::uno::Any &rIndex) override
virtual void SAL_CALL PrintOut(const css::uno::Any &From, const css::uno::Any &To, const css::uno::Any &Copies, const css::uno::Any &Preview, const css::uno::Any &ActivePrinter, const css::uno::Any &PrintToFile, const css::uno::Any &Collate, const css::uno::Any &PrToFileName, const css::uno::Any &IgnorePrintAreas) override
virtual sal_Bool SAL_CALL hasMethod(const OUString &aName) override
css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc(const OUString &)
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any &aIndex) override
virtual OUString SAL_CALL getName() override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells(const css::uno::Any &nRow, const css::uno::Any &nCol) override
virtual css::uno::Any SAL_CALL Buttons(const css::uno::Any &rIndex) override
virtual void SAL_CALL Delete() override
virtual sal_Bool SAL_CALL getProtectContents() override
virtual void SAL_CALL setEnableSelection(sal_Int32 nSelection) override
virtual css::uno::Any SAL_CALL Hyperlinks(const css::uno::Any &aIndex) override
virtual sal_Int32 SAL_CALL getEnableSelection() override
virtual css::uno::Any SAL_CALL Shapes(const css::uno::Any &aIndex) override
virtual css::uno::Any SAL_CALL Comments(const css::uno::Any &Index) override
const css::uno::Reference< css::frame::XModel > & getModel() const
css::uno::Reference< ov::excel::XHyperlinks > mxHlinks
virtual css::uno::Any SAL_CALL Names(const css::uno::Any &aIndex) override
virtual void SAL_CALL Activate() override
virtual ::sal_Int32 SAL_CALL getStandardHeight() override
virtual sal_Int32 SAL_CALL getVisible() override
virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() override
virtual void SAL_CALL ShowDataForm() override
css::uno::Reference< css::sheet::XSpreadsheet > mxSheet
virtual css::uno::Any SAL_CALL DropDowns(const css::uno::Any &rIndex) override
virtual void SAL_CALL ExportAsFixedFormat(const css::uno::Any &Type, const css::uno::Any &FileName, const css::uno::Any &Quality, const css::uno::Any &IncludeDocProperties, const css::uno::Any &IgnorePrintAreas, const css::uno::Any &From, const css::uno::Any &To, const css::uno::Any &OpenAfterPublish, const css::uno::Any &FixedFormatExtClassPtr) override
virtual void SAL_CALL setValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Any SAL_CALL VPageBreaks(const css::uno::Any &aIndex) override
virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() override
virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup() override
virtual css::uno::Any SAL_CALL Labels(const css::uno::Any &rIndex) override
virtual css::uno::Any SAL_CALL GroupBoxes(const css::uno::Any &rIndex) override
virtual void SAL_CALL Select() override
css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset)
css::uno::Reference< ov::excel::XRange > getSheetRange()
css::uno::Reference< css::frame::XModel > mxModel
virtual void SAL_CALL setAutoFilterMode(sal_Bool bAutoFilterMode) override
virtual OUString getServiceImplName() override
css::uno::Any getButtons(const css::uno::Any &rIndex, bool bOptionButtons)
virtual OUString SAL_CALL getCodeName() override
virtual sal_Bool SAL_CALL getProtectDrawingObjects() override
virtual css::uno::Any SAL_CALL CheckBoxes(const css::uno::Any &rIndex) override
virtual void SAL_CALL Calculate() override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any &aIndex) override
virtual sal_Bool SAL_CALL getProtectScenarios() override
virtual sal_Bool SAL_CALL getEnableCalculation() override
css::uno::Reference< css::container::XNameAccess > getFormControls() const
virtual void SAL_CALL CheckSpelling(const css::uno::Any &CustomDictionary, const css::uno::Any &IgnoreUppercase, const css::uno::Any &AlwaysSuggest, const css::uno::Any &SpellingLang) override
css::uno::Reference< ov::excel::XWorksheet > createSheetCopy(css::uno::Reference< ov::excel::XWorksheet > const &xSheet, bool bAfter)
virtual void SAL_CALL Move(const css::uno::Any &Before, const css::uno::Any &After) override
virtual sal_Bool SAL_CALL getAutoFilterMode() override
virtual css::uno::Any SAL_CALL getValue(const OUString &aPropertyName) override
virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range(const css::uno::Any &Cell1, const css::uno::Any &Cell2) override
const css::uno::Reference< css::sheet::XSpreadsheet > & getSheet() const
virtual css::uno::Any SAL_CALL HPageBreaks(const css::uno::Any &aIndex) override
virtual css::uno::Any SAL_CALL PivotTables(const css::uno::Any &Index) override
virtual css::uno::Any SAL_CALL OptionButtons(const css::uno::Any &rIndex) override
ScVbaWorksheet(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::sheet::XSpreadsheet > xSheet, css::uno::Reference< css::frame::XModel > xModel)
virtual css::uno::Any SAL_CALL ScrollBars(const css::uno::Any &rIndex) override
css::uno::Any getControlShape(std::u16string_view sName)
Type
std::unordered_map< OUString, uno::WeakReference< ucb::XContent > > Contents
Destination
unsigned char sal_Bool
sal_Int16 SCTAB
Definition: types.hxx:22
InheritedHelperInterfaceWeakImpl< ov::excel::XWorksheet > WorksheetImpl_BASE