summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReader.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReader.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.h96
1 files changed, 28 insertions, 68 deletions
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h
index 3bcdde4..9daa07a 100644
--- a/noncore/apps/opie-reader/QTReader.h
+++ b/noncore/apps/opie-reader/QTReader.h
@@ -20,12 +20,10 @@ class QImage;
20#include "BGType.h" 20#include "BGType.h"
21#include "striphtml.h"
22 21
23#define ROTATION_ENABLED
24#define SPECIALSCROLL 22#define SPECIALSCROLL
25#define DOUBLEBUFFER 23
26#ifdef DOUBLEBUFFER
27class QPainter; 24class QPainter;
28#endif 25class COutput;
29 26
30class CStyle; 27class CStyle;
28#define USETIMER
31 29
@@ -35,6 +33,11 @@ class QTReader : public QWidget
35 friend class QTReaderApp; 33 friend class QTReaderApp;
36#ifdef DOUBLEBUFFER 34#ifdef USETIMER
35 QTimer* m_dragtimer;
36 unsigned long m_dragtarget;
37#endif
38 COutput* m_output;
39 bool checkoutput();
40 bool m_outofdate, m_drageligible;
37 QPixmap *dbuff; 41 QPixmap *dbuff;
38 QPainter* dbp; 42 QPainter* dbp;
39#endif
40 void drawSingleLine(int lineno); 43 void drawSingleLine(int lineno);
@@ -76,7 +79,5 @@ class QTReader : public QWidget
76 bool m_autoScroll, m_swapmouse; 79 bool m_autoScroll, m_swapmouse;
77 void drawBackground(); 80 void drawBackground(QPainter*);
78#ifdef ROTATION_ENABLED
79 bool m_rotated; 81 bool m_rotated;
80 void setrotated(bool); 82 void setrotated(bool);
81#endif
82 void autoscroll(); 83 void autoscroll();
@@ -97,2 +98,3 @@ class QTReader : public QWidget
97 unsigned char getBaseSize() { return m_fontControl.getBaseSize(); } 98 unsigned char getBaseSize() { return m_fontControl.getBaseSize(); }
99 QString m_outputName;
98#ifdef _SCROLLPIPE 100#ifdef _SCROLLPIPE
@@ -108,2 +110,3 @@ public:
108 QString about(); 110 QString about();
111 void readAloud();
109 CList<Bkmk>* Bkmklist() { return pBkmklist; } 112 CList<Bkmk>* Bkmklist() { return pBkmklist; }
@@ -155,3 +158,3 @@ public:
155 void clear() {}; 158 void clear() {};
156 void setText(const QString& n, const QString& s) { m_string = n; load_file((const char*)s); }; 159 void setText(const QString& n, const QString& s, unsigned int lcn = 0) { m_string = n; load_file((const char*)s, lcn); };
157 /* 160 /*
@@ -227,56 +230,8 @@ public:
227 HighlightFilter* m_highlightfilter; 230 HighlightFilter* m_highlightfilter;
228 CFilterChain* getfilter() 231 CFilterChain* getfilter();
229 {
230 CFilterChain * filt = new CFilterChain(getencoding());
231 if (bstripcr) filt->addfilter(new stripcr);
232
233 if (btextfmt || (bautofmt && (PreferredMarkup() == cTEXT))) filt->addfilter(new textfmt);
234 if (bpeanut || (bautofmt && (PreferredMarkup() == cPML))) filt->addfilter(new PeanutFormatter);
235 // if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml(m_lastfile));
236
237#ifdef __STATIC
238 if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml(m_lastfile));
239 if (bautofmt && (PreferredMarkup() == cCHM))
240 {
241 filt->addfilter(new striphtml(m_lastfile));
242 }
243#else
244 if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new ExternFilter("HTMLfilter", m_lastfile));
245 if (bautofmt && (PreferredMarkup() == cCHM))
246 {
247 ExternFilter* f = new ExternFilter("HTMLfilter",m_lastfile);
248 ((striphtml*)f->filter())->setchm(true);
249 filt->addfilter(f);
250 }
251#endif
252 m_highlightfilter = new HighlightFilter(this);
253 filt->addfilter(m_highlightfilter);
254
255 if (bdehyphen) filt->addfilter(new dehyphen);
256 if (bunindent) filt->addfilter(new unindent);
257 if (brepara) filt->addfilter(new repara(m_reparastring));
258 if (bonespace) filt->addfilter(new OnePara);
259 if (bindenter) filt->addfilter(new indenter(bindenter));
260 if (bdblspce) filt->addfilter(new dblspce);
261 if (bdepluck) filt->addfilter(new DePluck(pluckernextpart));
262 if (bdejpluck) filt->addfilter(new DePluck(jplucknextpart));
263 if (brepalm) filt->addfilter(new repalm);
264 if (bkern) filt->addfilter(new kern);
265 if (bremap) filt->addfilter(new remap);
266 if (bmakebold) filt->addfilter(new embolden);
267 if (bfulljust) filt->addfilter(new FullJust);
268 int r,g,b;
269 m_default_bg.rgb(&r, &g, &b);
270 if (r != 255 || g != 255 || b != 255)
271 filt->addfilter(new setbg(r,g,b));
272 m_default_fg.rgb(&r, &g, &b);
273 if (r != 0 || g != 0 || b != 0)
274 filt->addfilter(new setfg(r,g,b));
275 // if (bNegative) filt->addfilter(new makeNegative);
276 if (bInverse) filt->addfilter(new makeInverse);
277 return filt;
278 }
279
280 232
281private slots: 233private slots:
234#ifdef USETIMER
235 void actionDrag();
236#endif
282 void dopageup(); 237 void dopageup();
@@ -290,5 +245,5 @@ private slots:
290 void paintEvent( QPaintEvent * ); 245 void paintEvent( QPaintEvent * );
291#ifdef DOUBLEBUFFER 246
292 void resizeEvent( QResizeEvent * p ); 247 void resizeEvent( QResizeEvent * p );
293#endif 248
294 void keyPressEvent(QKeyEvent*); 249 void keyPressEvent(QKeyEvent*);
@@ -302,2 +257,3 @@ private slots:
302 void init(); 257 void init();
258 void mouseMoveEvent( QMouseEvent* );
303 void mousePressEvent( QMouseEvent* ); 259 void mousePressEvent( QMouseEvent* );
@@ -307,2 +263,5 @@ private slots:
307 void setfont(); 263 void setfont();
264 bool m_doubleBuffered;
265
266 void setDoubleBuffer(bool _b);
308 //myoutput stuff 267 //myoutput stuff
@@ -313,3 +272,3 @@ private slots:
313 bool mouseUpOn; 272 bool mouseUpOn;
314 linkType getcurrentpos(int x, int y, int w, int h, int& lineno, size_t& start, size_t& offset, size_t& tgt, size_t& tgtoffset, size_t& pictgt, QImage*&); 273 linkType getcurrentpos(int x, int y, int w, int h, int& lineno, size_t& start, size_t& offset, size_t& tgt, size_t& tgtoffset, size_t& pictgt, QImage*&, size_t&);
315 bool m_twotouch, m_touchone; 274 bool m_twotouch, m_touchone;
@@ -324,4 +283,4 @@ private slots:
324// bool m_showlast; 283// bool m_showlast;
325 bool bstripcr, btextfmt, bstriphtml, bdehyphen, bdepluck, bdejpluck, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace, bfulljust, /*bNegative,*/ bInverse; 284 bool bstripcr, btextfmt, bstriphtml, bdehyphen, bdepluck, bdejpluck, bunindent, brepara, bdblspce, btight, bmakebold, bremap, bpeanut, bautofmt, bonespace, bfulljust, /*bNegative,*/ bInverse, bNoInlineTables;
326 bool bkern, brepalm; 285 bool bkern, brepalm, bunderlineLink;
327 bool m_bpagemode, m_bMonoSpaced, m_continuousDocument; 286 bool m_bpagemode, m_bMonoSpaced, m_continuousDocument;
@@ -332,2 +291,3 @@ private slots:
332 public: 291 public:
292 bool doOutput(const QString& wrd);
333 void setDoUpdates(bool b) { bDoUpdates = b; } 293 void setDoUpdates(bool b) { bDoUpdates = b; }