summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/StyleConsts.h
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.h') (more/less context) (show 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
@@ -1,31 +1,34 @@
#ifndef __STYLECONSTS_H
#define __STYLECONSTS_H
typedef unsigned short StyleType;
-#include <stdlib.h>
+#ifdef _WINDOWS
#include <string.h>
+#endif
+#include <stdlib.h>
#include <qglobal.h>
-class QPixmap;
+class QImage;
struct GraphicLink
{
- QPixmap* graphic;
+ QImage* graphic;
bool isLink;
unsigned long link;
- GraphicLink(QPixmap* p, bool isLnk, unsigned long tgt) :
+ GraphicLink(QImage* p, bool isLnk, unsigned long tgt) :
graphic(p), isLink(isLnk), link(tgt) {}
~GraphicLink();
};
struct pmstore
{
unsigned int count;
+ bool m_isScaleable;
GraphicLink* graphic;
- pmstore(QPixmap* p, bool isLnk, unsigned long tgt) : count(1)
+ pmstore(bool _canScale, QImage* p, bool isLnk, unsigned long tgt) : count(1), m_isScaleable(_canScale)
{
graphic = new GraphicLink(p, isLnk, tgt);
}
~pmstore();
};
@@ -48,12 +51,14 @@ class CBasicStyle
unsigned long data;
bool isLink;
bool m_underline;
bool m_strikethru;
bool m_monospaced;
unsigned char m_leftmargin, m_rightmargin;
+ signed char m_extraspace;
+ signed char m_voffset;
CBasicStyle()
{
unset();
}
bool operator!=(const CBasicStyle& rhs)
{
@@ -70,20 +75,26 @@ class CBasicStyle
isLink = false;
m_underline = false;
m_strikethru = false;
m_leftmargin = 0;
m_rightmargin = 0;
m_monospaced = false;
+ m_extraspace = 0;
+ m_voffset = 0;
}
};
class CStyle
{
CBasicStyle sty;
pmstore* graphic;
public:
+ signed char getVOffset() { return sty.m_voffset; }
+ void setVOffset(signed char sp) { sty.m_voffset = sp; }
+ signed char getExtraSpace() { return sty.m_extraspace; }
+ void setExtraSpace(signed char sp) { sty.m_extraspace = sp; }
bool getPictureLink()
{
return (graphic != NULL && graphic->graphic->isLink);
}
unsigned long getPictureLinkData()
{
@@ -101,22 +112,23 @@ class CStyle
sty.red = r;
sty.green = g;
sty.blue = b;
}
CStyle() : graphic(NULL) {}
~CStyle();
- CStyle(CStyle&);
+// CStyle(CStyle&);
CStyle(const CStyle&);
CStyle& operator=(const CStyle&);
void unset();
bool isPicture() { return (graphic != NULL); }
+ bool canScale() { return graphic->m_isScaleable; }
void clearPicture();
- void setPicture(QPixmap* _g, bool il=false, unsigned long tgt=0);
- QPixmap* getPicture()
+ void setPicture(bool canScale, QImage* _g, bool il=false, unsigned long tgt=0);
+ QImage* getPicture()
{
- QPixmap* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL);
+ QImage* pm = ((graphic != NULL) ? graphic->graphic->graphic : NULL);
return pm;
}
void setUnderline() { sty.m_underline = true; }
void unsetUnderline() { sty.m_underline = false; }
bool isUnderline() { return sty.m_underline; }
void setStrikethru() { sty.m_strikethru = true; }
@@ -154,13 +166,13 @@ class CStyle
}
void setFontSize(int _fs)
{
sty.m_fontsize = _fs;
}
- int getFontSize()
+ int getFontSize() const
{
return sty.m_fontsize;
}
bool operator!=(const CStyle& rhs)
{
return