summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker.h
Unidiff
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
@@ -8,2 +8,9 @@
8#include "CBuffer.h" 8#include "CBuffer.h"
9#include "Navigation.h"
10#include "my_list.h"
11
12#ifdef LOCALPICTURES
13class QScrollView;
14class QWidget;
15#endif
9 16
@@ -31,3 +38,2 @@ struct CPluckerbkmk
31 38
32
33const UInt32 CPLUCKER_ID = 0x5458547a; 39const UInt32 CPLUCKER_ID = 0x5458547a;
@@ -36,4 +42,14 @@ class CPlucker : public CExpander, Cpdb
36{ 42{
37 size_t textlength; 43 unsigned short finduid(unsigned short);
44 char* geturl(UInt16);
45 void Expand(UInt16, UInt8, UInt8*, UInt16);
46 CList<unsigned long> visited;
47 bool m_lastIsBreak;
48#ifdef LOCALPICTURES
49 QScrollView* m_viewer;
50 QWidget* m_picture;
51#endif
52 size_t textlength, m_lastBreak;
38 UInt16 uid; 53 UInt16 uid;
54 UInt8 EOPPhase;
39 int m_nextPara, m_nextParaIndex; 55 int m_nextPara, m_nextParaIndex;
@@ -48,2 +64,4 @@ class CPlucker : public CExpander, Cpdb
48 UInt8* compressedtextbuffer; 64 UInt8* compressedtextbuffer;
65 char* urls;
66 size_t urlsize;
49 size_t bufferpos; 67 size_t bufferpos;
@@ -55,20 +73,25 @@ class CPlucker : public CExpander, Cpdb
55 void UnDoc(size_t, UInt8*, UInt16); 73 void UnDoc(size_t, UInt8*, UInt16);
56 void expandimg(UInt16 tgt); 74#ifdef LOCALPICTURES
75 void showimg(UInt16 tgt);
76#endif
77 QImage* getimg(UInt16 tgt);
78 QPixmap* expandimg(UInt16 tgt, bool border=false);
57 void home(); 79 void home();
58 int bgetch(); 80 int bgetch();
81 CNavigation m_nav;
59 public: 82 public:
60 virtual void sizes(unsigned long& _file, unsigned long& _text) 83 virtual void suspend()
61 { 84 {
62 _file = file_length; 85 CExpander::suspend(fin);
63 _text = textlength; 86 }
64//ntohl(hdr0.size); 87 virtual void unsuspend()
65 } 88 {
89 CExpander::unsuspend(fin);
90 }
91 virtual QPixmap* getPicture(unsigned long tgt);
92 virtual void sizes(unsigned long& _file, unsigned long& _text);
66 virtual bool hasrandomaccess() { return true; } 93 virtual bool hasrandomaccess() { return true; }
67 virtual ~CPlucker() 94 virtual ~CPlucker();
68 {
69 if (expandedtextbuffer != NULL) delete [] expandedtextbuffer;
70 if (compressedtextbuffer != NULL) delete [] compressedtextbuffer;
71 }
72 CPlucker(); 95 CPlucker();
73 virtual int openfile(const char *src); 96 virtual int OpenFile(const char *src);
74 virtual int getch(); 97 virtual int getch();
@@ -80,5 +103,19 @@ class CPlucker : public CExpander, Cpdb
80 virtual MarkupType PreferredMarkup() 103 virtual MarkupType PreferredMarkup()
81 { 104 {
82 return cNONE; 105 return cNONE;
83 } 106 }
107 void saveposn(size_t posn) { m_nav.saveposn(posn); }
108 bool forward(size_t& loc) { return m_nav.forward(loc); }
109 bool back(size_t& loc) { return m_nav.back(loc); }
110 bool hasnavigation() { return true; }
111 unsigned long startSection()
112 {
113 return currentpos-bufferpos;
114 }
115 unsigned long endSection()
116 {
117 return startSection()+buffercontent;
118 }
119 void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen);
120 void putSaveData(unsigned char*& src, unsigned short& srclen);
84}; 121};