summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CFilter.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CFilter.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CFilter.h93
1 files changed, 67 insertions, 26 deletions
diff --git a/noncore/apps/opie-reader/CFilter.h b/noncore/apps/opie-reader/CFilter.h
index 2d0c30f..0a03b3e 100644
--- a/noncore/apps/opie-reader/CFilter.h
+++ b/noncore/apps/opie-reader/CFilter.h
@@ -9,6 +9,10 @@ class CFilter : public CCharacterSource
9 friend class CFilterChain; 9 friend class CFilterChain;
10 protected: 10 protected:
11 CCharacterSource* parent; 11 CCharacterSource* parent;
12 linkType hyperlink(unsigned int n, QString& w)
13 {
14 return parent->hyperlink(n,w);
15 }
12 public: 16 public:
13 CFilter() : parent(NULL) {} 17 CFilter() : parent(NULL) {}
14 void setparent(CCharacterSource* p) { parent = p; } 18 void setparent(CCharacterSource* p) { parent = p; }
@@ -69,8 +73,8 @@ class stripcr : public CFilter
69{ 73{
70 public: 74 public:
71 stripcr() {} 75 stripcr() {}
72 virtual ~stripcr() {} 76 ~stripcr() {}
73 virtual void getch(tchar& ch, CStyle& sty) 77 void getch(tchar& ch, CStyle& sty)
74 { 78 {
75 do 79 do
76 { 80 {
@@ -87,8 +91,8 @@ class dehyphen : public CFilter
87 CStyle m_nextSty; 91 CStyle m_nextSty;
88 public: 92 public:
89 dehyphen() : m_bCharWaiting(false) {} 93 dehyphen() : m_bCharWaiting(false) {}
90 virtual ~dehyphen() {} 94 ~dehyphen() {}
91 virtual void getch(tchar& ch, CStyle& sty) 95 void getch(tchar& ch, CStyle& sty)
92 { 96 {
93 if (m_bCharWaiting) 97 if (m_bCharWaiting)
94 { 98 {
@@ -119,8 +123,8 @@ class striphtml : public CFilter
119 void mygetch(tchar& ch, CStyle& sty); 123 void mygetch(tchar& ch, CStyle& sty);
120 public: 124 public:
121 striphtml() {} 125 striphtml() {}
122 virtual ~striphtml() {} 126 ~striphtml() {}
123 virtual void getch(tchar& ch, CStyle& sty); 127 void getch(tchar& ch, CStyle& sty);
124}; 128};
125 129
126class unindent : public CFilter 130class unindent : public CFilter
@@ -128,8 +132,8 @@ class unindent : public CFilter
128 tchar lc; 132 tchar lc;
129 public: 133 public:
130 unindent() : lc(0) {} 134 unindent() : lc(0) {}
131 virtual ~unindent() {} 135 ~unindent() {}
132 virtual void getch(tchar& ch, CStyle& sty) 136 void getch(tchar& ch, CStyle& sty)
133 { 137 {
134 if (lc == 10) 138 if (lc == 10)
135 { 139 {
@@ -150,8 +154,8 @@ class repara : public CFilter
150 tchar tch; 154 tchar tch;
151 public: 155 public:
152 repara() : tch(0) {} 156 repara() : tch(0) {}
153 virtual ~repara() {} 157 ~repara() {}
154 virtual void getch(tchar& ch, CStyle& sty) 158 void getch(tchar& ch, CStyle& sty)
155 { 159 {
156 parent->getch(ch, sty); 160 parent->getch(ch, sty);
157 if (ch == 10) 161 if (ch == 10)
@@ -179,8 +183,8 @@ class indenter : public CFilter
179 CStyle lsty; 183 CStyle lsty;
180 public: 184 public:
181 indenter(int _a=5) : amnt(_a), indent(0) {} 185 indenter(int _a=5) : amnt(_a), indent(0) {}
182 virtual ~indenter() {} 186 ~indenter() {}
183 virtual void getch(tchar& ch, CStyle& sty) 187 void getch(tchar& ch, CStyle& sty)
184 { 188 {
185 if (indent > 0) 189 if (indent > 0)
186 { 190 {
@@ -205,8 +209,8 @@ class dblspce : public CFilter
205 CStyle lsty; 209 CStyle lsty;
206 public: 210 public:
207 dblspce() : lastlf(false) {} 211 dblspce() : lastlf(false) {}
208 virtual ~dblspce() {} 212 ~dblspce() {}
209 virtual void getch(tchar& ch, CStyle& sty) 213 void getch(tchar& ch, CStyle& sty)
210 { 214 {
211 if (lastlf) 215 if (lastlf)
212 { 216 {
@@ -232,16 +236,16 @@ class textfmt : public CFilter
232 void mygetch(tchar&, CStyle&); 236 void mygetch(tchar&, CStyle&);
233 public: 237 public:
234 textfmt() : lastchar(0), uselast(false) {} 238 textfmt() : lastchar(0), uselast(false) {}
235 virtual ~textfmt() {} 239 ~textfmt() {}
236 virtual void getch(tchar& ch, CStyle& sty); 240 void getch(tchar& ch, CStyle& sty);
237}; 241};
238 242
239class embolden : public CFilter 243class embolden : public CFilter
240{ 244{
241 public: 245 public:
242 embolden() {} 246 embolden() {}
243 virtual ~embolden() {} 247 ~embolden() {}
244 virtual void getch(tchar& ch, CStyle& sty) 248 void getch(tchar& ch, CStyle& sty)
245 { 249 {
246 parent->getch(ch, sty); 250 parent->getch(ch, sty);
247 sty.setBold(); 251 sty.setBold();
@@ -255,16 +259,16 @@ class remap : public CFilter
255 CStyle currentstyle; 259 CStyle currentstyle;
256 public: 260 public:
257 remap() : offset(0) { q[0] = 0; } 261 remap() : offset(0) { q[0] = 0; }
258 virtual ~remap() {} 262 ~remap() {}
259 virtual void getch(tchar& ch, CStyle& sty); 263 void getch(tchar& ch, CStyle& sty);
260}; 264};
261 265
262class PeanutFormatter : public CFilter 266class PeanutFormatter : public CFilter
263{ 267{
264 CStyle currentstyle; 268 CStyle currentstyle;
265 public: 269 public:
266 virtual ~PeanutFormatter() {} 270 ~PeanutFormatter() {}
267 virtual void getch(tchar& ch, CStyle& sty); 271 void getch(tchar& ch, CStyle& sty);
268}; 272};
269 273
270class OnePara : public CFilter 274class OnePara : public CFilter
@@ -272,16 +276,53 @@ class OnePara : public CFilter
272 tchar m_lastchar; 276 tchar m_lastchar;
273 public: 277 public:
274 OnePara() : m_lastchar(0) {} 278 OnePara() : m_lastchar(0) {}
275 virtual ~OnePara() {} 279 ~OnePara() {}
276 virtual void getch(tchar& ch, CStyle& sty); 280 void getch(tchar& ch, CStyle& sty);
281};
282
283class DePluck : public CFilter
284{
285 tchar* nextpart;
286 tchar m_buffer;
287 int m_buffed;
288 int m_current;
289 bool m_debuff;
290 CStyle m_laststyle;
291 public:
292 DePluck(tchar* t) : nextpart(t), m_buffer(0), m_buffed(0), m_current(0), m_debuff(false) {}
293 ~DePluck() {}
294 void getch(tchar& ch, CStyle& sty);
277}; 295};
278 296
279#ifdef REPALM 297#ifdef REPALM
280class repalm : public CFilter 298class repalm : public CFilter
281{ 299{
282 public: 300 public:
283 virtual ~repalm() {} 301 ~repalm() {}
284 virtual void getch(tchar& ch, CStyle& sty); 302 void getch(tchar& ch, CStyle& sty);
285}; 303};
286#endif 304#endif
305
306class FullJust : public CFilter
307{
308 public:
309 void getch(tchar& ch, CStyle& sty)
310 {
311 parent->getch(ch, sty);
312 if (sty.getJustify() == m_AlignLeft) sty.setFullJustify();
313 }
314};
315/*
316class AddSpace : public CFilter
317{
318 unsigned char m_espc;
319 public:
320 AddSpace(unsigned char s) : m_espc(s) {}
321 void getch(tchar& ch, CStyle& sty)
322 {
323 parent->getch(ch, sty);
324 sty.setExtraSpace(m_espc);
325 }
326};
327*/
287#endif 328#endif