author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/BuffDoc.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/BuffDoc.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/BuffDoc.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.h b/noncore/apps/opie-reader/BuffDoc.h index 1aac817..78d8457 100644 --- a/noncore/apps/opie-reader/BuffDoc.h +++ b/noncore/apps/opie-reader/BuffDoc.h | |||
@@ -10,24 +10,45 @@ | |||
10 | #include <qfontmetrics.h> | 10 | #include <qfontmetrics.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | 12 | ||
13 | class BuffDoc | 13 | class BuffDoc |
14 | { | 14 | { |
15 | CDrawBuffer lastword; | 15 | CDrawBuffer lastword; |
16 | CSizeBuffer lastsizes, allsizes; | 16 | CSizeBuffer lastsizes, allsizes; |
17 | size_t laststartline; | 17 | size_t laststartline; |
18 | bool lastispara; | 18 | bool lastispara; |
19 | CExpander* exp; | 19 | CExpander* exp; |
20 | CFilterChain* filt; | 20 | CFilterChain* filt; |
21 | public: | 21 | public: |
22 | void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) | ||
23 | { | ||
24 | if (exp == NULL) | ||
25 | { | ||
26 | data = NULL; | ||
27 | len = 0; | ||
28 | } | ||
29 | else | ||
30 | { | ||
31 | exp->setSaveData(data, len, src, srclen); | ||
32 | } | ||
33 | } | ||
34 | void putSaveData(unsigned char*& src, unsigned short& srclen) | ||
35 | { | ||
36 | if (exp != NULL) | ||
37 | { | ||
38 | exp->putSaveData(src, srclen); | ||
39 | } | ||
40 | } | ||
41 | void suspend() { if (exp != NULL) exp->suspend(); } | ||
42 | void unsuspend() { if (exp != NULL) exp->unsuspend(); } | ||
22 | ~BuffDoc() | 43 | ~BuffDoc() |
23 | { | 44 | { |
24 | delete filt; | 45 | delete filt; |
25 | delete exp; | 46 | delete exp; |
26 | } | 47 | } |
27 | BuffDoc() | 48 | BuffDoc() |
28 | { | 49 | { |
29 | exp = NULL; | 50 | exp = NULL; |
30 | filt = NULL; | 51 | filt = NULL; |
31 | lastword.empty(); | 52 | lastword.empty(); |
32 | // qDebug("Buffdoc created"); | 53 | // qDebug("Buffdoc created"); |
33 | } | 54 | } |
@@ -52,33 +73,42 @@ class BuffDoc | |||
52 | } | 73 | } |
53 | return ch; | 74 | return ch; |
54 | } | 75 | } |
55 | void getch(tchar& ch, CStyle& sty) | 76 | void getch(tchar& ch, CStyle& sty) |
56 | { | 77 | { |
57 | if (exp != NULL) | 78 | if (exp != NULL) |
58 | { | 79 | { |
59 | filt->getch(ch, sty); | 80 | filt->getch(ch, sty); |
60 | } | 81 | } |
61 | else | 82 | else |
62 | ch = UEOF; | 83 | ch = UEOF; |
63 | } | 84 | } |
85 | QPixmap* getPicture(unsigned long tgt) { return (exp == NULL) ? NULL : exp->getPicture(tgt); } | ||
86 | unsigned int startSection() { return (exp == NULL) ? 0 : exp->startSection(); } | ||
87 | unsigned int endSection() { return (exp == NULL) ? 0 : exp->endSection(); } | ||
64 | unsigned int locate() { return (exp == NULL) ? 0 : laststartline; } | 88 | unsigned int locate() { return (exp == NULL) ? 0 : laststartline; } |
65 | unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); } | 89 | unsigned int explocate() { return (exp == NULL) ? 0 : exp->locate(); } |
90 | void setContinuous(bool _b) { if (exp != NULL) exp->setContinuous(_b); } | ||
66 | MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); } | 91 | MarkupType PreferredMarkup() { return (exp == NULL) ? cTEXT : exp->PreferredMarkup(); } |
67 | bool hyperlink(unsigned int n); | 92 | bool hyperlink(unsigned int n); |
93 | size_t getHome() { return ((exp != NULL) ? exp->getHome() : 0); } | ||
68 | void locate(unsigned int n); | 94 | void locate(unsigned int n); |
69 | bool getline(CDrawBuffer* buff, int w); | 95 | bool getline(CDrawBuffer* buff, int w); |
70 | bool getline(CDrawBuffer* buff, int w, int cw); | 96 | bool getline(CDrawBuffer* buff, int w, int cw); |
71 | void sizes(unsigned long& fs, unsigned long& ts) { exp->sizes(fs,ts); } | 97 | void sizes(unsigned long& fs, unsigned long& ts) { exp->sizes(fs,ts); } |
72 | int getpara(CBuffer& buff) | 98 | int getpara(CBuffer& buff) |
73 | { | 99 | { |
74 | tchar ch; | 100 | tchar ch; |
75 | int i = 0; | 101 | int i = 0; |
76 | while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch; | 102 | while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch; |
77 | buff[i] = '\0'; | 103 | buff[i] = '\0'; |
78 | if (i == 0 && ch == UEOF) i = -1; | 104 | if (i == 0 && ch == UEOF) i = -1; |
79 | laststartline = exp->locate(); | 105 | laststartline = exp->locate(); |
80 | return i; | 106 | return i; |
81 | } | 107 | } |
108 | void saveposn(size_t posn) { exp->saveposn(posn); } | ||
109 | bool forward(size_t& loc) { return exp->forward(loc); } | ||
110 | bool back(size_t& loc) { return exp->back(loc); } | ||
111 | bool hasnavigation() { return exp->hasnavigation(); } | ||
82 | }; | 112 | }; |
83 | 113 | ||
84 | #endif | 114 | #endif |