summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CFilter.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/CFilter.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CFilter.h55
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
@@ -18,15 +18,21 @@ class CFilter_IFace : public CCharacterSource
virtual linkType back(QString& f, size_t& loc) = 0;
virtual bool hasnavigation() = 0;
virtual int getwidth() = 0;
virtual CCharacterSource* getparent() = 0;
+ virtual unsigned long startSection() = 0;
};
class CFilter : public CFilter_IFace
{
protected:
CCharacterSource* parent;
public:
+ virtual QString getTableAsHtml(unsigned long loc)
+ {
+ qDebug("CFilter::getTableAsHtml()");
+ return parent->getTableAsHtml(loc);
+ }
virtual linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm)
{
return parent->hyperlink(n,noff,w,nm);
}
@@ -49,9 +55,10 @@ class CFilter : public CFilter_IFace
virtual bool hasnavigation() { return parent->hasnavigation(); }
virtual int getwidth() { return parent->getwidth(); }
QImage* getPicture(unsigned long tgt) { return parent->getPicture(tgt); }
QImage* getPicture(const QString& href) { return parent->getPicture(href); }
- bool getFile(const QString& href) { return parent->getFile(href); }
+ bool getFile(const QString& href, const QString& nm) { return parent->getFile(href, nm); }
+ virtual unsigned long startSection() { return parent->startSection(); }
};
class CFilterChain
{
@@ -75,16 +82,26 @@ class CFilterChain
linkType hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm)
{
return front->hyperlink(n, noff, wrd, nm);
}
+ QString getTableAsHtml(unsigned long loc)
+ {
+ return front->getTableAsHtml(loc);
+ }
void locate(unsigned int n)
{
front->locate(n);
}
void getch(tchar& ch, CStyle& sty, unsigned long& pos)
{
front->getch(ch, sty, pos);
}
+ /*
+ void rawgetch(tchar& ch, CStyle& sty, unsigned long& pos)
+ {
+ encoder->getch(ch, sty, pos);
+ }
+ */
void addfilter(CFilter_IFace* p)
{
if (first == NULL)
{
@@ -402,17 +419,25 @@ class ExternFilter : public CFilter_IFace
linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm)
{
return filt->hyperlink(n, noff, w, nm);
}
+ QString getTableAsHtml(unsigned long loc)
+ {
+ qDebug("ExternFilter::getTableAsHtml()");
+ return filt->getTableAsHtml(loc);
+ }
void setparent(CCharacterSource* p) { filt->setparent(p); }
ExternFilter(const QString& nm, const QString& optional);
~ExternFilter()
{
if (filt != NULL) delete filt;
if (handle != NULL) dlclose(handle);
}
void locate(unsigned int n) { filt->locate(n); }
- bool findanchor(const QString& nm) { return filt->findanchor(nm); }
+ bool findanchor(const QString& nm)
+ {
+ return filt->findanchor(nm);
+ }
void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); }
void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); }
linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); }
linkType back(QString& f, size_t& loc) { return filt->back(f, loc); }
@@ -422,10 +447,11 @@ class ExternFilter : public CFilter_IFace
void getch(tchar& c, CStyle& s, unsigned long& l) { filt->getch(c, s, l); }
QImage* getPicture(unsigned long tgt) { return filt->getPicture(tgt); }
CFilter* filter() { return filt; }
QImage* getPicture(const QString& href) { return filt->getPicture(href); }
- bool getFile(const QString& href) { return filt->getFile(href); }
+ bool getFile(const QString& href, const QString& nm) { return filt->getFile(href, nm); }
QString about() { return QString("Filter plug-in (c) Tim Wentford\n")+filt->about(); }
+ unsigned long startSection() { return filt->startSection(); }
};
#endif
class kern : public CFilter
@@ -470,5 +496,28 @@ class setfg : public CFilter
void getch(tchar& ch, CStyle& sty, unsigned long& pos);
QString about() { return QString("Foreground colour filter (c) Tim Wentford\n")+parent->about(); }
};
+class tableLink : public CFilter
+{
+ QString text;
+ int offset;
+ int m_r, m_g, m_b;
+ public:
+ tableLink() : text( "See Table" ), offset(-1)
+ {
+ }
+ void getch(tchar& ch, CStyle& sty, unsigned long& pos);
+ QString about() { return QString("Table link filter (c) Tim Wentford\n")+parent->about(); }
+};
+
+class underlineLink : public CFilter
+{
+ bool isLink;
+ public:
+ underlineLink() : isLink(false) {}
+ ~underlineLink() {}
+ void getch(tchar& ch, CStyle& sty, unsigned long& pos);
+ QString about() { return QString("Link underlining filter (c) Tim Wentford\n")+parent->about(); }
+};
+
#endif