summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CHM.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CHM.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CHM.h68
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 @@
1#ifndef __CHM_h
2#define __CHM_h
3#include <stdio.h>
4#include <sys/stat.h>
5#include "useqpe.h"
6#include "CExpander.h"
7#include "chm_lib.h"
8#include "my_list.h"
9#include "CExpander.h"
10
11struct Ref {
12 QString RefName;
13 QString RefLoc;
14 int beginpos;
15 int endpos;
16};
17
18struct Pic {
19 QString RefName;
20 QString RefLoc;
21 int beginpos;
22 int endpos;
23};
24
25class CHM : public CExpander
26{
27 void start2endSection();
28 struct chmUnitInfo m_ui;
29 struct chmFile *chmFile;
30 chmUnitInfo chmui;
31 //alloc a meg to buffer
32 QString chmHomeBuffer;
33 QString chmBuffer;
34 QString chmPath;
35 QString chmHHCPath;
36 unsigned int bufpos;
37 unsigned long fsize;
38 unsigned long m_homestart, m_homeend;
39public:
40 void suspend();
41 void unsuspend();
42 bool hasnavigation() { return true; }
43
44 CHM();
45 virtual ~CHM();
46 int OpenFile(const char *src);
47 int getch();
48 unsigned int locate();
49 void locate(unsigned int n);
50 bool hasrandomaccess() { return true; }
51 void sizes(unsigned long& _file, unsigned long& _text);
52 void addContent(QString content);
53 void getch(tchar& ch, CStyle& sty);
54 void setPath(QString PathName) {chmPath = PathName;};
55 void setHomePath(QString PathName) {chmHHCPath = PathName;};
56
57 MarkupType PreferredMarkup() {
58 return cCHM;
59 }
60 bool getFile(const QString& href);
61 QImage *getPicture(const QString& href);
62 QString about() { return QString("CHM codec (c) Bob Griffin\nchm_lib (c) Jed Wing\nLZX code (c) Stuart Cale"); }
63private :
64 bool FillBuffer();
65 bool FillContent();
66 void FillHomeContent();
67};
68#endif