]> git.lyx.org Git - lyx.git/blob - src/encoding.h
Dekel's patch -- I didn't fix the xforms-0.88 keysyms stuff so it still doesn't finis...
[lyx.git] / src / encoding.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef ENCODING_H
13 #define ENCODING_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "LString.h"
20 #include "lyxrc.h"
21
22 ///
23 typedef unsigned short int Uchar;
24
25 ///
26 class Encoding {
27 public:
28         ///
29         enum Letter_Form {
30                 ///
31                 FORM_ISOLATED,
32                 ///
33                 FORM_FINAL,
34                 ///
35                 FORM_INITIAL,
36                 ///
37                 FORM_MEDIAL
38         };
39         ///
40         Encoding(string const & l, Uchar const * e)
41                 : LatexName_(l) , encoding_table(e) {}
42         ///
43         string const & LatexName() const {
44                 return LatexName_;
45         }
46         ///
47         Uchar ucs(unsigned char c) const {
48                 return encoding_table[c];
49         }
50         ///
51         static
52         bool IsComposeChar_hebrew(unsigned char c);
53         ///
54         static
55         bool IsComposeChar_arabic(unsigned char c);
56         ///
57         static
58         bool is_arabic(unsigned char c);
59         ///
60         static
61         unsigned char TransformChar(unsigned char c, Letter_Form form);
62 private:
63         ///
64         string LatexName_;
65         ///
66         Uchar const * encoding_table;
67 };
68
69 ///
70 extern Encoding iso8859_1;
71 ///
72 extern Encoding iso8859_2;
73 ///
74 extern Encoding iso8859_3;
75 ///
76 extern Encoding iso8859_4;
77 ///
78 extern Encoding iso8859_6;
79 ///
80 extern Encoding iso8859_7;
81 ///
82 extern Encoding iso8859_9;
83 ///
84 extern Encoding cp1255;
85 ///
86 extern Encoding koi8;
87 ///
88 extern Encoding symbol_encoding;
89
90 #endif