X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans_mgr.h;h=06e98991eb0d0d068df3c17d59f4f92d30da082f;hb=27a777ccc624b19c5d1961a6279c0db97594c0fb;hp=f0126244ccee91df45d8feeb5654e0d49ab3db32;hpb=566e084f63fb82a2f27e442e21539896f46e7dc6;p=lyx.git diff --git a/src/trans_mgr.h b/src/trans_mgr.h index f0126244cc..06e98991eb 100644 --- a/src/trans_mgr.h +++ b/src/trans_mgr.h @@ -1,12 +1,28 @@ // -*- C++ -*- +/** + * \file trans_mgr.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Lars Gullik Bjønnes + * \author Matthias Ettrich + * \author John Levon + * + * Full author contact details are available in file CREDITS. + */ + #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 + +namespace lyx { + +class LCursor; class LyXText; class Trans; @@ -16,11 +32,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; }; @@ -62,11 +78,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); }; @@ -76,14 +92,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); }; @@ -93,7 +109,7 @@ public: /// TransCombinedState(); /// - virtual string const normalkey(char); + virtual std::string const normalkey(char); /// virtual bool backspace() { // cancel the second deadkey @@ -104,7 +120,7 @@ public: return false; } /// - virtual string const deadkey(char, KmodInfo); + virtual std::string const deadkey(char, KmodInfo); }; @@ -127,60 +143,63 @@ private: /// Trans * active_; /// - Trans * t1_; + boost::scoped_ptr t1_; /// - Trans * t2_; + boost::scoped_ptr t2_; /// static Trans default_; /// CharacterSet chset_; /// - void insert(string const &, LyXText *); + void insert(std::string const &, LyXText *, LCursor & cur); /// - void insertVerbatim(string const &, LyXText *); + void insertVerbatim(std::string const &, LyXText *, LCursor & cur); 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(); + void enablePrimary(); /// - void EnableSecondary(); + void enableSecondary(); /// - void DisableKeymap(); + void disableKeymap(); /// - bool setCharset(string const &); + bool setCharset(std::string const &); /// bool backspace() { return trans_fsm_.currentState->backspace(); } /// - void TranslateAndInsert(char, LyXText *); + void translateAndInsert(char, LyXText *, LCursor &); /// - 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 *); + void deadkey(char, tex_accent, LyXText *, LCursor &); }; 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); } + +} // namespace lyx + #endif // TRANS_MANAGER_H