]> git.lyx.org Git - lyx.git/blob - src/trans.h
remove out-commented code
[lyx.git] / src / trans.h
1 // -*- C++ -*-
2 #ifndef Trans_h
3 #define Trans_h
4
5 #ifdef __GNUG__
6 #pragma interface
7 #endif
8
9 #include <map>
10
11 #include "tex-accent.h"
12 #include "LString.h"
13 #include "trans_decl.h"
14
15 class LyXLex;
16
17 class TransManager;
18
19 /**
20   Trans: holds a .kmap file 
21   */
22 //class Trans : public TransInterface {
23 class Trans {
24 public:
25         ///
26         Trans();
27         ///
28         ~Trans();
29
30         ///
31         int Load(string const & language);
32         ///
33         bool IsDefined() const;
34         ///
35         string const & GetName() const;
36         ///
37         string const process(char, TransManager &);
38         ///
39         bool isAccentDefined(tex_accent, KmodInfo &) const;
40     
41 private:
42         ///
43         void AddDeadkey(tex_accent, string const &);
44         ///
45         void FreeKeymap();
46         ///
47         int Load(LyXLex &);
48         ///
49         string const & Match(unsigned char c);
50         ///
51         void InsertException(KmodException & exclist, char c,
52                              string const & data, bool = false,
53                              tex_accent = TEX_NOACCENT);
54         ///
55         void FreeException(KmodException & exclist);
56
57         ///
58         string name_;
59         ///
60         std::map<int, string> keymap_;
61         ///
62         std::map<int, KmodInfo> kmod_list_;
63 };
64
65
66 ///
67 inline
68 string const & Trans::Match(unsigned char c)
69 {
70         std::map<int, string>::iterator it = keymap_.find(c);
71         if (it != keymap_.end()) {
72                 return it->second;
73         }
74         static string dummy;
75         return dummy;
76 }
77
78 #endif