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/StyleConsts.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/StyleConsts.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/StyleConsts.h | 40 |
1 files changed, 37 insertions, 3 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 | |||
@@ -2,8 +2,11 @@ | |||
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; |
@@ -41,14 +44,18 @@ enum EalignmentType | |||
41 | class CBasicStyle | 44 | class CBasicStyle |
42 | { | 45 | { |
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; |
@@ -68,10 +75,14 @@ class CBasicStyle | |||
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; |
@@ -110,16 +121,34 @@ class CStyle | |||
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 | { |
@@ -180,9 +209,14 @@ class CStyle | |||
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 |