Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/StyleConsts.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.h b/noncore/apps/opie-reader/StyleConsts.h index 5817b54..8e23c6f 100644 --- a/noncore/apps/opie-reader/StyleConsts.h +++ b/noncore/apps/opie-reader/StyleConsts.h | |||
@@ -1,11 +1,14 @@ | |||
1 | #ifndef __STYLECONSTS_H | 1 | #ifndef __STYLECONSTS_H |
2 | #define __STYLECONSTS_H | 2 | #define __STYLECONSTS_H |
3 | 3 | ||
4 | typedef unsigned short StyleType; | 4 | typedef unsigned short StyleType; |
5 | 5 | ||
6 | #ifdef _WINDOWS | ||
7 | #include <string.h> | ||
8 | #endif | ||
6 | #include <string.h> | 9 | #include <string.h> |
7 | #include <stdlib.h> | 10 | #include <stdlib.h> |
8 | #include <qglobal.h> | 11 | #include <qglobal.h> |
9 | class QImage; | 12 | class QImage; |
10 | 13 | ||
11 | struct GraphicLink | 14 | struct GraphicLink |
@@ -43,14 +46,18 @@ class CBasicStyle | |||
43 | friend class CStyle; | 46 | friend class CStyle; |
44 | bool m_bold, | 47 | bool m_bold, |
45 | m_italic; | 48 | m_italic; |
46 | int m_fontsize; | 49 | int m_fontsize; |
47 | EalignmentType m_align; | 50 | EalignmentType m_align; |
48 | unsigned char red, green, blue; | 51 | unsigned char red, green, blue; |
52 | unsigned char bred, bgreen, bblue; | ||
53 | unsigned char pred, pgreen, pblue; | ||
49 | unsigned long data; | 54 | unsigned long data; |
55 | unsigned long offset; | ||
50 | bool isLink; | 56 | bool isLink; |
57 | // bool isVisited; | ||
51 | bool m_underline; | 58 | bool m_underline; |
52 | bool m_strikethru; | 59 | bool m_strikethru; |
53 | bool m_monospaced; | 60 | bool m_monospaced; |
54 | unsigned char m_leftmargin, m_rightmargin; | 61 | unsigned char m_leftmargin, m_rightmargin; |
55 | signed char m_extraspace; | 62 | signed char m_extraspace; |
56 | signed char m_voffset; | 63 | signed char m_voffset; |
@@ -66,14 +73,18 @@ class CBasicStyle | |||
66 | { | 73 | { |
67 | m_bold = false; | 74 | m_bold = false; |
68 | m_italic = false; | 75 | m_italic = false; |
69 | m_fontsize = 0; | 76 | m_fontsize = 0; |
70 | m_align = m_AlignLeft; | 77 | m_align = m_AlignLeft; |
71 | red = green = blue = 0; | 78 | red = green = blue = 0; |
79 | bred = bgreen = bblue = 255; | ||
80 | pred = pgreen = pblue = 255; | ||
72 | data = 0; | 81 | data = 0; |
82 | offset = 0; | ||
73 | isLink = false; | 83 | isLink = false; |
84 | // isVisited = false; | ||
74 | m_underline = false; | 85 | m_underline = false; |
75 | m_strikethru = false; | 86 | m_strikethru = false; |
76 | m_leftmargin = 0; | 87 | m_leftmargin = 0; |
77 | m_rightmargin = 0; | 88 | m_rightmargin = 0; |
78 | m_monospaced = false; | 89 | m_monospaced = false; |
79 | m_extraspace = 0; | 90 | m_extraspace = 0; |
@@ -108,20 +119,38 @@ class CStyle | |||
108 | void setColour(unsigned char r, unsigned char g, unsigned char b) | 119 | void setColour(unsigned char r, unsigned char g, unsigned char b) |
109 | { | 120 | { |
110 | sty.red = r; | 121 | sty.red = r; |
111 | sty.green = g; | 122 | sty.green = g; |
112 | sty.blue = b; | 123 | sty.blue = b; |
113 | } | 124 | } |
125 | unsigned char bRed() { return sty.bred; } | ||
126 | unsigned char bGreen() { return sty.bgreen; } | ||
127 | unsigned char bBlue() { return sty.bblue; } | ||
128 | unsigned char pRed() { return sty.pred; } | ||
129 | unsigned char pGreen() { return sty.pgreen; } | ||
130 | unsigned char pBlue() { return sty.pblue; } | ||
131 | void setPaper(unsigned char r, unsigned char g, unsigned char b) | ||
132 | { | ||
133 | sty.pred = r; | ||
134 | sty.pgreen = g; | ||
135 | sty.pblue = b; | ||
136 | } | ||
137 | void setBackground(unsigned char r, unsigned char g, unsigned char b) | ||
138 | { | ||
139 | sty.bred = r; | ||
140 | sty.bgreen = g; | ||
141 | sty.bblue = b; | ||
142 | } | ||
114 | CStyle() : graphic(NULL) {} | 143 | CStyle() : graphic(NULL) {} |
115 | ~CStyle(); | 144 | ~CStyle(); |
116 | // CStyle(CStyle&); | 145 | // CStyle(CStyle&); |
117 | CStyle(const CStyle&); | 146 | CStyle(const CStyle&); |
118 | CStyle& operator=(const CStyle&); | 147 | CStyle& operator=(const CStyle&); |
119 | void unset(); | 148 | void unset(); |
120 | bool isPicture() { return (graphic != NULL); } | 149 | bool isPicture() const { return (graphic != NULL); } |
121 | bool canScale() { return graphic->m_isScaleable; } | 150 | bool canScale() const { return graphic->m_isScaleable; } |
122 | void clearPicture(); | 151 | void clearPicture(); |
123 | void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0); | 152 | void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0); |
124 | QImage* getPicture() | 153 | QImage* getPicture() |
125 | { | 154 | { |
126 | QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL); | 155 | QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL); |
127 | return pm; | 156 | return pm; |
@@ -178,11 +207,16 @@ class CStyle | |||
178 | (sty != rhs.sty) || | 207 | (sty != rhs.sty) || |
179 | (graphic != rhs.graphic) | 208 | (graphic != rhs.graphic) |
180 | ); | 209 | ); |
181 | } | 210 | } |
182 | void setLink(bool _l) { sty.isLink = _l; } | 211 | void setLink(bool _l) { sty.isLink = _l; } |
183 | bool getLink() { return sty.isLink; } | 212 | bool getLink() { return sty.isLink; } |
213 | // void setVisited(bool _l) { sty.isVisited = _l; } | ||
214 | // bool getVisited() { return sty.isVisited; } | ||
184 | void setData(unsigned long _d) { sty.data = _d; } | 215 | void setData(unsigned long _d) { sty.data = _d; } |
185 | unsigned long getData() { return sty.data; } | 216 | unsigned long getData() { return sty.data; } |
217 | void setOffset(unsigned long _d) { sty.offset = _d; } | ||
218 | unsigned long getOffset() { return sty.offset; } | ||
219 | void invert(); | ||
186 | }; | 220 | }; |
187 | 221 | ||
188 | #endif | 222 | #endif |