- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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 <string>
14
15 #include <boost/shared_ptr.hpp>
16 #include <boost/unordered_map.hpp>
17 #include <boost/unordered_set.hpp>
18
19 #include <librevenge/librevenge.h>
20
21 namespace libetonyek
22 {
23
24 class IWORKLanguageManager
25 {
26 struct LangDB;
27
28 public:
29 IWORKLanguageManager();
30
31 const std::string addTag(const std::string &tag);
32 const std::string addLanguage(const std::string &lang);
33 const std::string addLocale(const std::string &locale);
34
35 const std::string getLanguage(const std::string &tag) const;
36
37 void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const;
38
39 private:
40 const LangDB &getLangDB() const;
41
42 void addProperties(const std::string &tag);
43
44 private:
45 boost::unordered_map<std::string, std::string> m_tagMap;
46 boost::unordered_set<std::string> m_invalidTags;
47 boost::unordered_map<std::string, std::string> m_langMap;
48 boost::unordered_set<std::string> m_invalidLangs;
49 boost::unordered_map<std::string, std::string> m_localeMap;
50 boost::unordered_set<std::string> m_invalidLocales;
51 boost::unordered_map<std::string, librevenge::RVNGPropertyList> m_propsMap;
52 mutable boost::shared_ptr<LangDB> m_langDB;
53 };
54
55 }
56
57 #endif // IWORKLANGUAGEMANAGER_H_INCLUDED
58
59 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek
Definition: IWORKBezierElement.cpp:18
libetonyek::IWORKLanguageManager::LangDB
Definition: IWORKLanguageManager.cpp:60
libetonyek::IWORKLanguageManager::IWORKLanguageManager
IWORKLanguageManager()
Definition: IWORKLanguageManager.cpp:82
libetonyek::IWORKLanguageManager::m_langDB
boost::shared_ptr< LangDB > m_langDB
Definition: IWORKLanguageManager.h:52
libetonyek::IWORKLanguageManager::m_localeMap
boost::unordered_map< std::string, std::string > m_localeMap
Definition: IWORKLanguageManager.h:49
libetonyek::IWORKLanguageManager::addLocale
const std::string addLocale(const std::string &locale)
Definition: IWORKLanguageManager.cpp:148
libetonyek::IWORKLanguageManager::m_invalidTags
boost::unordered_set< std::string > m_invalidTags
Definition: IWORKLanguageManager.h:46
libetonyek::IWORKLanguageManager
Definition: IWORKLanguageManager.h:24
libetonyek::IWORKLanguageManager::getLanguage
const std::string getLanguage(const std::string &tag) const
Definition: IWORKLanguageManager.cpp:175
libetonyek::IWORKToken::string
Definition: IWORKToken.h:252
libetonyek::IWORKLanguageManager::addLanguage
const std::string addLanguage(const std::string &lang)
Definition: IWORKLanguageManager.cpp:119
libetonyek::IWORKLanguageManager::m_invalidLangs
boost::unordered_set< std::string > m_invalidLangs
Definition: IWORKLanguageManager.h:48
libetonyek::IWORKLanguageManager::m_invalidLocales
boost::unordered_set< std::string > m_invalidLocales
Definition: IWORKLanguageManager.h:50
libetonyek::IWORKLanguageManager::addTag
const std::string addTag(const std::string &tag)
Definition: IWORKLanguageManager.cpp:94
libetonyek::IWORKLanguageManager::getLangDB
const LangDB & getLangDB() const
Definition: IWORKLanguageManager.cpp:183
libetonyek::IWORKLanguageManager::m_tagMap
boost::unordered_map< std::string, std::string > m_tagMap
Definition: IWORKLanguageManager.h:45
libetonyek::IWORKLanguageManager::m_langMap
boost::unordered_map< std::string, std::string > m_langMap
Definition: IWORKLanguageManager.h:47
libetonyek::IWORKLanguageManager::writeProperties
void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const
Definition: IWORKLanguageManager.cpp:210
libetonyek::IWORKLanguageManager::m_propsMap
boost::unordered_map< std::string, librevenge::RVNGPropertyList > m_propsMap
Definition: IWORKLanguageManager.h:51
libetonyek::IWORKLanguageManager::addProperties
void addProperties(const std::string &tag)
Definition: IWORKLanguageManager.cpp:190