// -*- C++ -*-
-#ifndef Trans_Manager_h
-#define Trans_Manager_h
-
-#ifdef __GNUG__
-#pragma interface
-#endif
+#ifndef TRANS_MANAGER_H
+#define TRANS_MANAGER_H
#include "tex-accent.h"
#include "trans_decl.h"
class LyXText;
class Trans;
-/// Translation State
+/// Translation state
class TransState {
public:
///
virtual ~TransState() {}
-#if 0
- ///
- virtual string const normalkey(char, string const &) = 0;
-#else
///
virtual string const normalkey(char) = 0;
-#endif
///
virtual bool backspace() = 0;
///
///
KmodInfo deadkey2_info_;
///
- KmodException comb_info_;
+ Keyexc comb_info_;
///
TransState * init_state_;
///
/// Init State
-class TransInitState : virtual public TransFSMData, public TransState {
+class TransInitState : virtual public TransFSMData, public TransState {
public:
///
TransInitState();
-#if 0
- ///
- virtual string const normalkey(char, string const &);
-#else
///
virtual string const normalkey(char);
-#endif
///
virtual bool backspace() { return true; }
///
public:
///
TransDeadkeyState();
-#if 0
- ///
- virtual string const normalkey(char, string const &);
-#else
///
virtual string const normalkey(char);
-#endif
///
virtual bool backspace() {
currentState = init_state_;
public:
///
TransCombinedState();
-#if 0
- ///
- virtual string const normalkey(char, string const &);
-#else
///
virtual string const normalkey(char);
-#endif
///
virtual bool backspace() {
// cancel the second deadkey
deadkey2_ = 0;
deadkey2_info_.accent = TEX_NOACCENT;
currentState = deadkey_state_;
-
+
return false;
}
///
void TranslateAndInsert(char, LyXText *);
///
string const deadkey(char, KmodInfo);
-#if 0
- ///
- string const normalkey(char, string const &);
-#else
///
string const normalkey(char);
-#endif
///
void deadkey(char, tex_accent, LyXText *);
};
-#if 0
-inline
-string const TransManager::normalkey(char c, string const & t)
-{
- return trans_fsm_.currentState->normalkey(c, t);
-}
-#else
inline
string const TransManager::normalkey(char c)
{
return trans_fsm_.currentState->normalkey(c);
}
-#endif
inline
return trans_fsm_.currentState->deadkey(c, t);
}
-#endif
+#endif // TRANS_MANAGER_H