11 #include "tex-accent.h"
13 #include "trans_decl.h"
21 TransInterface: the interface that every translation class
23 Visitor pattern applied here
25 class TransInterface {
28 virtual string const process(char, TransManager &) = 0;
30 virtual bool isAccentDefined(tex_accent, KmodInfo &) const = 0;
34 DefaultTrans: the default translation class. Holds info
35 on tex-accents. Monostate
37 class DefaultTrans : public TransInterface {
42 virtual string const process(char, TransManager &);
50 Trans: holds a .kmap file
52 //class Trans : public TransInterface {
61 int Load(string const & language);
63 bool IsDefined() const;
65 string const & GetName() const;
67 string const process(char, TransManager &);
69 bool isAccentDefined(tex_accent, KmodInfo &) const;
74 typedef KmodInfo kmod_list_decl;
76 typedef KmodException keyexc;
80 void AddDeadkey(tex_accent, string const &, string const &);
83 void AddDeadkey(tex_accent, string const &);
90 inline string const & Match(unsigned char c);
92 void InsertException(KmodException & exclist, char c,
93 string const & data, bool = false,
94 tex_accent = TEX_NOACCENT);
96 void FreeException(KmodException & exclist);
104 std::map<int, string> keymap_;
108 kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1];
111 //KmodInfo * kmod_list_[TEX_MAX_ACCENT+1];
112 std::map<int, KmodInfo> kmod_list_;
118 string const & Trans::Match(unsigned char c)
123 std::map<int, string>::iterator it = keymap_.find(c);
124 if (it != keymap_.end()) {