]> git.lyx.org Git - lyx.git/blobdiff - src/trans_mgr.h
Remove cached var from RenderPreview. Changes elsewhere to suit.
[lyx.git] / src / trans_mgr.h
index 999ff3694a0cfcd9e7896843f43926e7478f737a..a9e45777eb364e0b5e26a37c0fb17054b6a696f6 100644 (file)
 #ifndef TRANS_MANAGER_H
 #define TRANS_MANAGER_H
 
-#include "tex-accent.h"
-#include "trans_decl.h"
 #include "chset.h"
-#include "LString.h"
+#include "trans_decl.h"
+
+#include <boost/scoped_ptr.hpp>
 
 class LyXText;
 class Trans;
@@ -28,11 +28,11 @@ public:
        ///
        virtual ~TransState() {}
        ///
-       virtual string const normalkey(char) = 0;
+       virtual std::string const normalkey(char) = 0;
        ///
        virtual bool backspace() = 0;
        ///
-       virtual string const deadkey(char, KmodInfo) = 0;
+       virtual std::string const deadkey(char, KmodInfo) = 0;
        ///
        static char const TOKEN_SEP;
 };
@@ -74,11 +74,11 @@ public:
        ///
        TransInitState();
        ///
-       virtual string const normalkey(char);
+       virtual std::string const normalkey(char);
        ///
        virtual bool backspace() { return true; }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual std::string const deadkey(char, KmodInfo);
 };
 
 
@@ -88,14 +88,14 @@ public:
        ///
        TransDeadkeyState();
        ///
-       virtual string const normalkey(char);
+       virtual std::string const normalkey(char);
        ///
        virtual bool backspace() {
                currentState = init_state_;
                return false;
        }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual std::string const deadkey(char, KmodInfo);
 };
 
 
@@ -105,7 +105,7 @@ public:
        ///
        TransCombinedState();
        ///
-       virtual string const normalkey(char);
+       virtual std::string const normalkey(char);
        ///
        virtual bool backspace() {
                // cancel the second deadkey
@@ -116,7 +116,7 @@ public:
                return false;
        }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual std::string const deadkey(char, KmodInfo);
 };
 
 
@@ -139,26 +139,26 @@ private:
        ///
        Trans * active_;
        ///
-       Trans * t1_;
+       boost::scoped_ptr<Trans> t1_;
        ///
-       Trans * t2_;
+       boost::scoped_ptr<Trans> t2_;
        ///
        static Trans default_;
        ///
        CharacterSet chset_;
        ///
-       void insert(string const &, LyXText *);
+       void insert(std::string const &, LyXText *);
        ///
-       void insertVerbatim(string const &, LyXText *);
+       void insertVerbatim(std::string const &, LyXText *);
 public:
        ///
        TransManager();
        ///
-       virtual ~TransManager();
+       ~TransManager();
        ///
-       int SetPrimary(string const &);
+       int SetPrimary(std::string const &);
        ///
-       int SetSecondary(string const &);
+       int SetSecondary(std::string const &);
        ///
        void EnablePrimary();
        ///
@@ -166,7 +166,7 @@ public:
        ///
        void DisableKeymap();
        ///
-       bool setCharset(string const &);
+       bool setCharset(std::string const &);
        ///
        bool backspace() {
                return trans_fsm_.currentState->backspace();
@@ -174,23 +174,23 @@ public:
        ///
        void TranslateAndInsert(char, LyXText *);
        ///
-       string const deadkey(char, KmodInfo);
+       std::string const deadkey(char, KmodInfo);
        ///
-       string const normalkey(char);
+       std::string const normalkey(char);
        ///
        void deadkey(char, tex_accent, LyXText *);
 };
 
 
 inline
-string const TransManager::normalkey(char c)
+std::string const TransManager::normalkey(char c)
 {
        return trans_fsm_.currentState->normalkey(c);
 }
 
 
 inline
-string const TransManager::deadkey(char c, KmodInfo t)
+std::string const TransManager::deadkey(char c, KmodInfo t)
 {
        return trans_fsm_.currentState->deadkey(c, t);
 }