]> git.lyx.org Git - lyx.git/blobdiff - src/messages.h
Fix encoding of converters path and arguments
[lyx.git] / src / messages.h
index 7522abc5cfea429acbfc0a97f989b2fac653f648..166f4601d01b28d232e64e298d7ddf14d536bbf8 100644 (file)
@@ -5,28 +5,45 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef MESSAGES_H
 #define MESSAGES_H
 
-#include "LString.h"
+#include "support/docstring.h"
 
-#include <boost/scoped_ptr.hpp>
+#include <map>
+#include <string>
+
+namespace lyx {
 
 ///
 class Messages {
 public:
+       /// messages in the language \p l.
+       /// If \p l is empty, the language will be defined by the environment.
+       Messages(std::string const & l = "");
        ///
-       Messages(string const & l, string const & dir);
+       docstring const get(std::string const & msg) const;
+private:
        ///
-       ~Messages();
+       std::string lang_;
        ///
-       string const get(string const & msg) const;
-private:
-       class Pimpl;
-       boost::scoped_ptr<Pimpl> pimpl_;
+       typedef std::map<std::string, docstring> TranslationCache;
+       /// Internal cache for gettext translated strings.
+       /// This is needed for performance reason within \c updateLabels()
+       /// under Windows.
+       mutable TranslationCache cache_;
 };
 
+/// Access to the unique Messages object for the passed \p language.
+/// Implementation is in lyx_main.C.
+extern Messages & getMessages(std::string const & language);
+/// Access to the unique Messages object used for GUI element.
+/// Implementation is in lyx_main.C.
+extern Messages & getGuiMessages();
+
+} // namespace lyx
+
 #endif