lyx_mirror/src/trans.h
Georg Baum 0141fba79a Convert the part of the keymap code that will not be removed to docstring.
This is purely mechanical, and touches only code that is currently not active.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17657 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-31 08:12:08 +00:00

91 lines
1.5 KiB
C++

// -*- C++ -*-
/**
* \file trans.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_H
#define TRANS_H
#include "trans_decl.h"
#include <map>
namespace lyx {
class LyXLex;
class TransManager;
/**
Trans: holds a .kmap file
*/
class Trans {
public:
///
Trans();
///
~Trans();
///
int load(std::string const & language);
///
bool isDefined() const;
///
std::string const & getName() const;
///
docstring const process(char_type, TransManager &);
///
bool isAccentDefined(tex_accent, KmodInfo &) const;
private:
///
void addDeadkey(tex_accent, docstring const &);
///
void freeKeymap();
///
int load(LyXLex &);
///
docstring const & match(char_type c);
///
void insertException(KmodException & exclist, char_type c,
docstring const & data, bool = false,
tex_accent = TEX_NOACCENT);
///
void freeException(KmodException & exclist);
///
std::string name_;
///
std::map<char_type, docstring> keymap_;
///
std::map<tex_accent, KmodInfo> kmod_list_;
};
///
inline
docstring const & Trans::match(char_type c)
{
std::map<char_type, docstring>::iterator it = keymap_.find(c);
if (it != keymap_.end()) {
return it->second;
}
static docstring dummy;
return dummy;
}
} // namespace lyx
#endif // TRANS_H