mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
eb28793c05
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4744 a592a061-630c-0410-9148-cb99ea01b6c8
86 lines
1.3 KiB
C++
86 lines
1.3 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file trans.h
|
|
* Copyright 2002 the LyX Team
|
|
* Read the file COPYING
|
|
*
|
|
* \author unknown
|
|
*/
|
|
|
|
#ifndef TRANS_H
|
|
#define TRANS_H
|
|
|
|
#ifdef __GNUG__
|
|
#pragma interface
|
|
#endif
|
|
|
|
#include <map>
|
|
|
|
#include "tex-accent.h"
|
|
#include "LString.h"
|
|
#include "trans_decl.h"
|
|
|
|
class LyXLex;
|
|
|
|
class TransManager;
|
|
|
|
/**
|
|
Trans: holds a .kmap file
|
|
*/
|
|
class Trans {
|
|
public:
|
|
///
|
|
Trans();
|
|
///
|
|
~Trans();
|
|
|
|
///
|
|
int Load(string const & language);
|
|
///
|
|
bool IsDefined() const;
|
|
///
|
|
string const & GetName() const;
|
|
///
|
|
string const process(char, TransManager &);
|
|
///
|
|
bool isAccentDefined(tex_accent, KmodInfo &) const;
|
|
|
|
private:
|
|
///
|
|
void AddDeadkey(tex_accent, string const &);
|
|
///
|
|
void FreeKeymap();
|
|
///
|
|
int Load(LyXLex &);
|
|
///
|
|
string const & Match(unsigned char c);
|
|
///
|
|
void InsertException(KmodException & exclist, char c,
|
|
string const & data, bool = false,
|
|
tex_accent = TEX_NOACCENT);
|
|
///
|
|
void FreeException(KmodException & exclist);
|
|
|
|
///
|
|
string name_;
|
|
///
|
|
std::map<int, string> keymap_;
|
|
///
|
|
std::map<int, KmodInfo> kmod_list_;
|
|
};
|
|
|
|
|
|
///
|
|
inline
|
|
string const & Trans::Match(unsigned char c)
|
|
{
|
|
std::map<int, string>::iterator it = keymap_.find(c);
|
|
if (it != keymap_.end()) {
|
|
return it->second;
|
|
}
|
|
static string dummy;
|
|
return dummy;
|
|
}
|
|
|
|
#endif // TRANS_H
|