]> git.lyx.org Git - lyx.git/blobdiff - src/trans_mgr.h
Restore the version number position on the splash screen
[lyx.git] / src / trans_mgr.h
index 7336146b8f72a3f4f427ddf664894cddbc44d6f8..b26fa10931ca025370f9403cb01fc4ca0d577a96 100644 (file)
 #ifndef TRANS_MANAGER_H
 #define TRANS_MANAGER_H
 
-#include "tex-accent.h"
 #include "trans_decl.h"
-#include "chset.h"
-#include "support/std_string.h"
 
+#include <boost/scoped_ptr.hpp>
+
+
+namespace lyx {
+
+class LCursor;
 class LyXText;
 class Trans;
 
@@ -28,13 +31,13 @@ public:
        ///
        virtual ~TransState() {}
        ///
-       virtual string const normalkey(char) = 0;
+       virtual docstring const normalkey(char_type) = 0;
        ///
        virtual bool backspace() = 0;
        ///
-       virtual string const deadkey(char, KmodInfo) = 0;
+       virtual docstring const deadkey(char_type, KmodInfo) = 0;
        ///
-       static char const TOKEN_SEP;
+       static char_type const TOKEN_SEP;
 };
 
 
@@ -44,11 +47,11 @@ protected:
        ///
        virtual ~TransFSMData() {}
        ///
-       char deadkey_;
+       char_type deadkey_;
        ///
        KmodInfo deadkey_info_;
        ///
-       char deadkey2_;
+       char_type deadkey2_;
        ///
        KmodInfo deadkey2_info_;
        ///
@@ -74,11 +77,11 @@ public:
        ///
        TransInitState();
        ///
-       virtual string const normalkey(char);
+       virtual docstring const normalkey(char_type);
        ///
        virtual bool backspace() { return true; }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual docstring const deadkey(char_type, KmodInfo);
 };
 
 
@@ -88,14 +91,14 @@ public:
        ///
        TransDeadkeyState();
        ///
-       virtual string const normalkey(char);
+       virtual docstring const normalkey(char_type);
        ///
        virtual bool backspace() {
                currentState = init_state_;
                return false;
        }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual docstring const deadkey(char_type, KmodInfo);
 };
 
 
@@ -105,7 +108,7 @@ public:
        ///
        TransCombinedState();
        ///
-       virtual string const normalkey(char);
+       virtual docstring const normalkey(char_type);
        ///
        virtual bool backspace() {
                // cancel the second deadkey
@@ -116,7 +119,7 @@ public:
                return false;
        }
        ///
-       virtual string const deadkey(char, KmodInfo);
+       virtual docstring const deadkey(char_type, KmodInfo);
 };
 
 
@@ -139,60 +142,57 @@ 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 insertVerbatim(string const &, LyXText *);
+       void insert(docstring const &, LyXText *, LCursor & cur);
 public:
        ///
        TransManager();
        ///
-       virtual ~TransManager();
-       ///
-       int SetPrimary(string const &);
+       ~TransManager();
        ///
-       int SetSecondary(string const &);
+       int setPrimary(std::string const &);
        ///
-       void EnablePrimary();
+       int setSecondary(std::string const &);
        ///
-       void EnableSecondary();
+       void enablePrimary();
        ///
-       void DisableKeymap();
+       void enableSecondary();
        ///
-       bool setCharset(string const &);
+       void disableKeymap();
        ///
        bool backspace() {
                return trans_fsm_.currentState->backspace();
        }
        ///
-       void TranslateAndInsert(char, LyXText *);
+       void translateAndInsert(char_type, LyXText *, LCursor &);
        ///
-       string const deadkey(char, KmodInfo);
+       docstring const deadkey(char_type, KmodInfo);
        ///
-       string const normalkey(char);
+       docstring const normalkey(char_type);
        ///
-       void deadkey(char, tex_accent, LyXText *);
+       void deadkey(char_type, tex_accent, LyXText *, LCursor &);
 };
 
 
 inline
-string const TransManager::normalkey(char c)
+docstring const TransManager::normalkey(char_type c)
 {
        return trans_fsm_.currentState->normalkey(c);
 }
 
 
 inline
-string const TransManager::deadkey(char c, KmodInfo t)
+docstring const TransManager::deadkey(char_type c, KmodInfo t)
 {
        return trans_fsm_.currentState->deadkey(c, t);
 }
 
+
+} // namespace lyx
+
 #endif // TRANS_MANAGER_H