1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
1999-11-15 12:01:38 +00:00
|
|
|
#ifndef Trans_h
|
|
|
|
#define Trans_h
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-07-16 15:42:57 +00:00
|
|
|
#include <map>
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "tex-accent.h"
|
|
|
|
#include "LString.h"
|
|
|
|
#include "trans_decl.h"
|
|
|
|
|
|
|
|
class LyXLex;
|
|
|
|
|
|
|
|
class TransManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Trans: holds a .kmap file
|
|
|
|
*/
|
2001-07-16 15:42:57 +00:00
|
|
|
//class Trans : public TransInterface {
|
|
|
|
class Trans {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
Trans();
|
|
|
|
///
|
2001-07-16 15:42:57 +00:00
|
|
|
~Trans();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-11-15 12:01:38 +00:00
|
|
|
int Load(string const & language);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
bool IsDefined() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
string const & GetName() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
string const process(char, TransManager &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
bool isAccentDefined(tex_accent, KmodInfo &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
private:
|
2001-07-12 11:11:10 +00:00
|
|
|
///
|
|
|
|
void AddDeadkey(tex_accent, string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void FreeKeymap();
|
|
|
|
///
|
|
|
|
int Load(LyXLex &);
|
|
|
|
///
|
2001-12-05 08:50:13 +00:00
|
|
|
string const & Match(unsigned char c);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-16 15:42:57 +00:00
|
|
|
void InsertException(KmodException & exclist, char c,
|
1999-11-15 12:01:38 +00:00
|
|
|
string const & data, bool = false,
|
1999-09-27 18:44:28 +00:00
|
|
|
tex_accent = TEX_NOACCENT);
|
|
|
|
///
|
2001-07-16 15:42:57 +00:00
|
|
|
void FreeException(KmodException & exclist);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string name_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-16 15:42:57 +00:00
|
|
|
std::map<int, string> keymap_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-16 15:42:57 +00:00
|
|
|
std::map<int, KmodInfo> kmod_list_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2001-12-05 08:50:13 +00:00
|
|
|
inline
|
2000-09-14 17:53:12 +00:00
|
|
|
string const & Trans::Match(unsigned char c)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2001-07-16 15:42:57 +00:00
|
|
|
std::map<int, string>::iterator it = keymap_.find(c);
|
|
|
|
if (it != keymap_.end()) {
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
static string dummy;
|
|
|
|
return dummy;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|