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
29{
30struct Locale;
31}
32
33struct 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
44typedef std::unordered_map<OUString, ::std::vector<ScCellKeyword>> ScCellKeywordHashMap;
45
65{
66public:
67 static void transKeyword(OUString& rName, const css::lang::Locale* pLocale, OpCode eOpCode);
69
70private:
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: */
std::unordered_map< OUString, ::std::vector< ScCellKeyword > > ScCellKeywordHashMap
Translate cell function keywords.
void addToMap(const OUString &rKey, const char *pName, const css::lang::Locale &rLocale, OpCode eOpCode)
::utl::TransliterationWrapper maTransWrapper
static void transKeyword(OUString &rName, const css::lang::Locale *pLocale, OpCode eOpCode)
void addToMap(const TransItem *pItems, const css::lang::Locale &rLocale)
static ::std::unique_ptr< ScCellKeywordTranslator > spInstance
ScCellKeywordHashMap maStringNameMap
const char * pLocale
OpCode
const char * mpName
const css::lang::Locale & mrLocale
ScCellKeyword(const char *pName, OpCode eOpCode, const css::lang::Locale &rLocale)