4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * \author Jürgen Vigna
12 * Full author contact details are available in file CREDITS.
24 namespace support { class FileName; }
33 Language() : rightToLeft_(false) {}
35 std::string const & lang() const { return lang_; }
37 std::string const & babel() const { return babel_; }
39 std::string const & display() const { return display_; }
41 bool rightToLeft() const { return rightToLeft_; }
43 Encoding const * encoding() const { return encoding_; }
45 std::string const & encodingStr() const { return encodingStr_; }
47 std::string const & code() const { return code_; }
49 std::string const & latex_options() const { return latex_options_; }
51 bool internalFontEncoding() const;
53 bool read(Lexer & lex);
54 // for the use in std::map
55 friend bool operator<(Language const & p, Language const & q);
66 std::string encodingStr_;
68 Encoding const * encoding_;
72 std::string latex_options_;
76 inline bool operator<(Language const & p, Language const & q)
78 return q.lang() > p.lang();
86 typedef std::map<std::string, Language> LanguageList;
88 typedef LanguageList::const_iterator const_iterator;
90 typedef LanguageList::size_type size_type;
92 void read(support::FileName const & filename);
94 Language const * getLanguage(std::string const & language) const;
96 size_type size() const { return languagelist.size(); }
98 const_iterator begin() const { return languagelist.begin(); }
100 const_iterator end() const { return languagelist.end(); }
105 LanguageList languagelist;
108 /// Global singleton instance.
109 extern Languages languages;
110 /// Default language defined in LyXRC
111 extern Language const * default_language;
112 /// Used to indicate that the language should be left unchanged when
113 /// applying a font change.
114 extern Language const * ignore_language;
115 /// Default language defined in LyXRC
116 extern Language const * latex_language;
117 /// Used to indicate that the language should be reset to the Buffer
118 // language when applying a font change.
119 extern Language const * reset_language;