]> git.lyx.org Git - lyx.git/blob - src/encoding.h
Small fix.
[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 typedef unsigned short int Uchar;
23
24 class Encoding {
25 public:
26         ///
27         enum Letter_Form {
28                 FORM_ISOLATED,
29                 FORM_FINAL,
30                 FORM_INITIAL,
31                 FORM_MEDIAL
32         };
33         ///
34         Encoding(string const & l, Uchar const * e)
35                 : LatexName_(l) , encoding_table(e) {}
36         ///
37         string const & LatexName() const {
38                 return LatexName_;
39         }
40         ///
41         Uchar ucs(unsigned char c) const {
42                 return encoding_table[c];
43         }
44         ///
45         static
46         bool IsComposeChar_hebrew(unsigned char c);
47         ///
48         static
49         bool IsComposeChar_arabic(unsigned char c);
50         ///
51         static
52         bool is_arabic(unsigned char c);
53         ///
54         static
55         unsigned char TransformChar(unsigned char c, Letter_Form form);
56 private:
57         ///
58         string LatexName_;
59         ///
60         Uchar const * encoding_table;
61 };
62
63
64 extern Encoding iso8859_1;
65 extern Encoding iso8859_2;
66 extern Encoding iso8859_3;
67 extern Encoding iso8859_4;
68 extern Encoding iso8859_6;
69 extern Encoding iso8859_7;
70 extern Encoding iso8859_9;
71 extern Encoding cp1255;
72 extern Encoding koi8;
73 extern Encoding symbol_encoding;
74
75 #endif