Diffstat (limited to 'noncore/apps/opie-reader/CEncoding.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CEncoding.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CEncoding.h b/noncore/apps/opie-reader/CEncoding.h index 86562e7..463fba9 100644 --- a/noncore/apps/opie-reader/CEncoding.h +++ b/noncore/apps/opie-reader/CEncoding.h | |||
@@ -1,22 +1,25 @@ | |||
1 | #ifndef __CENCODING_H | 1 | #ifndef __CENCODING_H |
2 | #define __CENCODING_H | 2 | #define __CENCODING_H |
3 | 3 | ||
4 | #include "CExpander.h" | 4 | #include "CExpander.h" |
5 | 5 | ||
6 | #define MAX_ENCODING 6 | ||
7 | |||
6 | class CEncoding : public CCharacterSource | 8 | class CEncoding : public CCharacterSource |
7 | { | 9 | { |
8 | friend class CFilterChain; | 10 | friend class CFilterChain; |
9 | protected: | 11 | protected: |
10 | CExpander* parent; | 12 | CExpander* parent; |
13 | linkType hyperlink(unsigned int n, QString& t) { return parent->hyperlink(n,t); } | ||
11 | public: | 14 | public: |
12 | CEncoding() : parent(NULL) {} | 15 | CEncoding() : parent(NULL) {} |
13 | void setparent(CExpander* p) { parent = p; } | 16 | void setparent(CExpander* p) { parent = p; } |
14 | virtual ~CEncoding() {}; | 17 | virtual ~CEncoding() {}; |
15 | }; | 18 | }; |
16 | 19 | ||
17 | class CUtf8 : public CEncoding | 20 | class CUtf8 : public CEncoding |
18 | { | 21 | { |
19 | public: | 22 | public: |
20 | void getch(tchar& ch, CStyle& sty); | 23 | void getch(tchar& ch, CStyle& sty); |
21 | }; | 24 | }; |
22 | 25 | ||
@@ -41,13 +44,31 @@ public: | |||
41 | class CPalm : public Ccp1252 | 44 | class CPalm : public Ccp1252 |
42 | { | 45 | { |
43 | public: | 46 | public: |
44 | void getch(tchar& ch, CStyle& sty); | 47 | void getch(tchar& ch, CStyle& sty); |
45 | }; | 48 | }; |
46 | 49 | ||
47 | class CAscii : public CEncoding | 50 | class CAscii : public CEncoding |
48 | { | 51 | { |
49 | public: | 52 | public: |
50 | void getch(tchar& ch, CStyle& sty); | 53 | void getch(tchar& ch, CStyle& sty); |
51 | }; | 54 | }; |
52 | 55 | ||
56 | #include "CEncoding_tables.h" | ||
57 | |||
58 | class CGeneral8Bit : public CEncoding | ||
59 | { | ||
60 | int m_index; | ||
61 | public: | ||
62 | CGeneral8Bit(int _i) : m_index(_i) | ||
63 | { | ||
64 | // qDebug("8Bit:%d", _i); | ||
65 | // qDebug("%s", unicodetable::iterator(_i)->mime); | ||
66 | } | ||
67 | void getch(tchar& ch, CStyle& sty) | ||
68 | { | ||
69 | parent->getch(ch, sty); | ||
70 | ch = unicodetable::unicodevalue(m_index, ch); | ||
71 | } | ||
72 | }; | ||
73 | |||
53 | #endif | 74 | #endif |