author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/CHM.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/CHM.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CHM.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CHM.h b/noncore/apps/opie-reader/CHM.h new file mode 100644 index 0000000..7dac46f --- a/dev/null +++ b/noncore/apps/opie-reader/CHM.h @@ -0,0 +1,68 @@ +#ifndef __CHM_h +#define __CHM_h +#include <stdio.h> +#include <sys/stat.h> +#include "useqpe.h" +#include "CExpander.h" +#include "chm_lib.h" +#include "my_list.h" +#include "CExpander.h" + +struct Ref { + QString RefName; + QString RefLoc; + int beginpos; + int endpos; +}; + +struct Pic { + QString RefName; + QString RefLoc; + int beginpos; + int endpos; +}; + +class CHM : public CExpander +{ + void start2endSection(); + struct chmUnitInfo m_ui; + struct chmFile *chmFile; + chmUnitInfo chmui; + //alloc a meg to buffer + QString chmHomeBuffer; + QString chmBuffer; + QString chmPath; + QString chmHHCPath; + unsigned int bufpos; + unsigned long fsize; + unsigned long m_homestart, m_homeend; +public: + void suspend(); + void unsuspend(); + bool hasnavigation() { return true; } + + CHM(); + virtual ~CHM(); + int OpenFile(const char *src); + int getch(); + unsigned int locate(); + void locate(unsigned int n); + bool hasrandomaccess() { return true; } + void sizes(unsigned long& _file, unsigned long& _text); + void addContent(QString content); + void getch(tchar& ch, CStyle& sty); + void setPath(QString PathName) {chmPath = PathName;}; + void setHomePath(QString PathName) {chmHHCPath = PathName;}; + + MarkupType PreferredMarkup() { + return cCHM; + } + bool getFile(const QString& href); + QImage *getPicture(const QString& href); + QString about() { return QString("CHM codec (c) Bob Griffin\nchm_lib (c) Jed Wing\nLZX code (c) Stuart Cale"); } +private : + bool FillBuffer(); + bool FillContent(); + void FillHomeContent(); +}; +#endif |