LibreOffice Module sc (master)  1
xename.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 
20 #pragma once
21 
22 #include "xerecord.hxx"
23 #include "xlformula.hxx"
24 #include "xeroot.hxx"
25 #include <memory>
26 
27 class ScRangeList;
29 
32 {
33 public:
34  explicit XclExpNameManager( const XclExpRoot& rRoot );
35  virtual ~XclExpNameManager() override;
36 
38  void Initialize();
39 
41  sal_uInt16 InsertName( SCTAB nTab, sal_uInt16 nScNameIdx, SCTAB nCurrTab );
42 
44  sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, const ScRange& rRange );
46  sal_uInt16 InsertBuiltInName( sal_Unicode cBuiltIn, const ScRangeList& rRangeList );
47 
49  sal_uInt16 InsertUniqueName( const OUString& rName, const XclTokenArrayRef& xTokArr, SCTAB nScTab );
51  sal_uInt16 InsertRawName( const OUString& rName );
55  sal_uInt16 InsertMacroCall( const OUString& rMacroName, bool bVBasic, bool bFunc, bool bHidden = false );
56 
58  const OUString& GetOrigName( sal_uInt16 nNameIdx ) const;
60  SCTAB GetScTab( sal_uInt16 nNameIdx ) const;
62  bool IsVolatile( sal_uInt16 nNameIdx ) const;
63 
65  virtual void Save( XclExpStream& rStrm ) override;
66  virtual void SaveXml( XclExpXmlStream& rStrm ) override;
67 
68 private:
69  typedef std::shared_ptr< XclExpNameManagerImpl > XclExpNameMgrImplRef;
70  XclExpNameMgrImplRef mxImpl;
71 };
72 
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~XclExpNameManager() override
Definition: xename.cxx:793
This class is used to export Excel record streams.
Definition: xestream.hxx:72
bool IsVolatile(sal_uInt16 nNameIdx) const
Returns true, if the specified defined name is volatile.
Definition: xename.cxx:852
XclExpNameMgrImplRef mxImpl
Definition: xename.hxx:70
virtual void Save(XclExpStream &rStrm) override
Writes the entire list of NAME records.
Definition: xename.cxx:858
SCTAB GetScTab(sal_uInt16 nNameIdx) const
Returns the Calc sheet of a local defined name, or SCTAB_GLOBAL for global defined names...
Definition: xename.cxx:846
sal_uInt16 sal_Unicode
Access to global data from other classes.
Definition: xeroot.hxx:112
sal_uInt16 InsertUniqueName(const OUString &rName, const XclTokenArrayRef &xTokArr, SCTAB nScTab)
Inserts a new defined name.
Definition: xename.cxx:824
Base class for all Excel records.
Definition: xerecord.hxx:37
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xename.cxx:863
Manager that stores all internal defined names (NAME records) of the document.
Definition: xename.hxx:31
sal_uInt16 InsertRawName(const OUString &rName)
Returns index of an existing name, or creates a name without definition.
Definition: xename.cxx:830
const OUString & GetOrigName(sal_uInt16 nNameIdx) const
Returns the Calc sheet of a local defined name, or SCTAB_GLOBAL for global defined names...
Definition: xename.cxx:840
std::shared_ptr< XclExpNameManagerImpl > XclExpNameMgrImplRef
Definition: xename.hxx:69
std::shared_ptr< XclTokenArray > XclTokenArrayRef
Definition: xlformula.hxx:416
sal_uInt16 InsertBuiltInName(sal_Unicode cBuiltIn, const ScRange &rRange)
Inserts a new built-in defined name, referring to the passed sheet range.
Definition: xename.cxx:807
Implementation class of the name manager.
Definition: xename.cxx:115
sal_uInt16 InsertMacroCall(const OUString &rMacroName, bool bVBasic, bool bFunc, bool bHidden=false)
Searches or inserts a defined name describing a macro name.
Definition: xename.cxx:835
void Initialize()
Creates NAME records for built-in and user defined names.
Definition: xename.cxx:797
XclExpNameManager(const XclExpRoot &rRoot)
Definition: xename.cxx:787
sal_uInt16 InsertName(SCTAB nTab, sal_uInt16 nScNameIdx, SCTAB nCurrTab)
Inserts the Calc name with the passed index and returns the Excel NAME index.
Definition: xename.cxx:802
void SvStream & rStrm
sal_Int16 SCTAB
Definition: types.hxx:22