X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flanguage.h;h=a043c0af83c3488c64ff477e3eaeda39eed9e746;hb=0de182f2571c1ab327843cc281bc1f5302058e26;hp=cb8d996649635c510b6972a15a22a2ba925b943a;hpb=82fa210ea8d38d51aafb131f10d843e27e056429;p=lyx.git diff --git a/src/language.h b/src/language.h index cb8d996649..a043c0af83 100644 --- a/src/language.h +++ b/src/language.h @@ -1,35 +1,117 @@ // -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2001 The LyX Team. + * + * ====================================================== */ + #ifndef LANGUAGE_H #define LANGUAGE_H #include #include "LString.h" -struct Language { - string lang; - string display; - bool RightToLeft; -}; - -#if 0 -bool operator==(Language const & l1, Language const & l2) -{ - return l1.lang == l2.lang - && l1.display == l2.display - && l1.RightToLeft == l2.RightToLeft; -} +class Encoding; +/// +class Language { +public: + /// + Language() : RightToLeft_(false) {} + /// + Language(string const & l, string const & b, string const & d, + bool rtl, Encoding const * e, string const & c, + string const & o) + : lang_(l), babel_(b), display_(d), RightToLeft_(rtl), + encoding_(e), code_(c), latex_options_(o) + {} + /// + string const & lang() const { + return lang_; + } + /// + string const & babel() const { + return babel_; + } + /// + string const & display() const { + return display_; + } + /// + bool RightToLeft() const { + return RightToLeft_; + } + /// + Encoding const * encoding() const { + return encoding_; + } + /// + string const & code() const { + return code_; + } + /// + string const & latex_options() const { + return latex_options_; + } +private: + /// + string lang_; + /// + string babel_; + /// + string display_; + /// + bool RightToLeft_; + /// + Encoding const * encoding_; + /// + string code_; + /// + string latex_options_; +}; -bool operator!=(Language const l1, Language const & l2) +class Languages { - return !(l1 == l2); +public: + /// + typedef std::map LanguageList; + /// + typedef LanguageList::const_iterator const_iterator; + /// + typedef LanguageList::size_type size_type; + /// + void read(string const & filename); + /// + void setDefaults(); + /// + Language const * getLanguage(string const & language) const; + /// + size_type size() const { + return languagelist.size(); + } + /// + const_iterator begin() const { + return languagelist.begin(); + } + /// + const_iterator end() const { + return languagelist.end(); + } + /// -} -#endif +private: + /// + LanguageList languagelist; +}; -typedef std::map Languages; extern Languages languages; extern Language const * default_language; -extern Language const *ignore_language; +extern Language const * english_language; +extern Language const * ignore_language; +extern Language const * latex_language; #endif