summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/BuffDoc.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.h b/noncore/apps/opie-reader/BuffDoc.h
index 2b4fb57..d6bfd99 100644
--- a/noncore/apps/opie-reader/BuffDoc.h
+++ b/noncore/apps/opie-reader/BuffDoc.h
@@ -44,16 +44,14 @@ class BuffDoc
44 { 44 {
45 exp->putSaveData(src, srclen); 45 exp->putSaveData(src, srclen);
46 } 46 }
47 } 47 }
48#ifdef USEQPE 48#ifdef USEQPE
49 void suspend() { if (exp != NULL) exp->suspend(); } 49 void suspend() { if (exp != NULL) exp->suspend(); }
50 void unsuspend() { if (exp != NULL) exp->unsuspend(); }
51#else 50#else
52 void suspend() {} 51 void suspend() {}
53 void unsuspend() {}
54#endif 52#endif
55 ~BuffDoc() 53 ~BuffDoc()
56 { 54 {
57 delete filt; 55 delete filt;
58 delete exp; 56 delete exp;
59 } 57 }
@@ -92,16 +90,28 @@ class BuffDoc
92 { 90 {
93 filt->getch(ch, sty, pos); 91 filt->getch(ch, sty, pos);
94 } 92 }
95 else 93 else
96 ch = UEOF; 94 ch = UEOF;
97 } 95 }
96 /*
97 void rawgetch(tchar& ch, CStyle& sty, unsigned long& pos)
98 {
99 if (exp != NULL)
100 {
101 filt->rawgetch(ch, sty, pos);
102 }
103 else
104 ch = UEOF;
105 }
106 */
98 void setwidth(int w) { if (exp != NULL) exp->setwidth(w); } 107 void setwidth(int w) { if (exp != NULL) exp->setwidth(w); }
99 QImage* getPicture(unsigned long tgt) { return (exp == NULL) ? NULL : exp->getPicture(tgt); } 108 QImage* getPicture(unsigned long tgt) { return (exp == NULL) ? NULL : exp->getPicture(tgt); }
100 unsigned int startSection() { return (exp == NULL) ? 0 : exp->startSection(); } 109 unsigned int startSection() { return (exp == NULL) ? 0 : exp->startSection(); }
101 unsigned int endSection() { return (exp == NULL) ? 0 : exp->endSection(); } 110 unsigned int endSection() { return (exp == NULL) ? 0 : exp->endSection(); }
111 void resetPos();
102 unsigned int locate() { return (exp == NULL) ? 0 : laststartline; } 112 unsigned int locate() { return (exp == NULL) ? 0 : laststartline; }
103 unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); } 113 unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); }
104 void setContinuous(bool _b) { if (exp != NULL) exp->setContinuous(_b); } 114 void setContinuous(bool _b) { if (exp != NULL) exp->setContinuous(_b); }
105 MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); } 115 MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); }
106 linkType hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm); 116 linkType hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm);
107 size_t getHome() { return ((exp != NULL) ? exp->getHome() : 0); } 117 size_t getHome() { return ((exp != NULL) ? exp->getHome() : 0); }
@@ -126,18 +136,23 @@ class BuffDoc
126 while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch; 136 while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch;
127 buff[i] = '\0'; 137 buff[i] = '\0';
128 if (i == 0 && ch == UEOF) i = -1; 138 if (i == 0 && ch == UEOF) i = -1;
129 laststartline = exp->locate(); 139 laststartline = exp->locate();
130 return i; 140 return i;
131 } 141 }
142 int getsentence(CBuffer& buff);
132 void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); } 143 void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); }
133 void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); } 144 void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); }
134 linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); } 145 linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); }
135 linkType back(QString& f, size_t& loc) { return filt->back(f, loc); } 146 linkType back(QString& f, size_t& loc) { return filt->back(f, loc); }
136 bool hasnavigation() { return filt->hasnavigation(); } 147 bool hasnavigation() { return (exp == NULL) ? false : filt->hasnavigation(); }
137 bool getFile(QString href) 148 bool getFile(const QString& href, QString& nm)
149 {
150 return (exp == NULL) ? false : exp->getFile(href, nm);
151 }
152 QString getTableAsHtml(unsigned long loc)
138 { 153 {
139 return (exp == NULL) ? false : exp->getFile(href); 154 return (exp != NULL) ? filt->getTableAsHtml(loc) : QString("");
140 } 155 }
141}; 156};
142 157
143#endif 158#endif