summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/BuffDoc.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.h b/noncore/apps/opie-reader/BuffDoc.h
index 78d8457..29d0329 100644
--- a/noncore/apps/opie-reader/BuffDoc.h
+++ b/noncore/apps/opie-reader/BuffDoc.h
@@ -1,9 +1,10 @@
1#ifndef __BuffDoc_h 1#ifndef __BuffDoc_h
2#define __BuffDoc_h 2#define __BuffDoc_h
3 3
4#include "useqpe.h"
4#include "ZText.h" 5#include "ZText.h"
5#include "Aportis.h" 6#include "Aportis.h"
6#include "ztxt.h" 7#include "ztxt.h"
7#include "ppm_expander.h" 8#include "ppm_expander.h"
8#include "CDrawBuffer.h" 9#include "CDrawBuffer.h"
9#include "CFilter.h" 10#include "CFilter.h"
@@ -35,25 +36,30 @@ class BuffDoc
35 { 36 {
36 if (exp != NULL) 37 if (exp != NULL)
37 { 38 {
38 exp->putSaveData(src, srclen); 39 exp->putSaveData(src, srclen);
39 } 40 }
40 } 41 }
42#ifdef USEQPE
41 void suspend() { if (exp != NULL) exp->suspend(); } 43 void suspend() { if (exp != NULL) exp->suspend(); }
42 void unsuspend() { if (exp != NULL) exp->unsuspend(); } 44 void unsuspend() { if (exp != NULL) exp->unsuspend(); }
45#else
46 void suspend() {}
47 void unsuspend() {}
48#endif
43 ~BuffDoc() 49 ~BuffDoc()
44 { 50 {
45 delete filt; 51 delete filt;
46 delete exp; 52 delete exp;
47 } 53 }
48 BuffDoc() 54 BuffDoc()
49 { 55 {
50 exp = NULL; 56 exp = NULL;
51 filt = NULL; 57 filt = NULL;
52 lastword.empty(); 58 lastword.empty();
53 // qDebug("Buffdoc created"); 59 // // qDebug("Buffdoc created");
54 } 60 }
55 bool empty() { return (exp == NULL); } 61 bool empty() { return (exp == NULL); }
56 void setfilter(CFilterChain* _f) 62 void setfilter(CFilterChain* _f)
57 { 63 {
58 if (filt != NULL) delete filt; 64 if (filt != NULL) delete filt;
59 filt = _f; 65 filt = _f;
@@ -79,36 +85,38 @@ class BuffDoc
79 { 85 {
80 filt->getch(ch, sty); 86 filt->getch(ch, sty);
81 } 87 }
82 else 88 else
83 ch = UEOF; 89 ch = UEOF;
84 } 90 }
85 QPixmap* getPicture(unsigned long tgt) { return (exp == NULL) ? NULL : exp->getPicture(tgt); } 91 void setwidth(int w) { if (exp != NULL) exp->setwidth(w); }
92 QImage* getPicture(unsigned long tgt) { return (exp == NULL) ? NULL : exp->getPicture(tgt); }
86 unsigned int startSection() { return (exp == NULL) ? 0 : exp->startSection(); } 93 unsigned int startSection() { return (exp == NULL) ? 0 : exp->startSection(); }
87 unsigned int endSection() { return (exp == NULL) ? 0 : exp->endSection(); } 94 unsigned int endSection() { return (exp == NULL) ? 0 : exp->endSection(); }
88 unsigned int locate() { return (exp == NULL) ? 0 : laststartline; } 95 unsigned int locate() { return (exp == NULL) ? 0 : laststartline; }
89 unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); } 96 unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); }
90 void setContinuous(bool _b) { if (exp != NULL) exp->setContinuous(_b); } 97 void setContinuous(bool _b) { if (exp != NULL) exp->setContinuous(_b); }
91 MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); } 98 MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); }
92 bool hyperlink(unsigned int n); 99 linkType hyperlink(unsigned int n, QString& wrd);
93 size_t getHome() { return ((exp != NULL) ? exp->getHome() : 0); } 100 size_t getHome() { return ((exp != NULL) ? exp->getHome() : 0); }
94 void locate(unsigned int n); 101 void locate(unsigned int n);
95 bool getline(CDrawBuffer* buff, int w); 102 bool getline(CDrawBuffer* buff, int w, unsigned char _border);
96 bool getline(CDrawBuffer* buff, int w, int cw); 103 bool getline(CDrawBuffer* buff, int w, int cw, unsigned char _border);
97 void sizes(unsigned long& fs, unsigned long& ts) { exp->sizes(fs,ts); } 104 void sizes(unsigned long& fs, unsigned long& ts) { exp->sizes(fs,ts); }
98 int getpara(CBuffer& buff) 105 int getpara(CBuffer& buff)
99 { 106 {
100 tchar ch; 107 tchar ch;
101 int i = 0; 108 int i = 0;
102 while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch; 109 while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch;
103 buff[i] = '\0'; 110 buff[i] = '\0';
104 if (i == 0 && ch == UEOF) i = -1; 111 if (i == 0 && ch == UEOF) i = -1;
105 laststartline = exp->locate(); 112 laststartline = exp->locate();
106 return i; 113 return i;
107 } 114 }
108 void saveposn(size_t posn) { exp->saveposn(posn); } 115 void saveposn(size_t posn) { exp->saveposn(posn); }
116 void writeposn(size_t posn) { exp->writeposn(posn); }
109 bool forward(size_t& loc) { return exp->forward(loc); } 117 bool forward(size_t& loc) { return exp->forward(loc); }
110 bool back(size_t& loc) { return exp->back(loc); } 118 bool back(size_t& loc) { return exp->back(loc); }
111 bool hasnavigation() { return exp->hasnavigation(); } 119 bool hasnavigation() { return exp->hasnavigation(); }
112}; 120};
113 121
114#endif 122#endif