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.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.h b/noncore/apps/opie-reader/StyleConsts.h
index 9701d19..29d7501 100644
--- a/noncore/apps/opie-reader/StyleConsts.h
+++ b/noncore/apps/opie-reader/StyleConsts.h
@@ -3,17 +3,19 @@
3 3
4typedef unsigned short StyleType; 4typedef unsigned short StyleType;
5 5
6#include <stdlib.h> 6#ifdef _WINDOWS
7#include <string.h> 7#include <string.h>
8#endif
9#include <stdlib.h>
8#include <qglobal.h> 10#include <qglobal.h>
9class QPixmap; 11class QImage;
10 12
11struct GraphicLink 13struct GraphicLink
12{ 14{
13 QPixmap* graphic; 15 QImage* graphic;
14 bool isLink; 16 bool isLink;
15 unsigned long link; 17 unsigned long link;
16 GraphicLink(QPixmap* p, bool isLnk, unsigned long tgt) : 18 GraphicLink(QImage* p, bool isLnk, unsigned long tgt) :
17 graphic(p), isLink(isLnk), link(tgt) {} 19 graphic(p), isLink(isLnk), link(tgt) {}
18 ~GraphicLink(); 20 ~GraphicLink();
19}; 21};
@@ -21,8 +23,9 @@ struct GraphicLink
21struct pmstore 23struct pmstore
22{ 24{
23 unsigned int count; 25 unsigned int count;
26 bool m_isScaleable;
24 GraphicLink* graphic; 27 GraphicLink* graphic;
25 pmstore(QPixmap* p, bool isLnk, unsigned long tgt) : count(1) 28 pmstore(bool _canScale, QImage* p, bool isLnk, unsigned long tgt) : count(1), m_isScaleable(_canScale)
26 { 29 {
27 graphic = new GraphicLink(p, isLnk, tgt); 30 graphic = new GraphicLink(p, isLnk, tgt);
28 } 31 }
@@ -51,6 +54,8 @@ class CBasicStyle
51 bool m_strikethru; 54 bool m_strikethru;
52 bool m_monospaced; 55 bool m_monospaced;
53 unsigned char m_leftmargin, m_rightmargin; 56 unsigned char m_leftmargin, m_rightmargin;
57 signed char m_extraspace;
58 signed char m_voffset;
54 CBasicStyle() 59 CBasicStyle()
55 { 60 {
56 unset(); 61 unset();
@@ -73,6 +78,8 @@ class CBasicStyle
73 m_leftmargin = 0; 78 m_leftmargin = 0;
74 m_rightmargin = 0; 79 m_rightmargin = 0;
75 m_monospaced = false; 80 m_monospaced = false;
81 m_extraspace = 0;
82 m_voffset = 0;
76 } 83 }
77}; 84};
78 85
@@ -81,6 +88,10 @@ class CStyle
81 CBasicStyle sty; 88 CBasicStyle sty;
82 pmstore* graphic; 89 pmstore* graphic;
83 public: 90 public:
91 signed char getVOffset() { return sty.m_voffset; }
92 void setVOffset(signed char sp) { sty.m_voffset = sp; }
93 signed char getExtraSpace() { return sty.m_extraspace; }
94 void setExtraSpace(signed char sp) { sty.m_extraspace = sp; }
84 bool getPictureLink() 95 bool getPictureLink()
85 { 96 {
86 return (graphic != NULL && graphic->graphic->isLink); 97 return (graphic != NULL && graphic->graphic->isLink);
@@ -104,16 +115,17 @@ class CStyle
104 } 115 }
105 CStyle() : graphic(NULL) {} 116 CStyle() : graphic(NULL) {}
106 ~CStyle(); 117 ~CStyle();
107 CStyle(CStyle&); 118// CStyle(CStyle&);
108 CStyle(const CStyle&); 119 CStyle(const CStyle&);
109 CStyle& operator=(const CStyle&); 120 CStyle& operator=(const CStyle&);
110 void unset(); 121 void unset();
111 bool isPicture() { return (graphic != NULL); } 122 bool isPicture() { return (graphic != NULL); }
123 bool canScale() { return graphic->m_isScaleable; }
112 void clearPicture(); 124 void clearPicture();
113 void setPicture(QPixmap* _g, bool il=false, unsigned long tgt=0); 125 void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0);
114 QPixmap* getPicture() 126 QImage* getPicture()
115 { 127 {
116 QPixmap* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL); 128 QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL);
117 return pm; 129 return pm;
118 } 130 }
119 void setUnderline() { sty.m_underline = true; } 131 void setUnderline() { sty.m_underline = true; }
@@ -157,7 +169,7 @@ class CStyle
157 { 169 {
158 sty.m_fontsize = _fs; 170 sty.m_fontsize = _fs;
159 } 171 }
160 int getFontSize() 172 int getFontSize() const
161 { 173 {
162 return sty.m_fontsize; 174 return sty.m_fontsize;
163 } 175 }