Debian Codegraph @

librime-charcode/src/codepoint_translator.h

raw
1 //
2 // Copyright RIME Developers
3 // Distributed under the BSD License
4 //
5 // 2016-09-08 osfans <[email protected]>
6 //
7 #ifndef RIME_CODEPOINT_TRANSLATOR_H_
8 #define RIME_CODEPOINT_TRANSLATOR_H_
9
10 #include <rime/translator.h>
11
12 namespace rime {
13
14 class TranslatorOptions;
15
16 class CodepointTranslator : public Translator {
17 public:
18 CodepointTranslator(const Ticket& ticket);
19
20 virtual an<Translation> Query(const string& input,
21 const Segment& segment);
22
23 protected:
24 void Initialize();
25
26 string tag_;
27 bool initialized_ = false;
28 string prefix_;
29 string suffix_;
30 string tips_;
31 string charset_;
32 map<string /*encoding*/, function<string /*converted text*/ (const string& code)>> converters_;
33 };
34
35 } // namespace rime
36
37 #endif // RIME_CODEPOINT_TRANSLATOR_H_