author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (unidiff) | |
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) (ignore 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 @@ | |||
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 | |||
11 | struct Ref { | ||
12 | QString RefName; | ||
13 | QString RefLoc; | ||
14 | int beginpos; | ||
15 | int endpos; | ||
16 | }; | ||
17 | |||
18 | struct Pic { | ||
19 | QString RefName; | ||
20 | QString RefLoc; | ||
21 | int beginpos; | ||
22 | int endpos; | ||
23 | }; | ||
24 | |||
25 | class 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; | ||
39 | public: | ||
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"); } | ||
63 | private : | ||
64 | bool FillBuffer(); | ||
65 | bool FillContent(); | ||
66 | void FillHomeContent(); | ||
67 | }; | ||
68 | #endif | ||