summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker_base.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/plucker_base.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker_base.h36
1 files changed, 16 insertions, 20 deletions
diff --git a/noncore/apps/opie-reader/plucker_base.h b/noncore/apps/opie-reader/plucker_base.h
index 131b999..8d74cc2 100644
--- a/noncore/apps/opie-reader/plucker_base.h
+++ b/noncore/apps/opie-reader/plucker_base.h
@@ -1,17 +1,17 @@
1#ifndef __PLUCKER_BASE_H 1#ifndef __PLUCKER_BASE_H
2#define __PLUCKER_BASE_H 2#define __PLUCKER_BASE_H
3 3
4#include "useqpe.h"
5#include "CExpander.h" 4#include "CExpander.h"
6#include <zlib.h> 5#include <zlib.h>
7#include "ztxt.h" 6#include "ztxt.h"
8#include "pdb.h" 7#include "pdb.h"
9#include "CBuffer.h" 8#include "CBuffer.h"
10#include "my_list.h" 9#include "my_list.h"
11#include "Navigation.h" 10#include "Navigation.h"
11#include "hrule.h"
12 12
13struct CPlucker_record0 13struct CPlucker_record0
14{ 14{
15 UInt16 uid; 15 UInt16 uid;
16 UInt16 version; 16 UInt16 version;
17 UInt16 nRecords; 17 UInt16 nRecords;
@@ -24,29 +24,31 @@ struct CPluckerbkmk
24}; 24};
25 25
26#ifdef LOCALPICTURES 26#ifdef LOCALPICTURES
27class QScrollView; 27class QScrollView;
28class QWidget; 28class QWidget;
29#endif 29#endif
30class QString;
30 31
31class CPlucker_base : public CExpander, public Cpdb 32class CPlucker_base : public Cpdb
32{ 33{
33protected: 34protected:
35 static const UInt8 continuation_bit;
34 virtual void setbuffersize() = 0; 36 virtual void setbuffersize() = 0;
35 virtual void GetHeader(UInt16&, UInt16&, UInt32&, UInt8&, UInt8&) = 0; 37 virtual void GetHeader(UInt16&, UInt16&, UInt32&, UInt8&, UInt8&) = 0;
36 virtual int HeaderSize() = 0; 38 virtual int HeaderSize() = 0;
37 unsigned short finduid(unsigned short); 39 unsigned short finduid(unsigned short);
38 char* geturl(UInt16); 40 char* geturl(UInt16);
39 void Expand(UInt32, UInt8, UInt8*, UInt32); 41 void Expand(UInt32, UInt8, UInt8*, UInt32);
40 CList<unsigned long> visited; 42 CList<unsigned long> visited;
41 bool m_lastIsBreak; 43 bool m_lastIsBreak;
42#ifdef LOCALPICTURES 44#ifdef LOCALPICTURES
43 QScrollView* m_viewer; 45 QScrollView* m_viewer;
44 QWidget* m_picture; 46 QWidget* m_picture;
45#endif 47#endif
46 size_t textlength, m_lastBreak; 48 size_t textlength, m_lastBreak, m_offset;
47 UInt16 uid; 49 UInt16 uid;
48 int m_nextPara, m_nextParaIndex; 50 int m_nextPara, m_nextParaIndex;
49 CBufferFace<UInt16> m_ParaOffsets; 51 CBufferFace<UInt16> m_ParaOffsets;
50 CBufferFace<UInt16> m_ParaAttrs; 52 CBufferFace<UInt16> m_ParaAttrs;
51 UInt16 m_nParas; 53 UInt16 m_nParas;
52 CStyle mystyle; 54 CStyle mystyle;
@@ -56,60 +58,54 @@ protected:
56 UInt32 buffercontent; 58 UInt32 buffercontent;
57 UInt8* expandedtextbuffer; 59 UInt8* expandedtextbuffer;
58 UInt8* compressedtextbuffer; 60 UInt8* compressedtextbuffer;
59// char* urls; 61// char* urls;
60// size_t urlsize; 62// size_t urlsize;
61 size_t bufferpos; 63 size_t bufferpos;
62 UInt16 bufferrec; 64 int bufferrec;
63 CPlucker_record0 hdr0; 65 CPlucker_record0 hdr0;
64 bool m_bufferisreserved; 66 bool m_bufferisreserved;
65 size_t currentpos; 67 size_t currentpos;
66 bool expand(int); 68 bool expand(int);
67 void UnZip(UInt8*, size_t, UInt8*, size_t); 69 static void UnZip(UInt8*, size_t, UInt8*, size_t);
68 void UnDoc(UInt8*, size_t, UInt8*, size_t); 70 static void UnDoc(UInt8*, size_t, UInt8*, size_t);
71
72 void (*m_decompress)(UInt8*, size_t, UInt8*, size_t);
73 void (*getdecompressor(const QString& _s))(UInt8*, size_t, UInt8*, size_t);
69#ifdef LOCALPICTURES 74#ifdef LOCALPICTURES
70 void showimg(UInt16 tgt); 75 void showimg(UInt16 tgt);
71#endif 76#endif
72 QImage* getimg(UInt16 tgt); 77 QImage* getimg(UInt16 tgt);
73 QImage* expandimg(UInt16 tgt, bool border=false); 78 QImage* expandimg(UInt16 tgt, bool border=false);
74 void home(); 79 void home();
75 virtual int bgetch() = 0; 80 virtual int bgetch() = 0;
76 CNavigation m_nav; 81 CNavigation m_nav;
77 public: 82 public:
78#ifdef USEQPE 83 QString about();
79 void suspend()
80 {
81 CExpander::suspend(fin);
82 }
83 void unsuspend()
84 {
85 CExpander::unsuspend(fin);
86 }
87#endif
88 QImage* getPicture(unsigned long tgt); 84 QImage* getPicture(unsigned long tgt);
89 void sizes(unsigned long& _file, unsigned long& _text); 85 void sizes(unsigned long& _file, unsigned long& _text);
90 bool hasrandomaccess() { return true; } 86 bool hasrandomaccess() { return true; }
91 virtual ~CPlucker_base(); 87 virtual ~CPlucker_base();
92 CPlucker_base(); 88 CPlucker_base();
93 int OpenFile(const char *src); 89 int OpenFile(const char *src);
94 virtual tchar getch(bool) = 0; 90 virtual tchar getch(bool) = 0;
95 tchar getch_base(bool); 91 tchar getch_base(bool);
96 int getch(); 92 int getch();
97 void getch(tchar&, CStyle&); 93 void getch(tchar&, CStyle&, unsigned long& pos);
98 unsigned int locate(); 94 unsigned int locate();
99 void locate(unsigned int n); 95 void locate(unsigned int n);
100 CList<Bkmk>* getbkmklist(); 96 CList<Bkmk>* getbkmklist();
101 linkType hyperlink(unsigned int n, QString&); 97 linkType hyperlink(unsigned int, unsigned int, QString&, QString&);
102 MarkupType PreferredMarkup() 98 MarkupType PreferredMarkup()
103 { 99 {
104 return cNONE; 100 return cNONE;
105 } 101 }
106 void saveposn(size_t posn) { m_nav.saveposn(posn); } 102 void saveposn(size_t posn) { m_nav.saveposn(posn); }
107 void writeposn(size_t posn) { m_nav.writeposn(posn); } 103 void writeposn(size_t posn) { m_nav.writeposn(posn); }
108 bool forward(size_t& loc) { return m_nav.forward(loc); } 104 linkType forward(size_t& loc) { return (m_nav.forward(loc)) ? eLink : eNone; }
109 bool back(size_t& loc) { return m_nav.back(loc); } 105 linkType back(size_t& loc) { return (m_nav.back(loc)) ? eLink : eNone; }
110 bool hasnavigation() { return true; } 106 bool hasnavigation() { return true; }
111 void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen); 107 void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen);
112 void putSaveData(unsigned char*& src, unsigned short& srclen); 108 void putSaveData(unsigned char*& src, unsigned short& srclen);
113 109
114 virtual bool CorrectDecoder() = 0; 110 virtual bool CorrectDecoder() = 0;
115// virtual void setlink(QString&, const QString&) = 0; 111// virtual void setlink(QString&, const QString&) = 0;