summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CEncoding.h
blob: 463fba99df2e099bd3318c049696a355b7e33ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef __CENCODING_H
#define __CENCODING_H

#include "CExpander.h"

#define MAX_ENCODING 6

class CEncoding : public CCharacterSource
{
  friend class CFilterChain;
 protected:
  CExpander* parent;
  linkType hyperlink(unsigned int n, QString& t) { return parent->hyperlink(n,t); }
public:
  CEncoding() : parent(NULL) {}
  void setparent(CExpander* p) { parent = p; }
  virtual ~CEncoding() {};
};

class CUtf8 : public CEncoding
{
public:
    void getch(tchar& ch, CStyle& sty);
};

class CUcs16be : public CEncoding
{
public:
    void getch(tchar& ch, CStyle& sty);
};

class CUcs16le : public CEncoding
{
public:
    void getch(tchar& ch, CStyle& sty);
};

class Ccp1252 : public CEncoding
{
public:
    void getch(tchar& ch, CStyle& sty);
};

class CPalm : public Ccp1252
{
public:
    void getch(tchar& ch, CStyle& sty);
};

class CAscii : public CEncoding
{
public:
    void getch(tchar& ch, CStyle& sty);
};

#include "CEncoding_tables.h"

class CGeneral8Bit : public CEncoding
{
    int m_index;
 public:
    CGeneral8Bit(int _i) : m_index(_i)
	{
//	    qDebug("8Bit:%d", _i);
//	    qDebug("%s", unicodetable::iterator(_i)->mime);
	}
    void getch(tchar& ch, CStyle& sty)
	{
	    parent->getch(ch, sty);
	    ch = unicodetable::unicodevalue(m_index, ch);
	}
};

#endif