summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/StyleConsts.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/StyleConsts.h12
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
@@ -29,50 +29,53 @@ struct pmstore
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
36enum EalignmentType 36enum 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
44class CBasicStyle 45class 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;
@@ -137,24 +140,27 @@ class CStyle
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; }
@@ -178,24 +184,28 @@ class CStyle
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;