summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReader.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReader.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.h56
1 files changed, 48 insertions, 8 deletions
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h
index 78230b4..3d5f57d 100644
--- a/noncore/apps/opie-reader/QTReader.h
+++ b/noncore/apps/opie-reader/QTReader.h
@@ -14,4 +14,6 @@ class CDrawBuffer;
14class QPainter; 14class QPainter;
15class QTimer; 15class QTimer;
16class QPixmap;
17class statedata;
16 18
17class QTReader : public QWidget 19class QTReader : public QWidget
@@ -20,4 +22,5 @@ class QTReader : public QWidget
20 22
21 friend class QTReaderApp; 23 friend class QTReaderApp;
24 void suspend() { buffdoc.suspend(); }
22 void drawText(QPainter& p, int x, int y, tchar* text); 25 void drawText(QPainter& p, int x, int y, tchar* text);
23 int m_delay; 26 int m_delay;
@@ -38,5 +41,16 @@ public:
38 // QTReader( const QString& filename, QWidget *parent=0, const tchar *name=0, WFlags f = 0); 41 // QTReader( const QString& filename, QWidget *parent=0, const tchar *name=0, WFlags f = 0);
39 ~QTReader(); 42 ~QTReader();
43 void zoomin();
44 void zoomout();
45 void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen)
46 {
47 buffdoc.setSaveData(data, len, src, srclen);
48 }
49 void putSaveData(unsigned char*& src, unsigned short& srclen)
50 {
51 buffdoc.putSaveData(src, srclen);
52 }
40 bool empty(); 53 bool empty();
54 void setContinuous(bool _b);
41 void toggle_autoscroll(); 55 void toggle_autoscroll();
42 void setautoscroll(bool); 56 void setautoscroll(bool);
@@ -109,4 +123,16 @@ public:
109 setfilter(getfilter()); 123 setfilter(getfilter());
110 } 124 }
125 void setonespace(bool _b)
126 {
127 bonespace = _b;
128 setfilter(getfilter());
129 }
130#ifdef REPALM
131 void setrepalm(bool _b)
132 {
133 brepalm = _b;
134 setfilter(getfilter());
135 }
136#endif
111 void setstriphtml(bool _b) 137 void setstriphtml(bool _b)
112 { 138 {
@@ -191,6 +217,10 @@ public:
191 if (bunindent) filt->addfilter(new unindent); 217 if (bunindent) filt->addfilter(new unindent);
192 if (brepara) filt->addfilter(new repara); 218 if (brepara) filt->addfilter(new repara);
219 if (bonespace) filt->addfilter(new OnePara);
193 if (bindenter) filt->addfilter(new indenter(bindenter)); 220 if (bindenter) filt->addfilter(new indenter(bindenter));
194 if (bdblspce) filt->addfilter(new dblspce); 221 if (bdblspce) filt->addfilter(new dblspce);
222#ifdef REPALM
223 if (brepalm) filt->addfilter(new repalm);
224#endif
195 if (bremap) filt->addfilter(new remap); 225 if (bremap) filt->addfilter(new remap);
196 if (bmakebold) filt->addfilter(new embolden); 226 if (bmakebold) filt->addfilter(new embolden);
@@ -217,7 +247,8 @@ private slots:
217 private: 247 private:
218 bool mouseUpOn; 248 bool mouseUpOn;
219 bool getcurrentpos(int x, int y, size_t& start, size_t& offset, size_t& tgt); 249 linkType getcurrentpos(int x, int y, size_t& start, size_t& offset, size_t& tgt);
220 bool m_twotouch, m_touchone; 250 bool m_twotouch, m_touchone;
221 size_t m_startpos, m_startoffset; 251 size_t m_startpos, m_startoffset;
252 void dopageup(unsigned int);
222 void dopageup(); 253 void dopageup();
223 void lineDown(); 254 void lineDown();
@@ -230,10 +261,17 @@ private slots:
230 CBufferFace<size_t> locnarray; 261 CBufferFace<size_t> locnarray;
231 unsigned int numlines; 262 unsigned int numlines;
232 bool bstripcr, btextfmt, bstriphtml, bdehyphen, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt; 263 bool bstripcr, btextfmt, bstriphtml, bdehyphen, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace;
233 bool m_bpagemode, m_bMonoSpaced; 264#ifdef REPALM
265 bool brepalm;
266#endif
267 bool m_bpagemode, m_bMonoSpaced, m_continuousDocument;
234 unsigned char bindenter; 268 unsigned char bindenter;
235 QString m_lastfile; 269 QString m_lastfile;
236 size_t m_lastposn; 270 size_t m_lastposn;
237 public: 271 public:
272 bool bDoUpdates;
273 bool m_navkeys;
274 void NavUp();
275 void NavDown();
238 int getch() { return buffdoc.getch(); } 276 int getch() { return buffdoc.getch(); }
239 bool tight; 277 bool tight;
@@ -242,10 +280,10 @@ private slots:
242 CList<Bkmk>* getbkmklist() { return buffdoc.getbkmklist(); } 280 CList<Bkmk>* getbkmklist() { return buffdoc.getbkmklist(); }
243 bool locate(unsigned long n); 281 bool locate(unsigned long n);
244 void jumpto(unsigned long n) { buffdoc.locate(n); } 282 void jumpto(unsigned long n) { buffdoc.unsuspend(); buffdoc.locate(n); }
245 unsigned long locate() { return buffdoc.locate(); } 283 unsigned long locate() { buffdoc.unsuspend(); return buffdoc.locate(); }
246 unsigned long explocate() { return buffdoc.explocate(); } 284 unsigned long explocate() { buffdoc.unsuspend(); return buffdoc.explocate(); }
247 unsigned long pagelocate() { return locnarray[0]; } 285 unsigned long pagelocate() { return locnarray[0]; }
248 unsigned long mylastpos; 286 unsigned long mylastpos;
249 void setfilter(CFilterChain *f) { buffdoc.setfilter(f); locate(pagelocate()); } 287 void setfilter(CFilterChain *f) { buffdoc.unsuspend(); buffdoc.setfilter(f); locate(pagelocate()); }
250 void restore() { jumpto(mylastpos); } 288 void restore() { jumpto(mylastpos); }
251 void goUp(); 289 void goUp();
@@ -257,5 +295,5 @@ private slots:
257 bool fillbuffer(int ru = 0, int ht = 0); 295 bool fillbuffer(int ru = 0, int ht = 0);
258 unsigned int screenlines(); 296 unsigned int screenlines();
259 void sizes(unsigned long& fs, unsigned long& ts) { buffdoc.sizes(fs,ts); } 297 void sizes(unsigned long& fs, unsigned long& ts) { buffdoc.unsuspend(); buffdoc.sizes(fs,ts); }
260 static const char *fonts[]; 298 static const char *fonts[];
261// unsigned int *fontsizes; 299// unsigned int *fontsizes;
@@ -263,4 +301,5 @@ private slots:
263 QFontMetrics* m_fm; 301 QFontMetrics* m_fm;
264 QString firstword(); 302 QString firstword();
303 void setstate(const statedata& sd);
265 304
266 signals: 305 signals:
@@ -268,4 +307,5 @@ private slots:
268 void OnWordSelected(const QString&, size_t, const QString&); 307 void OnWordSelected(const QString&, size_t, const QString&);
269 void OnActionPressed(); 308 void OnActionPressed();
309 void OnShowPicture(QPixmap&);
270}; 310};
271 311