author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/CEncoding.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/CEncoding.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CEncoding.h | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/noncore/apps/opie-reader/CEncoding.h b/noncore/apps/opie-reader/CEncoding.h index df0104a..1dfd74d 100644 --- a/noncore/apps/opie-reader/CEncoding.h +++ b/noncore/apps/opie-reader/CEncoding.h @@ -11,8 +11,21 @@ class CEncoding : public CCharacterSource protected: - CExpander* parent; - linkType hyperlink(unsigned int n, QString& t) { return parent->hyperlink(n,t); } + CExpander_Interface* parent; + linkType hyperlink(unsigned int n, unsigned int noff, QString& t, QString& nm) { return parent->hyperlink(n, noff, t, nm); } public: CEncoding() : parent(NULL) {} - void setparent(CExpander* p) { parent = p; } + void setparent(CExpander_Interface* p) { parent = p; } virtual ~CEncoding() {}; + void locate(unsigned int n) { parent->locate(n); } + bool findanchor(const QString& nm) { return false; } + void saveposn(const QString& f, size_t posn) { parent->saveposn(posn); } + void writeposn(const QString& f, size_t posn) { parent->writeposn(posn); } + linkType forward(QString& f, size_t& loc) { return parent->forward(loc); } + linkType back(QString& f, size_t& loc) { return parent->back(loc); } + bool hasnavigation() { return parent->hasnavigation(); } + virtual int getwidth() { return parent->getwidth(); } + QImage* getPicture(unsigned long tgt) { return parent->getPicture(tgt); } + QImage* getPicture(const QString& href) { return parent->getPicture(href); } + bool getFile(const QString& href) { qDebug("Encoding Get File"); return parent->getFile(href);} + + }; @@ -22,3 +35,4 @@ class CUtf8 : public CEncoding public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("UTF8 decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -28,3 +42,4 @@ class CUcs16be : public CEncoding public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("UCS16 decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -34,3 +49,4 @@ class CUcs16le : public CEncoding public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("UCS16 decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -40,3 +56,4 @@ class Ccp1252 : public CEncoding public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("Codepage 1252 decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -46,3 +63,4 @@ class CPalm : public Ccp1252 public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("Palm decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -52,3 +70,4 @@ class CAscii : public CEncoding public: - void getch(tchar& ch, CStyle& sty); + void getch(tchar& ch, CStyle& sty, unsigned long& pos); + QString about() { return QString("Vanilla Ascii decoder (c) Tim Wentford\n")+parent->about(); } }; @@ -62,11 +81,12 @@ class CGeneral8Bit : public CEncoding CGeneral8Bit(int _i) : m_index(_i) - { -// odebug << "8Bit: " << _i << oendl; -// odebug << unicodetable::iterator(_i)->mime << oendl; - } - void getch(tchar& ch, CStyle& sty) - { - parent->getch(ch, sty); - ch = unicodetable::unicodevalue(m_index, ch); - } + { +// qDebug("8Bit:%d", _i); +// qDebug("%s", unicodetable::iterator(_i)->mime); + } + void getch(tchar& ch, CStyle& sty, unsigned long& pos) + { + parent->getch(ch, sty, pos); + ch = unicodetable::unicodevalue(m_index, ch); + } + QString about() { return QString("8-bit decoder (c) Tim Wentford - based on QT code\n")+parent->about(); } }; |