author | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
---|---|---|
committer | pohly <pohly> | 2005-05-05 14:39:33 (UTC) |
commit | 39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91 (patch) (unidiff) | |
tree | 96e66fdc18dca4d4ab8611133e072f57dea224b9 /noncore/apps/opie-reader/StyleConsts.h | |
parent | 279fc4fd1986074acbadd3a8e86fcf3968a8dd5c (diff) | |
download | opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.zip opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.gz opie-39fbfd5eb7e45d73d38e8a2ce9437a3d7e1b8e91.tar.bz2 |
new opie-reader sources with support for ArriereGo, Reb input and flite output plugins
Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/StyleConsts.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.h b/noncore/apps/opie-reader/StyleConsts.h index 8e23c6f..4b7ff4b 100644 --- a/noncore/apps/opie-reader/StyleConsts.h +++ b/noncore/apps/opie-reader/StyleConsts.h | |||
@@ -25,58 +25,61 @@ struct pmstore | |||
25 | { | 25 | { |
26 | unsigned int count; | 26 | unsigned int count; |
27 | bool m_isScaleable; | 27 | bool m_isScaleable; |
28 | GraphicLink* graphic; | 28 | GraphicLink* graphic; |
29 | pmstore(bool _canScale, QImage* p, bool isLnk, unsigned long tgt) : count(1), m_isScaleable(_canScale) | 29 | pmstore(bool _canScale, QImage* p, bool isLnk, unsigned long tgt) : count(1), m_isScaleable(_canScale) |
30 | { | 30 | { |
31 | graphic = new GraphicLink(p, isLnk, tgt); | 31 | graphic = new GraphicLink(p, isLnk, tgt); |
32 | } | 32 | } |
33 | ~pmstore(); | 33 | ~pmstore(); |
34 | }; | 34 | }; |
35 | 35 | ||
36 | enum EalignmentType | 36 | enum EalignmentType |
37 | { | 37 | { |
38 | m_AlignLeft, | 38 | m_AlignLeft, |
39 | m_AlignRight, | 39 | m_AlignRight, |
40 | m_AlignCentre, | 40 | m_AlignCentre, |
41 | m_AlignJustify | 41 | m_AlignJustify, |
42 | m_AlignNone | ||
42 | }; | 43 | }; |
43 | 44 | ||
44 | class CBasicStyle | 45 | class CBasicStyle |
45 | { | 46 | { |
46 | friend class CStyle; | 47 | friend class CStyle; |
47 | bool m_bold, | 48 | bool m_bold, |
48 | m_italic; | 49 | m_italic; |
50 | unsigned long m_table; | ||
49 | int m_fontsize; | 51 | int m_fontsize; |
50 | EalignmentType m_align; | 52 | EalignmentType m_align; |
51 | unsigned char red, green, blue; | 53 | unsigned char red, green, blue; |
52 | unsigned char bred, bgreen, bblue; | 54 | unsigned char bred, bgreen, bblue; |
53 | unsigned char pred, pgreen, pblue; | 55 | unsigned char pred, pgreen, pblue; |
54 | unsigned long data; | 56 | unsigned long data; |
55 | unsigned long offset; | 57 | unsigned long offset; |
56 | bool isLink; | 58 | bool isLink; |
57 | // bool isVisited; | 59 | // bool isVisited; |
58 | bool m_underline; | 60 | bool m_underline; |
59 | bool m_strikethru; | 61 | bool m_strikethru; |
60 | bool m_monospaced; | 62 | bool m_monospaced; |
61 | unsigned char m_leftmargin, m_rightmargin; | 63 | unsigned char m_leftmargin, m_rightmargin; |
62 | signed char m_extraspace; | 64 | signed char m_extraspace; |
63 | signed char m_voffset; | 65 | signed char m_voffset; |
64 | CBasicStyle() | 66 | CBasicStyle() |
65 | { | 67 | { |
66 | unset(); | 68 | unset(); |
69 | m_table = 0xffffffff; | ||
67 | } | 70 | } |
68 | bool operator!=(const CBasicStyle& rhs) | 71 | bool operator!=(const CBasicStyle& rhs) |
69 | { | 72 | { |
70 | return (memcmp(this, &rhs, sizeof(CBasicStyle)) != 0); | 73 | return (memcmp(this, &rhs, sizeof(CBasicStyle)) != 0); |
71 | } | 74 | } |
72 | void unset() | 75 | void unset() |
73 | { | 76 | { |
74 | m_bold = false; | 77 | m_bold = false; |
75 | m_italic = false; | 78 | m_italic = false; |
76 | m_fontsize = 0; | 79 | m_fontsize = 0; |
77 | m_align = m_AlignLeft; | 80 | m_align = m_AlignLeft; |
78 | red = green = blue = 0; | 81 | red = green = blue = 0; |
79 | bred = bgreen = bblue = 255; | 82 | bred = bgreen = bblue = 255; |
80 | pred = pgreen = pblue = 255; | 83 | pred = pgreen = pblue = 255; |
81 | data = 0; | 84 | data = 0; |
82 | offset = 0; | 85 | offset = 0; |
@@ -133,32 +136,35 @@ class CStyle | |||
133 | sty.pred = r; | 136 | sty.pred = r; |
134 | sty.pgreen = g; | 137 | sty.pgreen = g; |
135 | sty.pblue = b; | 138 | sty.pblue = b; |
136 | } | 139 | } |
137 | void setBackground(unsigned char r, unsigned char g, unsigned char b) | 140 | void setBackground(unsigned char r, unsigned char g, unsigned char b) |
138 | { | 141 | { |
139 | sty.bred = r; | 142 | sty.bred = r; |
140 | sty.bgreen = g; | 143 | sty.bgreen = g; |
141 | sty.bblue = b; | 144 | sty.bblue = b; |
142 | } | 145 | } |
143 | CStyle() : graphic(NULL) {} | 146 | CStyle() : graphic(NULL) {} |
144 | ~CStyle(); | 147 | ~CStyle(); |
145 | // CStyle(CStyle&); | 148 | // CStyle(CStyle&); |
146 | CStyle(const CStyle&); | 149 | CStyle(const CStyle&); |
147 | CStyle& operator=(const CStyle&); | 150 | CStyle& operator=(const CStyle&); |
148 | void unset(); | 151 | void unset(); |
152 | bool isTable() const { return (sty.m_table != 0xffffffff); } | ||
153 | void setTable(unsigned long _b) { sty.m_table = _b; } | ||
154 | unsigned long getTable() { return sty.m_table; } | ||
149 | bool isPicture() const { return (graphic != NULL); } | 155 | bool isPicture() const { return (graphic != NULL); } |
150 | bool canScale() const { return graphic->m_isScaleable; } | 156 | bool canScale() const { return graphic->m_isScaleable; } |
151 | void clearPicture(); | 157 | void clearPicture(); |
152 | void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0); | 158 | void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0); |
153 | QImage* getPicture() | 159 | QImage* getPicture() |
154 | { | 160 | { |
155 | QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL); | 161 | QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL); |
156 | return pm; | 162 | return pm; |
157 | } | 163 | } |
158 | void setUnderline() { sty.m_underline = true; } | 164 | void setUnderline() { sty.m_underline = true; } |
159 | void unsetUnderline() { sty.m_underline = false; } | 165 | void unsetUnderline() { sty.m_underline = false; } |
160 | bool isUnderline() { return sty.m_underline; } | 166 | bool isUnderline() { return sty.m_underline; } |
161 | void setStrikethru() { sty.m_strikethru = true; } | 167 | void setStrikethru() { sty.m_strikethru = true; } |
162 | void unsetStrikethru() { sty.m_strikethru = false; } | 168 | void unsetStrikethru() { sty.m_strikethru = false; } |
163 | bool isStrikethru() { return sty.m_strikethru; } | 169 | bool isStrikethru() { return sty.m_strikethru; } |
164 | void setBold() { sty.m_bold = true; } | 170 | void setBold() { sty.m_bold = true; } |
@@ -174,32 +180,36 @@ class CStyle | |||
174 | void setLeftJustify() | 180 | void setLeftJustify() |
175 | { | 181 | { |
176 | sty.m_align = m_AlignLeft; | 182 | sty.m_align = m_AlignLeft; |
177 | } | 183 | } |
178 | void setRightJustify() | 184 | void setRightJustify() |
179 | { | 185 | { |
180 | sty.m_align = m_AlignRight; | 186 | sty.m_align = m_AlignRight; |
181 | } | 187 | } |
182 | void setCentreJustify() | 188 | void setCentreJustify() |
183 | { | 189 | { |
184 | sty.m_align = m_AlignCentre; | 190 | sty.m_align = m_AlignCentre; |
185 | } | 191 | } |
186 | void setFullJustify() | 192 | void setFullJustify() |
187 | { | 193 | { |
188 | sty.m_align = m_AlignJustify; | 194 | sty.m_align = m_AlignJustify; |
189 | } | 195 | } |
196 | void setNoJustify() | ||
197 | { | ||
198 | sty.m_align = m_AlignNone; | ||
199 | } | ||
190 | StyleType getJustify() | 200 | StyleType getJustify() |
191 | { | 201 | { |
192 | return sty.m_align; | 202 | return sty.m_align; |
193 | } | 203 | } |
194 | 204 | ||
195 | void setFontSize(int _fs) | 205 | void setFontSize(int _fs) |
196 | { | 206 | { |
197 | sty.m_fontsize = _fs; | 207 | sty.m_fontsize = _fs; |
198 | } | 208 | } |
199 | int getFontSize() const | 209 | int getFontSize() const |
200 | { | 210 | { |
201 | return sty.m_fontsize; | 211 | return sty.m_fontsize; |
202 | } | 212 | } |
203 | bool operator!=(const CStyle& rhs) | 213 | bool operator!=(const CStyle& rhs) |
204 | { | 214 | { |
205 | return | 215 | return |