Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/plucker.h | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/noncore/apps/opie-reader/plucker.h b/noncore/apps/opie-reader/plucker.h index d3ca732..083eac6 100644 --- a/noncore/apps/opie-reader/plucker.h +++ b/noncore/apps/opie-reader/plucker.h @@ -7,4 +7,11 @@ #include "pdb.h" #include "CBuffer.h" +#include "Navigation.h" +#include "my_list.h" + +#ifdef LOCALPICTURES +class QScrollView; +class QWidget; +#endif struct CPlucker_dataRecord @@ -30,11 +37,20 @@ struct CPluckerbkmk }; - const UInt32 CPLUCKER_ID = 0x5458547a; class CPlucker : public CExpander, Cpdb { - size_t textlength; + unsigned short finduid(unsigned short); + char* geturl(UInt16); + void Expand(UInt16, UInt8, UInt8*, UInt16); + CList<unsigned long> visited; + bool m_lastIsBreak; +#ifdef LOCALPICTURES + QScrollView* m_viewer; + QWidget* m_picture; +#endif + size_t textlength, m_lastBreak; UInt16 uid; + UInt8 EOPPhase; int m_nextPara, m_nextParaIndex; CBufferFace<UInt16> m_ParaOffsets; @@ -47,4 +63,6 @@ class CPlucker : public CExpander, Cpdb UInt8* expandedtextbuffer; UInt8* compressedtextbuffer; + char* urls; + size_t urlsize; size_t bufferpos; UInt16 bufferrec; @@ -54,22 +72,27 @@ class CPlucker : public CExpander, Cpdb void UnZip(size_t, UInt8*, UInt16); void UnDoc(size_t, UInt8*, UInt16); - void expandimg(UInt16 tgt); +#ifdef LOCALPICTURES + void showimg(UInt16 tgt); +#endif + QImage* getimg(UInt16 tgt); + QPixmap* expandimg(UInt16 tgt, bool border=false); void home(); int bgetch(); + CNavigation m_nav; public: - virtual void sizes(unsigned long& _file, unsigned long& _text) + virtual void suspend() { - _file = file_length; - _text = textlength; -//ntohl(hdr0.size); + CExpander::suspend(fin); } - virtual bool hasrandomaccess() { return true; } - virtual ~CPlucker() + virtual void unsuspend() { - if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; - if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; + CExpander::unsuspend(fin); } + virtual QPixmap* getPicture(unsigned long tgt); + virtual void sizes(unsigned long& _file, unsigned long& _text); + virtual bool hasrandomaccess() { return true; } + virtual ~CPlucker(); CPlucker(); - virtual int openfile(const char *src); + virtual int OpenFile(const char *src); virtual int getch(); virtual void getch(int&, CStyle&); @@ -82,4 +105,18 @@ class CPlucker : public CExpander, Cpdb return cNONE; } + void saveposn(size_t posn) { m_nav.saveposn(posn); } + bool forward(size_t& loc) { return m_nav.forward(loc); } + bool back(size_t& loc) { return m_nav.back(loc); } + bool hasnavigation() { return true; } + unsigned long startSection() + { + return currentpos-bufferpos; + } + unsigned long endSection() + { + return startSection()+buffercontent; + } + void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen); + void putSaveData(unsigned char*& src, unsigned short& srclen); }; |