LibreOffice Module sc (master)  1
cellkeytranslator.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 #ifndef INCLUDED_SC_SOURCE_CORE_INC_CELLKEYTRANSLATOR_HXX
21 #define INCLUDED_SC_SOURCE_CORE_INC_CELLKEYTRANSLATOR_HXX
22 
23 #include <formula/opcode.hxx>
25 #include <vector>
26 #include <memory>
27 #include <unordered_map>
28 
29 namespace com::sun::star::lang
30 {
31 struct Locale;
32 }
33 
34 struct TransItem;
35 
37 {
38  const char* mpName;
40  const css::lang::Locale& mrLocale;
41 
42  ScCellKeyword(const char* pName, OpCode eOpCode, const css::lang::Locale& rLocale);
43 };
44 
45 typedef std::unordered_map<OUString, ::std::vector<ScCellKeyword>> ScCellKeywordHashMap;
46 
66 {
67 public:
68  static void transKeyword(OUString& rName, const css::lang::Locale* pLocale, OpCode eOpCode);
70 
71 private:
73 
74  void init();
75  void addToMap(const OUString& rKey, const char* pName, const css::lang::Locale& rLocale,
76  OpCode eOpCode);
77  void addToMap(const TransItem* pItems, const css::lang::Locale& rLocale);
78 
79  static ::std::unique_ptr<ScCellKeywordTranslator> spInstance;
82 };
83 
84 #endif
85 
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static::std::unique_ptr< ScCellKeywordTranslator > spInstance
const char * pLocale
ScCellKeywordHashMap maStringNameMap
std::unordered_map< OUString,::std::vector< ScCellKeyword > > ScCellKeywordHashMap
void addToMap(const OUString &rKey, const char *pName, const css::lang::Locale &rLocale, OpCode eOpCode)
ScCellKeyword(const char *pName, OpCode eOpCode, const css::lang::Locale &rLocale)
OpCode
Translate cell function keywords.
sal_uInt16 char * pName
Definition: callform.cxx:57
const css::lang::Locale & mrLocale
static void transKeyword(OUString &rName, const css::lang::Locale *pLocale, OpCode eOpCode)
const char * mpName
::utl::TransliterationWrapper maTransWrapper