summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ebookcodec.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/ebookcodec.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ebookcodec.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/ebookcodec.h b/noncore/apps/opie-reader/ebookcodec.h
index f6e2daf..4229fb9 100644
--- a/noncore/apps/opie-reader/ebookcodec.h
+++ b/noncore/apps/opie-reader/ebookcodec.h
@@ -1,38 +1,47 @@
#include "CExpander.h"
#include <qfileinfo.h>
#include <qdir.h>
#ifdef USEQPE
#include <qpe/global.h>
#endif
-#include "util.h"
-
#ifndef __STATIC
#include <dlfcn.h>
class ebookcodec : public CExpander_Interface
{
CExpander *codec;
void *handle;
int status;
public:
+ QString getTableAsHtml(unsigned long loc) { return codec->getTableAsHtml(loc); }
QString about()
{
return QString("Plug-in ebook codec interface (c) Tim Wentford\n")+codec->about();
}
ebookcodec(const QString& _s) : codec(NULL), handle(NULL), status(0)
{
- QString codecpath(QTReaderUtil::getPluginPath());
+#ifdef USEQPE
+#ifdef OPIE
+ QString codecpath(getenv("OPIEDIR"));
+#else
+ QString codecpath(getenv("QTDIR"));
+#endif
+ codecpath += "/plugins/reader/codecs/";
+#else
+ QString codecpath(getenv("READERDIR"));
+ codecpath += "/codecs/";
+#endif
codecpath += _s;
if (QFile::exists(codecpath))
{
qDebug("Codec:%s", (const char*)codecpath);
handle = dlopen(codecpath, RTLD_LAZY);
if (handle == 0)
{
/*
QString wrn(dlerror());
QString fmt;
while (wrn.length() > 10)
{
@@ -104,15 +113,19 @@ class ebookcodec : public CExpander_Interface
void putSaveData(unsigned char*& src, unsigned short& srclen) { codec->putSaveData(src, srclen); }
void setContinuous(bool _b) { codec->setContinuous(_b); }
void setwidth(int w) { codec->setwidth(w); }
unsigned long startSection() { return codec->startSection(); }
unsigned long endSection() { return codec->endSection(); }
int openfile(const char *src)
{
//qDebug("ebook openfile:%s", src);
return (status != 0) ? status : codec->openfile(src);
}
int getwidth() { return codec->getwidth(); }
QImage* getPicture(const QString& href) { return codec->getPicture(href); }
- bool getFile(const QString& href) { return codec->getFile(href); }
+ bool getFile(const QString& href, const QString& nm) { return codec->getFile(href, nm); }
+ bool findanchor(const QString& nm)
+ {
+ return codec->findanchor(nm);
+ }
};
#endif