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 #pragma once
21 
22 #include <formula/opcode.hxx>
24 #include <vector>
25 #include <memory>
26 #include <unordered_map>
27 
28 namespace com::sun::star::lang
29 {
30 struct Locale;
31 }
32 
33 struct TransItem;
34 
36 {
37  const char* mpName;
39  const css::lang::Locale& mrLocale;
40 
41  ScCellKeyword(const char* pName, OpCode eOpCode, const css::lang::Locale& rLocale);
42 };
43 
44 typedef std::unordered_map<OUString, ::std::vector<ScCellKeyword>> ScCellKeywordHashMap;
45 
65 {
66 public:
67  static void transKeyword(OUString& rName, const css::lang::Locale* pLocale, OpCode eOpCode);
69 
70 private:
72 
73  void init();
74  void addToMap(const OUString& rKey, const char* pName, const css::lang::Locale& rLocale,
75  OpCode eOpCode);
76  void addToMap(const TransItem* pItems, const css::lang::Locale& rLocale);
77 
78  static ::std::unique_ptr<ScCellKeywordTranslator> spInstance;
81 };
82 
83 /* 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