IWORKLanguageManager.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libe-book 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#ifndef IWORKLANGUAGEMANAGER_H_INCLUDED
11#define IWORKLANGUAGEMANAGER_H_INCLUDED
12
13#include <memory>
14#include <string>
15#include <unordered_map>
16#include <unordered_set>
17
18#include <librevenge/librevenge.h>
19
20 namespace libetonyek
21{
22
23 class IWORKLanguageManager
24{
25 struct LangDB;
26
27 public:
28 IWORKLanguageManager();
29
30 const std::string addTag(const std::string &tag);
31 const std::string addLanguage(const std::string &lang);
32 const std::string addLocale(const std::string &locale);
33
34 const std::string getLanguage(const std::string &tag) const;
35
36 void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const;
37
38 private:
39 const LangDB &getLangDB() const;
40
41 void addProperties(const std::string &tag);
42
43 private:
44 std::unordered_map<std::string, std::string> m_tagMap;
45 std::unordered_set<std::string> m_invalidTags;
46 std::unordered_map<std::string, std::string> m_langMap;
47 std::unordered_set<std::string> m_invalidLangs;
48 std::unordered_map<std::string, std::string> m_localeMap;
49 std::unordered_set<std::string> m_invalidLocales;
50 std::unordered_map<std::string, librevenge::RVNGPropertyList> m_propsMap;
51 mutable std::shared_ptr<LangDB> m_langDB;
52};
53
54}
55
56#endif // IWORKLANGUAGEMANAGER_H_INCLUDED
57
58/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::IWORKLanguageManager::getLangDB
const LangDB & getLangDB() const
Definition IWORKLanguageManager.cpp:212
libetonyek::IWORKLanguageManager::addLanguage
const std::string addLanguage(const std::string &lang)
Definition IWORKLanguageManager.cpp:133
libetonyek::IWORKLanguageManager::m_localeMap
std::unordered_map< std::string, std::string > m_localeMap
Definition IWORKLanguageManager.h:48
libetonyek::IWORKLanguageManager::m_langMap
std::unordered_map< std::string, std::string > m_langMap
Definition IWORKLanguageManager.h:46
libetonyek::IWORKLanguageManager::m_propsMap
std::unordered_map< std::string, librevenge::RVNGPropertyList > m_propsMap
Definition IWORKLanguageManager.h:50
libetonyek::IWORKLanguageManager::m_invalidLangs
std::unordered_set< std::string > m_invalidLangs
Definition IWORKLanguageManager.h:47
libetonyek::IWORKLanguageManager::addLocale
const std::string addLocale(const std::string &locale)
Definition IWORKLanguageManager.cpp:167
libetonyek::IWORKLanguageManager::m_tagMap
std::unordered_map< std::string, std::string > m_tagMap
Definition IWORKLanguageManager.h:44
libetonyek::IWORKLanguageManager::m_langDB
std::shared_ptr< LangDB > m_langDB
Definition IWORKLanguageManager.h:51
libetonyek::IWORKLanguageManager::m_invalidLocales
std::unordered_set< std::string > m_invalidLocales
Definition IWORKLanguageManager.h:49
libetonyek::IWORKLanguageManager::IWORKLanguageManager
IWORKLanguageManager()
Definition IWORKLanguageManager.cpp:92
libetonyek::IWORKLanguageManager::writeProperties
void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const
Definition IWORKLanguageManager.cpp:243
libetonyek::IWORKLanguageManager::addProperties
void addProperties(const std::string &tag)
Definition IWORKLanguageManager.cpp:219
libetonyek::IWORKLanguageManager::getLanguage
const std::string getLanguage(const std::string &tag) const
Definition IWORKLanguageManager.cpp:199
libetonyek::IWORKLanguageManager::addTag
const std::string addTag(const std::string &tag)
Definition IWORKLanguageManager.cpp:104
libetonyek::IWORKLanguageManager::m_invalidTags
std::unordered_set< std::string > m_invalidTags
Definition IWORKLanguageManager.h:45
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::IWORKLanguageManager::LangDB
Definition IWORKLanguageManager.cpp:69