summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/StyleConsts.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.h b/noncore/apps/opie-reader/StyleConsts.h
index 5aacdf0..9701d19 100644
--- a/noncore/apps/opie-reader/StyleConsts.h
+++ b/noncore/apps/opie-reader/StyleConsts.h
@@ -1,102 +1,103 @@
#ifndef __STYLECONSTS_H
#define __STYLECONSTS_H
typedef unsigned short StyleType;
#include <stdlib.h>
+#include <string.h>
#include <qglobal.h>
class QPixmap;
struct GraphicLink
{
QPixmap* graphic;
bool isLink;
unsigned long link;
GraphicLink(QPixmap* p, bool isLnk, unsigned long tgt) :
graphic(p), isLink(isLnk), link(tgt) {}
~GraphicLink();
};
struct pmstore
{
unsigned int count;
GraphicLink* graphic;
pmstore(QPixmap* p, bool isLnk, unsigned long tgt) : count(1)
{
graphic = new GraphicLink(p, isLnk, tgt);
}
~pmstore();
};
enum EalignmentType
{
m_AlignLeft,
m_AlignRight,
m_AlignCentre,
m_AlignJustify
};
class CBasicStyle
{
friend class CStyle;
bool m_bold,
m_italic;
int m_fontsize;
EalignmentType m_align;
unsigned char red, green, blue;
unsigned long data;
bool isLink;
bool m_underline;
bool m_strikethru;
bool m_monospaced;
unsigned char m_leftmargin, m_rightmargin;
CBasicStyle()
{
unset();
}
bool operator!=(const CBasicStyle& rhs)
{
return (memcmp(this, &rhs, sizeof(CBasicStyle)) != 0);
}
void unset()
{
m_bold = false;
m_italic = false;
m_fontsize = 0;
m_align = m_AlignLeft;
red = green = blue = 0;
data = 0;
isLink = false;
m_underline = false;
m_strikethru = false;
m_leftmargin = 0;
m_rightmargin = 0;
m_monospaced = false;
}
};
class CStyle
{
CBasicStyle sty;
pmstore* graphic;
public:
bool getPictureLink()
{
return (graphic != NULL && graphic->graphic->isLink);
}
unsigned long getPictureLinkData()
{
return graphic->graphic->link;
}
void setLeftMargin(unsigned char m) { sty.m_leftmargin = m; }
unsigned char getLeftMargin() { return sty.m_leftmargin; }
void setRightMargin(unsigned char m) { sty.m_rightmargin = m; }
unsigned char getRightMargin() { return sty.m_rightmargin; }
unsigned char Red() { return sty.red; }
unsigned char Green() { return sty.green; }
unsigned char Blue() { return sty.blue; }
void setColour(unsigned char r, unsigned char g, unsigned char b)
{
sty.red = r;
sty.green = g;
sty.blue = b;