]> git.lyx.org Git - lyx.git/blob - src/encoding.h
* Painter.h:
[lyx.git] / src / encoding.h
1 // -*- C++ -*-
2 /**
3  * \file encoding.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef ENCODING_H
14 #define ENCODING_H
15
16 #include <map>
17 #include <string>
18
19 #include "support/types.h"
20
21 namespace lyx {
22
23 ///
24 class Encoding {
25 public:
26         ///
27         Encoding() {}
28         ///
29         Encoding(std::string const & n, std::string const & l,
30                  std::string const & i)
31                 : Name_(n), LatexName_(l), iconvName_(i)
32         {
33         }
34         ///
35         std::string const & name() const { return Name_; }
36         ///
37         std::string const & latexName() const { return LatexName_; }
38         ///
39         std::string const & iconvName() const { return iconvName_; }
40 private:
41         ///
42         std::string Name_;
43         ///
44         std::string LatexName_;
45         ///
46         std::string iconvName_;
47 };
48
49 extern Encoding symbol_encoding;
50
51 class Encodings {
52 public:
53         ///
54         typedef std::map<std::string, Encoding> EncodingList;
55         ///
56         Encodings();
57         ///
58         void read(std::string const & filename);
59         ///
60         Encoding const * getEncoding(std::string const & encoding) const;
61         ///
62         Encoding const * symbol_encoding() { return &symbol_encoding_; }
63
64         ///
65         enum Letter_Form {
66                 ///
67                 FORM_ISOLATED,
68                 ///
69                 FORM_FINAL,
70                 ///
71                 FORM_INITIAL,
72                 ///
73                 FORM_MEDIAL
74         };
75         ///
76         static bool isComposeChar_hebrew(char_type c);
77         ///
78         static bool isComposeChar_arabic(char_type c);
79         ///
80         static bool is_arabic_special(char_type c);
81         ///
82         static bool is_arabic(char_type c);
83         ///
84         static char_type transformChar(char_type c, Letter_Form form);
85
86 private:
87         ///
88         EncodingList encodinglist;
89         ///
90         Encoding symbol_encoding_;
91 };
92
93 extern Encodings encodings;
94
95
96 } // namespace lyx
97
98 #endif