summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Aportis.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/Aportis.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Aportis.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/noncore/apps/opie-reader/Aportis.h b/noncore/apps/opie-reader/Aportis.h
index 202a36f..5e9d1da 100644
--- a/noncore/apps/opie-reader/Aportis.h
+++ b/noncore/apps/opie-reader/Aportis.h
@@ -1,13 +1,12 @@
1/* 1/*
2 Derived from makedoc9 by Pat Beirne 2 Derived from makedoc9 by Pat Beirne
3*/ 3*/
4 4
5#ifndef __Aportis_h 5#ifndef __Aportis_h
6#define __Aportis_h 6#define __Aportis_h
7#include "useqpe.h"
8#include "CExpander.h" 7#include "CExpander.h"
9#include "pdb.h" 8#include "pdb.h"
10 9
11typedef UInt32 DWORD; 10typedef UInt32 DWORD;
12typedef UInt16 WORD; 11typedef UInt16 WORD;
13 12
@@ -57,39 +56,31 @@ inline WORD SwapWord(WORD r)
57 56
58inline DWORD SwapLong(DWORD r) 57inline DWORD SwapLong(DWORD r)
59{ 58{
60 return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000); 59 return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000);
61} 60}
62 61
63class Aportis : public CExpander, Cpdb { 62class Aportis : public Cpdb {
64 bool peanutfile; 63 bool peanutfile, html;
65 void dePeanut(int&); 64 void dePeanut(int&);
66 DWORD dwLen; 65 DWORD dwLen;
67 WORD nRecs2; 66 WORD nRecs2;
68 DWORD dwTLen; 67 DWORD dwTLen;
69 WORD nRecs; 68 WORD nRecs;
70 WORD BlockSize; 69 WORD BlockSize;
71 DWORD dwRecLen; 70 DWORD dwRecLen;
71 WORD mobiimagerec;
72 int currentrec, currentpos; 72 int currentrec, currentpos;
73 unsigned int cbptr; 73 unsigned int cbptr;
74 unsigned int outptr; 74 unsigned int outptr;
75 unsigned char circbuf[2048]; 75 unsigned char circbuf[2048];
76 char bCompressed; 76 char bCompressed;
77public: 77public:
78#ifdef USEQPE
79 void suspend()
80 {
81 CExpander::suspend(fin);
82 }
83 void unsuspend()
84 {
85 CExpander::unsuspend(fin);
86 }
87#endif
88 void sizes(unsigned long& _file, unsigned long& _text) 78 void sizes(unsigned long& _file, unsigned long& _text)
89 { 79 {
80 qDebug("Calling aportis sizes:(%u,%u,%u)", dwTLen, nRecs, BlockSize);
90 _file = dwLen; 81 _file = dwLen;
91 _text = dwTLen; 82 _text = dwTLen;
92 } 83 }
93 bool hasrandomaccess() { return true; } 84 bool hasrandomaccess() { return true; }
94 virtual ~Aportis() {} 85 virtual ~Aportis() {}
95 Aportis(); 86 Aportis();
@@ -97,14 +88,16 @@ public:
97 int getch(); 88 int getch();
98 unsigned int locate(); 89 unsigned int locate();
99 void locate(unsigned int n); 90 void locate(unsigned int n);
100 CList<Bkmk>* getbkmklist(); 91 CList<Bkmk>* getbkmklist();
101 MarkupType PreferredMarkup() 92 MarkupType PreferredMarkup()
102 { 93 {
103 return (peanutfile) ? cPML : cTEXT; 94 return (peanutfile) ? cPML : ((html) ? cHTML : cTEXT);
104 } 95 }
96 QImage* getPicture(unsigned long);
97 QString about() { return QString("AportisDoc codec (c) Tim Wentford"); }
105private: 98private:
106 bool refreshbuffer(); 99 bool refreshbuffer();
107 unsigned int GetBS(unsigned int bn); 100 unsigned int GetBS(unsigned int bn);
108}; 101};
109 102
110#endif 103#endif