]> git.lyx.org Git - lyx.git/blob - src/language.h
partial fix for '\n' output problem, still needs fixing of output before/after a...
[lyx.git] / src / language.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 LANGUAGE_H
13 #define LANGUAGE_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include <map>
20 #include "LString.h"
21
22 class Encoding;
23
24 ///
25 class Language {
26 public:
27         ///
28         Language() : RightToLeft_(false) {}
29         ///
30         Language(string const & l, string const & b, string const & d,
31                  bool rtl, Encoding const * e, string const & c)
32                 : lang_(l), babel_(b), display_(d), RightToLeft_(rtl),
33                   encoding_(e), code_(c)
34                 {}
35         ///
36         string const & lang() const {
37                 return lang_;
38         }
39         ///
40         string const & babel() const {
41                 return babel_;
42         }
43         ///
44         string const & display() const {
45                 return display_;
46         }
47         ///
48         bool RightToLeft() const {
49                 return RightToLeft_;
50         }
51         ///
52         Encoding const * encoding() const {
53                 return encoding_;
54         }
55         ///
56         string const & code() const {
57                 return code_;
58         }
59 private:
60         ///
61         string lang_;
62         ///
63         string babel_;
64         ///
65         string display_;
66         ///
67         bool RightToLeft_;
68         ///
69         Encoding const * encoding_;
70         ///
71         string code_;
72 };
73
74 #if 0
75 ///
76 bool operator==(Language const & l1, Language const & l2) 
77 {
78         return l1.lang == l2.lang
79                 && l1.display_ == l2.display_
80                 && l1.RightToLeft_ == l2.RightToLeft_
81                 && l1.encoding_ == l2.encoding_;
82 }
83
84 ///
85 bool operator!=(Language const l1, Language const & l2)
86 {
87         return !(l1 == l2);
88
89 }
90 #endif
91 ///
92 typedef std::map<string, Language> Languages;
93 ///
94 extern Languages languages;
95 ///
96 extern Language const * default_language;
97 ///
98 extern Language const *ignore_language;
99
100 #endif