From 73253e93327cf4ef0932de1b4afb56af22a0f37e Mon Sep 17 00:00:00 2001 From: pohly Date: Tue, 24 Aug 2004 20:52:45 +0000 Subject: updated source to opie-reader 0.7g --- (limited to 'noncore/apps/opie-reader/CEncoding.h') 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 @@ -9,48 +9,67 @@ class CEncoding : public CCharacterSource { friend class CFilterChain; 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);} + + }; 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(); } }; 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(); } }; 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(); } }; 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(); } }; 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(); } }; 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(); } }; #include "CEncoding_tables.h" @@ -60,15 +79,16 @@ class CGeneral8Bit : public CEncoding int m_index; public: 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(); } }; #endif -- cgit v0.9.0.2