summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker.h
authorllornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
committer llornkcor <llornkcor>2002-12-20 01:35:01 (UTC)
commit876e1a4724a7bd75dc642e295de354241096e028 (patch) (side-by-side diff)
treea37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/plucker.h
parent5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff)
downloadopie-876e1a4724a7bd75dc642e295de354241096e028.zip
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz
opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker.h73
1 files changed, 55 insertions, 18 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
@@ -6,6 +6,13 @@
#include "ztxt.h"
#include "pdb.h"
#include "CBuffer.h"
+#include "Navigation.h"
+#include "my_list.h"
+
+#ifdef LOCALPICTURES
+class QScrollView;
+class QWidget;
+#endif
struct CPlucker_dataRecord
{
@@ -29,13 +36,22 @@ struct CPluckerbkmk
tchar title[MAX_BMRK_LENGTH];
};
-
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;
CBufferFace<UInt16> m_ParaAttrs;
@@ -46,6 +62,8 @@ class CPlucker : public CExpander, Cpdb
UInt32 buffercontent;
UInt8* expandedtextbuffer;
UInt8* compressedtextbuffer;
+ char* urls;
+ size_t urlsize;
size_t bufferpos;
UInt16 bufferrec;
CPlucker_record0 hdr0;
@@ -53,24 +71,29 @@ class CPlucker : public CExpander, Cpdb
bool expand(int);
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)
- {
- _file = file_length;
- _text = textlength;
-//ntohl(hdr0.size);
- }
+ virtual void suspend()
+ {
+ CExpander::suspend(fin);
+ }
+ virtual void unsuspend()
+ {
+ 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()
- {
- if (expandedtextbuffer != NULL) delete [] expandedtextbuffer;
- if (compressedtextbuffer != NULL) delete [] compressedtextbuffer;
- }
+ virtual ~CPlucker();
CPlucker();
- virtual int openfile(const char *src);
+ virtual int OpenFile(const char *src);
virtual int getch();
virtual void getch(int&, CStyle&);
virtual unsigned int locate();
@@ -78,9 +101,23 @@ class CPlucker : public CExpander, Cpdb
virtual CList<Bkmk>* getbkmklist();
virtual bool hyperlink(unsigned int n);
virtual MarkupType PreferredMarkup()
- {
- return cNONE;
- }
+ {
+ 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);
};
#endif