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