LibreOffice Module sc (master)  1
macromgr.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 
10 #pragma once
11 
12 #include <com/sun/star/container/XContainerListener.hpp>
13 
14 #include <rtl/ustring.hxx>
15 #include "scdllapi.h"
16 
17 #include <memory>
18 #include <unordered_map>
19 
20 class ScDocument;
21 class ScFormulaCell;
23 
25 {
26 public:
27  explicit ScMacroManager(ScDocument& rDoc);
29 
31  SC_DLLPUBLIC void SetUserFuncVolatile(const OUString& sName, bool isVolatile);
32  SC_DLLPUBLIC bool GetUserFuncVolatile(const OUString& sName);
33 
34  void AddDependentCell(const OUString& aModuleName, ScFormulaCell* pCell);
35  void RemoveDependentCell(const ScFormulaCell* pCell);
36  void BroadcastModuleUpdate(const OUString& aModuleName);
37 
38 private:
39  typedef std::unordered_map<OUString, bool> NameBoolMap;
40  NameBoolMap mhFuncToVolatile;
41  css::uno::Reference<css::container::XContainerListener> mxContainerListener;
42 
43  ::std::unique_ptr<ScUserMacroDepTracker> mpDepTracker;
45 };
46 
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A simple container to keep track of cells that depend on basic modules changes.
Definition: macromgr.cxx:42
SC_DLLPUBLIC void InitUserFuncData()
Definition: macromgr.cxx:130
void BroadcastModuleUpdate(const OUString &aModuleName)
Definition: macromgr.cxx:187
NameBoolMap mhFuncToVolatile
Definition: macromgr.hxx:40
SC_DLLPUBLIC void SetUserFuncVolatile(const OUString &sName, bool isVolatile)
Definition: macromgr.cxx:164
SC_DLLPUBLIC bool GetUserFuncVolatile(const OUString &sName)
Definition: macromgr.cxx:169
ScMacroManager(ScDocument &rDoc)
Definition: macromgr.cxx:93
void RemoveDependentCell(const ScFormulaCell *pCell)
Definition: macromgr.cxx:182
css::uno::Reference< css::container::XContainerListener > mxContainerListener
Definition: macromgr.hxx:41
std::unordered_map< OUString, bool > NameBoolMap
Definition: macromgr.hxx:39
const char * sName
::std::unique_ptr< ScUserMacroDepTracker > mpDepTracker
Definition: macromgr.hxx:43
ScDocument & mrDoc
Definition: macromgr.hxx:44
void AddDependentCell(const OUString &aModuleName, ScFormulaCell *pCell)
Definition: macromgr.cxx:177
#define SC_DLLPUBLIC
Definition: scdllapi.h:27