Consider the case where there is not any layout name.
[lyx.git] / src / trans.h
blob6311e74def6b01cb20f86b934ca9bc9c4fe6900c
1 // -*- C++ -*-
2 /**
3 * \file trans.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Matthias Ettrich
9 * \author John Levon
11 * Full author contact details are available in file CREDITS.
14 #ifndef TRANS_H
15 #define TRANS_H
17 #include "trans_decl.h"
19 #include <map>
22 class LyXLex;
24 class TransManager;
26 /**
27 Trans: holds a .kmap file
29 class Trans {
30 public:
31 ///
32 Trans();
33 ///
34 ~Trans();
36 ///
37 int Load(std::string const & language);
38 ///
39 bool IsDefined() const;
40 ///
41 std::string const & GetName() const;
42 ///
43 std::string const process(char, TransManager &);
44 ///
45 bool isAccentDefined(tex_accent, KmodInfo &) const;
47 private:
48 ///
49 void AddDeadkey(tex_accent, std::string const &);
50 ///
51 void FreeKeymap();
52 ///
53 int Load(LyXLex &);
54 ///
55 std::string const & Match(unsigned char c);
56 ///
57 void InsertException(KmodException & exclist, char c,
58 std::string const & data, bool = false,
59 tex_accent = TEX_NOACCENT);
60 ///
61 void FreeException(KmodException & exclist);
63 ///
64 std::string name_;
65 ///
66 std::map<int, std::string> keymap_;
67 ///
68 std::map<int, KmodInfo> kmod_list_;
72 ///
73 inline
74 std::string const & Trans::Match(unsigned char c)
76 std::map<int, std::string>::iterator it = keymap_.find(c);
77 if (it != keymap_.end()) {
78 return it->second;
80 static std::string dummy;
81 return dummy;
84 #endif // TRANS_H