]> git.lyx.org Git - lyx.git/blob - src/encoding.h
hopefully fix tex2lyx linking.
[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 class Encodings {
50 public:
51         ///
52         typedef std::map<std::string, Encoding> EncodingList;
53         ///
54         Encodings();
55         ///
56         void read(std::string const & filename);
57         /// Get encoding from LyX name \p name
58         Encoding const * getFromLyXName(std::string const & name) const;
59         /// Get encoding from LaTeX name \p name
60         Encoding const * getFromLaTeXName(std::string const & name) const;
61
62         ///
63         enum Letter_Form {
64                 ///
65                 FORM_ISOLATED,
66                 ///
67                 FORM_FINAL,
68                 ///
69                 FORM_INITIAL,
70                 ///
71                 FORM_MEDIAL
72         };
73         ///
74         static bool isComposeChar_hebrew(char_type c);
75         ///
76         static bool isComposeChar_arabic(char_type c);
77         ///
78         static bool is_arabic_special(char_type c);
79         ///
80         static bool is_arabic(char_type c);
81         ///
82         static char_type transformChar(char_type c, Letter_Form form);
83
84 private:
85         ///
86         EncodingList encodinglist;
87 };
88
89 extern Encodings encodings;
90
91
92 } // namespace lyx
93
94 #endif