2000-07-04 20:32:37 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file encoding.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2000-07-04 20:32:37 +00:00
|
|
|
|
|
|
|
|
|
#ifndef ENCODING_H
|
|
|
|
|
#define ENCODING_H
|
|
|
|
|
|
2003-07-26 23:04:39 +00:00
|
|
|
|
#include <map>
|
2003-10-06 15:43:21 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
|
#include "support/types.h"
|
2003-07-26 23:04:39 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
|
class Encoding {
|
|
|
|
|
public:
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
|
|
|
|
Encoding() {}
|
|
|
|
|
///
|
2006-10-26 15:01:45 +00:00
|
|
|
|
Encoding(std::string const & n, std::string const & l,
|
|
|
|
|
std::string const & i)
|
|
|
|
|
: Name_(n), LatexName_(l), iconvName_(i)
|
2006-10-22 10:15:23 +00:00
|
|
|
|
{
|
2000-10-10 12:36:36 +00:00
|
|
|
|
}
|
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
std::string const & name() const { return Name_; }
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
std::string const & latexName() const { return LatexName_; }
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
2006-10-26 15:01:45 +00:00
|
|
|
|
std::string const & iconvName() const { return iconvName_; }
|
2000-10-10 12:36:36 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string Name_;
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string LatexName_;
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
2006-10-26 15:01:45 +00:00
|
|
|
|
std::string iconvName_;
|
2000-10-10 12:36:36 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class Encodings {
|
|
|
|
|
public:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
typedef std::map<std::string, Encoding> EncodingList;
|
2000-10-10 12:36:36 +00:00
|
|
|
|
///
|
|
|
|
|
Encodings();
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void read(std::string const & filename);
|
2006-11-03 10:35:41 +00:00
|
|
|
|
/// Get encoding from LyX name \p name
|
|
|
|
|
Encoding const * getFromLyXName(std::string const & name) const;
|
|
|
|
|
/// Get encoding from LaTeX name \p name
|
|
|
|
|
Encoding const * getFromLaTeXName(std::string const & name) const;
|
2000-10-10 12:36:36 +00:00
|
|
|
|
|
2000-07-04 20:32:37 +00:00
|
|
|
|
///
|
|
|
|
|
enum Letter_Form {
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
|
FORM_ISOLATED,
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
|
FORM_FINAL,
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
|
FORM_INITIAL,
|
2000-08-07 20:58:24 +00:00
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
|
FORM_MEDIAL
|
|
|
|
|
};
|
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
static bool isComposeChar_hebrew(char_type c);
|
2000-07-04 20:32:37 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
static bool isComposeChar_arabic(char_type c);
|
2000-07-04 20:32:37 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
static bool is_arabic_special(char_type c);
|
2002-11-25 21:29:21 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
static bool is_arabic(char_type c);
|
2000-07-04 20:32:37 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
static char_type transformChar(char_type c, Letter_Form form);
|
2000-10-10 12:36:36 +00:00
|
|
|
|
|
2000-07-04 20:32:37 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2000-10-10 12:36:36 +00:00
|
|
|
|
EncodingList encodinglist;
|
2000-07-04 20:32:37 +00:00
|
|
|
|
};
|
|
|
|
|
|
2000-10-10 12:36:36 +00:00
|
|
|
|
extern Encodings encodings;
|
2000-07-04 20:32:37 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2000-07-04 20:32:37 +00:00
|
|
|
|
#endif
|