Diffstat (limited to 'noncore/apps/opie-reader/CFilter.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CFilter.h | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/noncore/apps/opie-reader/CFilter.h b/noncore/apps/opie-reader/CFilter.h index 174e6b4..594b606 100644 --- a/noncore/apps/opie-reader/CFilter.h +++ b/noncore/apps/opie-reader/CFilter.h | |||
@@ -1,150 +1,167 @@ | |||
1 | #ifndef __CFILTER_H | 1 | #ifndef __CFILTER_H |
2 | #define __CFILTER_H | 2 | #define __CFILTER_H |
3 | 3 | ||
4 | #include "CExpander.h" | 4 | #include "CExpander.h" |
5 | #include "CEncoding.h" | 5 | #include "CEncoding.h" |
6 | 6 | ||
7 | class CFilter_IFace : public CCharacterSource | 7 | class CFilter_IFace : public CCharacterSource |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | virtual linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) = 0; | 10 | virtual linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) = 0; |
11 | virtual void setparent(CCharacterSource* p) = 0; | 11 | virtual void setparent(CCharacterSource* p) = 0; |
12 | virtual ~CFilter_IFace() {}; | 12 | virtual ~CFilter_IFace() {}; |
13 | virtual void locate(unsigned int n) = 0; | 13 | virtual void locate(unsigned int n) = 0; |
14 | virtual bool findanchor(const QString& nm) = 0; | 14 | virtual bool findanchor(const QString& nm) = 0; |
15 | virtual void saveposn(const QString& f, size_t posn) = 0; | 15 | virtual void saveposn(const QString& f, size_t posn) = 0; |
16 | virtual void writeposn(const QString& f, size_t posn) = 0; | 16 | virtual void writeposn(const QString& f, size_t posn) = 0; |
17 | virtual linkType forward(QString& f, size_t& loc) = 0; | 17 | virtual linkType forward(QString& f, size_t& loc) = 0; |
18 | virtual linkType back(QString& f, size_t& loc) = 0; | 18 | virtual linkType back(QString& f, size_t& loc) = 0; |
19 | virtual bool hasnavigation() = 0; | 19 | virtual bool hasnavigation() = 0; |
20 | virtual int getwidth() = 0; | 20 | virtual int getwidth() = 0; |
21 | virtual CCharacterSource* getparent() = 0; | 21 | virtual CCharacterSource* getparent() = 0; |
22 | virtual unsigned long startSection() = 0; | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | class CFilter : public CFilter_IFace | 25 | class CFilter : public CFilter_IFace |
25 | { | 26 | { |
26 | protected: | 27 | protected: |
27 | CCharacterSource* parent; | 28 | CCharacterSource* parent; |
28 | public: | 29 | public: |
30 | virtual QString getTableAsHtml(unsigned long loc) | ||
31 | { | ||
32 | qDebug("CFilter::getTableAsHtml()"); | ||
33 | return parent->getTableAsHtml(loc); | ||
34 | } | ||
29 | virtual linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) | 35 | virtual linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) |
30 | { | 36 | { |
31 | return parent->hyperlink(n,noff,w,nm); | 37 | return parent->hyperlink(n,noff,w,nm); |
32 | } | 38 | } |
33 | CFilter() : parent(NULL) {} | 39 | CFilter() : parent(NULL) {} |
34 | void setparent(CCharacterSource* p) { parent = p; } | 40 | void setparent(CCharacterSource* p) { parent = p; } |
35 | CCharacterSource* getparent() { return parent; } | 41 | CCharacterSource* getparent() { return parent; } |
36 | virtual ~CFilter() {}; | 42 | virtual ~CFilter() {}; |
37 | virtual void locate(unsigned int n) | 43 | virtual void locate(unsigned int n) |
38 | { | 44 | { |
39 | parent->locate(n); | 45 | parent->locate(n); |
40 | } | 46 | } |
41 | virtual bool findanchor(const QString& nm) | 47 | virtual bool findanchor(const QString& nm) |
42 | { | 48 | { |
43 | return parent->findanchor(nm); | 49 | return parent->findanchor(nm); |
44 | } | 50 | } |
45 | virtual void saveposn(const QString& f, size_t posn) { parent->saveposn(f, posn); } | 51 | virtual void saveposn(const QString& f, size_t posn) { parent->saveposn(f, posn); } |
46 | virtual void writeposn(const QString& f, size_t posn) { parent->writeposn(f, posn); } | 52 | virtual void writeposn(const QString& f, size_t posn) { parent->writeposn(f, posn); } |
47 | virtual linkType forward(QString& f, size_t& loc) { return parent->forward(f, loc); } | 53 | virtual linkType forward(QString& f, size_t& loc) { return parent->forward(f, loc); } |
48 | virtual linkType back(QString& f, size_t& loc) { return parent->back(f, loc); } | 54 | virtual linkType back(QString& f, size_t& loc) { return parent->back(f, loc); } |
49 | virtual bool hasnavigation() { return parent->hasnavigation(); } | 55 | virtual bool hasnavigation() { return parent->hasnavigation(); } |
50 | virtual int getwidth() { return parent->getwidth(); } | 56 | virtual int getwidth() { return parent->getwidth(); } |
51 | QImage* getPicture(unsigned long tgt) { return parent->getPicture(tgt); } | 57 | QImage* getPicture(unsigned long tgt) { return parent->getPicture(tgt); } |
52 | QImage* getPicture(const QString& href) { return parent->getPicture(href); } | 58 | QImage* getPicture(const QString& href) { return parent->getPicture(href); } |
53 | bool getFile(const QString& href) { return parent->getFile(href); } | 59 | bool getFile(const QString& href, const QString& nm) { return parent->getFile(href, nm); } |
60 | virtual unsigned long startSection() { return parent->startSection(); } | ||
54 | }; | 61 | }; |
55 | 62 | ||
56 | class CFilterChain | 63 | class CFilterChain |
57 | { | 64 | { |
58 | CExpander_Interface* expander; | 65 | CExpander_Interface* expander; |
59 | CEncoding* encoder; | 66 | CEncoding* encoder; |
60 | CFilter_IFace* first; | 67 | CFilter_IFace* first; |
61 | CCharacterSource* front; | 68 | CCharacterSource* front; |
62 | public: | 69 | public: |
63 | CFilterChain(CEncoding* _e) : encoder(_e), first(NULL), front(_e) {}; | 70 | CFilterChain(CEncoding* _e) : encoder(_e), first(NULL), front(_e) {}; |
64 | ~CFilterChain() | 71 | ~CFilterChain() |
65 | { | 72 | { |
66 | CCharacterSource* p = front; | 73 | CCharacterSource* p = front; |
67 | while (p != encoder) | 74 | while (p != encoder) |
68 | { | 75 | { |
69 | CFilter_IFace* pnext = (CFilter_IFace*)p; | 76 | CFilter_IFace* pnext = (CFilter_IFace*)p; |
70 | p = ((CFilter_IFace*)p)->getparent(); | 77 | p = ((CFilter_IFace*)p)->getparent(); |
71 | delete pnext; | 78 | delete pnext; |
72 | } | 79 | } |
73 | delete encoder; | 80 | delete encoder; |
74 | } | 81 | } |
75 | linkType hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm) | 82 | linkType hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm) |
76 | { | 83 | { |
77 | return front->hyperlink(n, noff, wrd, nm); | 84 | return front->hyperlink(n, noff, wrd, nm); |
78 | } | 85 | } |
86 | QString getTableAsHtml(unsigned long loc) | ||
87 | { | ||
88 | return front->getTableAsHtml(loc); | ||
89 | } | ||
79 | void locate(unsigned int n) | 90 | void locate(unsigned int n) |
80 | { | 91 | { |
81 | front->locate(n); | 92 | front->locate(n); |
82 | } | 93 | } |
83 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) | 94 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) |
84 | { | 95 | { |
85 | front->getch(ch, sty, pos); | 96 | front->getch(ch, sty, pos); |
86 | } | 97 | } |
98 | /* | ||
99 | void rawgetch(tchar& ch, CStyle& sty, unsigned long& pos) | ||
100 | { | ||
101 | encoder->getch(ch, sty, pos); | ||
102 | } | ||
103 | */ | ||
87 | void addfilter(CFilter_IFace* p) | 104 | void addfilter(CFilter_IFace* p) |
88 | { | 105 | { |
89 | if (first == NULL) | 106 | if (first == NULL) |
90 | { | 107 | { |
91 | front = first = p; | 108 | front = first = p; |
92 | p->setparent(encoder); | 109 | p->setparent(encoder); |
93 | } | 110 | } |
94 | else | 111 | else |
95 | { | 112 | { |
96 | p->setparent(front); | 113 | p->setparent(front); |
97 | front = p; | 114 | front = p; |
98 | } | 115 | } |
99 | } | 116 | } |
100 | void setsource(CExpander_Interface* p) | 117 | void setsource(CExpander_Interface* p) |
101 | { | 118 | { |
102 | expander = p; | 119 | expander = p; |
103 | encoder->setparent(p); | 120 | encoder->setparent(p); |
104 | } | 121 | } |
105 | void setencoder(CEncoding* p) | 122 | void setencoder(CEncoding* p) |
106 | { | 123 | { |
107 | delete encoder; | 124 | delete encoder; |
108 | encoder = p; | 125 | encoder = p; |
109 | first->setparent(p); | 126 | first->setparent(p); |
110 | encoder->setparent(expander); | 127 | encoder->setparent(expander); |
111 | } | 128 | } |
112 | bool findanchor(const QString& nm) | 129 | bool findanchor(const QString& nm) |
113 | { | 130 | { |
114 | return front->findanchor(nm); | 131 | return front->findanchor(nm); |
115 | } | 132 | } |
116 | void saveposn(const QString& f, size_t posn) { front->saveposn(f, posn); } | 133 | void saveposn(const QString& f, size_t posn) { front->saveposn(f, posn); } |
117 | void writeposn(const QString& f, size_t posn) { front->writeposn(f, posn); } | 134 | void writeposn(const QString& f, size_t posn) { front->writeposn(f, posn); } |
118 | linkType forward(QString& f, size_t& loc) { return front->forward(f, loc); } | 135 | linkType forward(QString& f, size_t& loc) { return front->forward(f, loc); } |
119 | linkType back(QString& f, size_t& loc) { return front->back(f, loc); } | 136 | linkType back(QString& f, size_t& loc) { return front->back(f, loc); } |
120 | bool hasnavigation() { return front->hasnavigation(); } | 137 | bool hasnavigation() { return front->hasnavigation(); } |
121 | QString about() { return QString("Filter chain (c) Tim Wentford\n")+front->about(); } | 138 | QString about() { return QString("Filter chain (c) Tim Wentford\n")+front->about(); } |
122 | }; | 139 | }; |
123 | 140 | ||
124 | class stripcr : public CFilter | 141 | class stripcr : public CFilter |
125 | { | 142 | { |
126 | public: | 143 | public: |
127 | stripcr() {} | 144 | stripcr() {} |
128 | ~stripcr() {} | 145 | ~stripcr() {} |
129 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) | 146 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) |
130 | { | 147 | { |
131 | do | 148 | do |
132 | { | 149 | { |
133 | parent->getch(ch, sty, pos); | 150 | parent->getch(ch, sty, pos); |
134 | } | 151 | } |
135 | while (ch == 13); | 152 | while (ch == 13); |
136 | } | 153 | } |
137 | QString about() { return QString("StripCR filter (c) Tim Wentford\n")+parent->about(); } | 154 | QString about() { return QString("StripCR filter (c) Tim Wentford\n")+parent->about(); } |
138 | }; | 155 | }; |
139 | 156 | ||
140 | class dehyphen : public CFilter | 157 | class dehyphen : public CFilter |
141 | { | 158 | { |
142 | bool m_bCharWaiting; | 159 | bool m_bCharWaiting; |
143 | tchar m_nextChar; | 160 | tchar m_nextChar; |
144 | CStyle m_nextSty; | 161 | CStyle m_nextSty; |
145 | public: | 162 | public: |
146 | dehyphen() : m_bCharWaiting(false) {} | 163 | dehyphen() : m_bCharWaiting(false) {} |
147 | ~dehyphen() {} | 164 | ~dehyphen() {} |
148 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) | 165 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) |
149 | { | 166 | { |
150 | if (m_bCharWaiting) | 167 | if (m_bCharWaiting) |
@@ -342,133 +359,165 @@ class DePluck : public CFilter | |||
342 | ~DePluck() {} | 359 | ~DePluck() {} |
343 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 360 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
344 | QString about() { return QString("Depluck filter (c) Tim Wentford\n")+parent->about(); } | 361 | QString about() { return QString("Depluck filter (c) Tim Wentford\n")+parent->about(); } |
345 | }; | 362 | }; |
346 | 363 | ||
347 | class repalm : public CFilter | 364 | class repalm : public CFilter |
348 | { | 365 | { |
349 | public: | 366 | public: |
350 | ~repalm() {} | 367 | ~repalm() {} |
351 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 368 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
352 | QString about() { return QString("Repalm filter (c) Tim Wentford\n")+parent->about(); } | 369 | QString about() { return QString("Repalm filter (c) Tim Wentford\n")+parent->about(); } |
353 | }; | 370 | }; |
354 | 371 | ||
355 | class FullJust : public CFilter | 372 | class FullJust : public CFilter |
356 | { | 373 | { |
357 | public: | 374 | public: |
358 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) | 375 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) |
359 | { | 376 | { |
360 | parent->getch(ch, sty, pos); | 377 | parent->getch(ch, sty, pos); |
361 | if (sty.getJustify() == m_AlignLeft) sty.setFullJustify(); | 378 | if (sty.getJustify() == m_AlignLeft) sty.setFullJustify(); |
362 | } | 379 | } |
363 | QString about() { return QString("Full justification filter (c) Tim Wentford\n")+parent->about(); } | 380 | QString about() { return QString("Full justification filter (c) Tim Wentford\n")+parent->about(); } |
364 | }; | 381 | }; |
365 | /* | 382 | /* |
366 | class AddSpace : public CFilter | 383 | class AddSpace : public CFilter |
367 | { | 384 | { |
368 | unsigned char m_espc; | 385 | unsigned char m_espc; |
369 | public: | 386 | public: |
370 | AddSpace(unsigned char s) : m_espc(s) {} | 387 | AddSpace(unsigned char s) : m_espc(s) {} |
371 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) | 388 | void getch(tchar& ch, CStyle& sty, unsigned long& pos) |
372 | { | 389 | { |
373 | parent->getch(ch, sty, pos); | 390 | parent->getch(ch, sty, pos); |
374 | sty.setExtraSpace(m_espc); | 391 | sty.setExtraSpace(m_espc); |
375 | } | 392 | } |
376 | }; | 393 | }; |
377 | */ | 394 | */ |
378 | 395 | ||
379 | class QTReader; | 396 | class QTReader; |
380 | 397 | ||
381 | class HighlightFilter : public CFilter | 398 | class HighlightFilter : public CFilter |
382 | { | 399 | { |
383 | QTReader* pReader; | 400 | QTReader* pReader; |
384 | unsigned long lastpos, nextpos; | 401 | unsigned long lastpos, nextpos; |
385 | unsigned char red, green, blue; | 402 | unsigned char red, green, blue; |
386 | CList<Bkmk>* bkmks; | 403 | CList<Bkmk>* bkmks; |
387 | public: | 404 | public: |
388 | HighlightFilter(QTReader*); | 405 | HighlightFilter(QTReader*); |
389 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 406 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
390 | void refresh(unsigned long); | 407 | void refresh(unsigned long); |
391 | QString about() { return QString("High-lighting filter (c) Tim Wentford\n")+parent->about(); } | 408 | QString about() { return QString("High-lighting filter (c) Tim Wentford\n")+parent->about(); } |
392 | }; | 409 | }; |
393 | 410 | ||
394 | #ifndef __STATIC | 411 | #ifndef __STATIC |
395 | #include <dlfcn.h> | 412 | #include <dlfcn.h> |
396 | 413 | ||
397 | class ExternFilter : public CFilter_IFace | 414 | class ExternFilter : public CFilter_IFace |
398 | { | 415 | { |
399 | CFilter* filt; | 416 | CFilter* filt; |
400 | void *handle; | 417 | void *handle; |
401 | public: | 418 | public: |
402 | linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) | 419 | linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) |
403 | { | 420 | { |
404 | return filt->hyperlink(n, noff, w, nm); | 421 | return filt->hyperlink(n, noff, w, nm); |
405 | } | 422 | } |
423 | QString getTableAsHtml(unsigned long loc) | ||
424 | { | ||
425 | qDebug("ExternFilter::getTableAsHtml()"); | ||
426 | return filt->getTableAsHtml(loc); | ||
427 | } | ||
406 | void setparent(CCharacterSource* p) { filt->setparent(p); } | 428 | void setparent(CCharacterSource* p) { filt->setparent(p); } |
407 | ExternFilter(const QString& nm, const QString& optional); | 429 | ExternFilter(const QString& nm, const QString& optional); |
408 | ~ExternFilter() | 430 | ~ExternFilter() |
409 | { | 431 | { |
410 | if (filt != NULL) delete filt; | 432 | if (filt != NULL) delete filt; |
411 | if (handle != NULL) dlclose(handle); | 433 | if (handle != NULL) dlclose(handle); |
412 | } | 434 | } |
413 | void locate(unsigned int n) { filt->locate(n); } | 435 | void locate(unsigned int n) { filt->locate(n); } |
414 | bool findanchor(const QString& nm) { return filt->findanchor(nm); } | 436 | bool findanchor(const QString& nm) |
437 | { | ||
438 | return filt->findanchor(nm); | ||
439 | } | ||
415 | void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); } | 440 | void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); } |
416 | void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); } | 441 | void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); } |
417 | linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); } | 442 | linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); } |
418 | linkType back(QString& f, size_t& loc) { return filt->back(f, loc); } | 443 | linkType back(QString& f, size_t& loc) { return filt->back(f, loc); } |
419 | bool hasnavigation() { return filt->hasnavigation(); } | 444 | bool hasnavigation() { return filt->hasnavigation(); } |
420 | int getwidth() { return filt->getwidth(); } | 445 | int getwidth() { return filt->getwidth(); } |
421 | CCharacterSource* getparent() { return filt->getparent(); } | 446 | CCharacterSource* getparent() { return filt->getparent(); } |
422 | void getch(tchar& c, CStyle& s, unsigned long& l) { filt->getch(c, s, l); } | 447 | void getch(tchar& c, CStyle& s, unsigned long& l) { filt->getch(c, s, l); } |
423 | QImage* getPicture(unsigned long tgt) { return filt->getPicture(tgt); } | 448 | QImage* getPicture(unsigned long tgt) { return filt->getPicture(tgt); } |
424 | CFilter* filter() { return filt; } | 449 | CFilter* filter() { return filt; } |
425 | QImage* getPicture(const QString& href) { return filt->getPicture(href); } | 450 | QImage* getPicture(const QString& href) { return filt->getPicture(href); } |
426 | bool getFile(const QString& href) { return filt->getFile(href); } | 451 | bool getFile(const QString& href, const QString& nm) { return filt->getFile(href, nm); } |
427 | QString about() { return QString("Filter plug-in (c) Tim Wentford\n")+filt->about(); } | 452 | QString about() { return QString("Filter plug-in (c) Tim Wentford\n")+filt->about(); } |
453 | unsigned long startSection() { return filt->startSection(); } | ||
428 | }; | 454 | }; |
429 | #endif | 455 | #endif |
430 | 456 | ||
431 | class kern : public CFilter | 457 | class kern : public CFilter |
432 | { | 458 | { |
433 | tchar lastchar; | 459 | tchar lastchar; |
434 | bool uselast; | 460 | bool uselast; |
435 | CStyle laststy; | 461 | CStyle laststy; |
436 | public: | 462 | public: |
437 | kern() : lastchar(0), uselast(false) {} | 463 | kern() : lastchar(0), uselast(false) {} |
438 | ~kern() {} | 464 | ~kern() {} |
439 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 465 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
440 | QString about() { return QString("Kerning filter (c) Tim Wentford\n")+parent->about(); } | 466 | QString about() { return QString("Kerning filter (c) Tim Wentford\n")+parent->about(); } |
441 | }; | 467 | }; |
442 | 468 | ||
443 | class makeInverse : public CFilter | 469 | class makeInverse : public CFilter |
444 | { | 470 | { |
445 | public: | 471 | public: |
446 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 472 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
447 | QString about() { return QString("Colourmap inversion filter (c) Tim Wentford\n")+parent->about(); } | 473 | QString about() { return QString("Colourmap inversion filter (c) Tim Wentford\n")+parent->about(); } |
448 | }; | 474 | }; |
449 | /* | 475 | /* |
450 | class makeNegative : public CFilter | 476 | class makeNegative : public CFilter |
451 | { | 477 | { |
452 | public: | 478 | public: |
453 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 479 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
454 | }; | 480 | }; |
455 | */ | 481 | */ |
456 | class setbg : public CFilter | 482 | class setbg : public CFilter |
457 | { | 483 | { |
458 | int m_r, m_g, m_b; | 484 | int m_r, m_g, m_b; |
459 | public: | 485 | public: |
460 | setbg(int _r, int _g, int _b) : m_r(_r), m_g(_g), m_b(_b) {} | 486 | setbg(int _r, int _g, int _b) : m_r(_r), m_g(_g), m_b(_b) {} |
461 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 487 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
462 | QString about() { return QString("Background colour filter (c) Tim Wentford\n")+parent->about(); } | 488 | QString about() { return QString("Background colour filter (c) Tim Wentford\n")+parent->about(); } |
463 | }; | 489 | }; |
464 | 490 | ||
465 | class setfg : public CFilter | 491 | class setfg : public CFilter |
466 | { | 492 | { |
467 | int m_r, m_g, m_b; | 493 | int m_r, m_g, m_b; |
468 | public: | 494 | public: |
469 | setfg(int _r, int _g, int _b) : m_r(_r), m_g(_g), m_b(_b) {} | 495 | setfg(int _r, int _g, int _b) : m_r(_r), m_g(_g), m_b(_b) {} |
470 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | 496 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); |
471 | QString about() { return QString("Foreground colour filter (c) Tim Wentford\n")+parent->about(); } | 497 | QString about() { return QString("Foreground colour filter (c) Tim Wentford\n")+parent->about(); } |
472 | }; | 498 | }; |
473 | 499 | ||
500 | class tableLink : public CFilter | ||
501 | { | ||
502 | QString text; | ||
503 | int offset; | ||
504 | int m_r, m_g, m_b; | ||
505 | public: | ||
506 | tableLink() : text( "See Table" ), offset(-1) | ||
507 | { | ||
508 | } | ||
509 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | ||
510 | QString about() { return QString("Table link filter (c) Tim Wentford\n")+parent->about(); } | ||
511 | }; | ||
512 | |||
513 | class underlineLink : public CFilter | ||
514 | { | ||
515 | bool isLink; | ||
516 | public: | ||
517 | underlineLink() : isLink(false) {} | ||
518 | ~underlineLink() {} | ||
519 | void getch(tchar& ch, CStyle& sty, unsigned long& pos); | ||
520 | QString about() { return QString("Link underlining filter (c) Tim Wentford\n")+parent->about(); } | ||
521 | }; | ||
522 | |||
474 | #endif | 523 | #endif |