summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CDrawBuffer.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CDrawBuffer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h
index 9ec0ed9..2625a72 100644
--- a/noncore/apps/opie-reader/CDrawBuffer.h
+++ b/noncore/apps/opie-reader/CDrawBuffer.h
@@ -1,12 +1,14 @@
1#ifndef __CDRAWBUFFER_H 1#ifndef __CDRAWBUFFER_H
2#define __CDRAWBUFFER_H 2#define __CDRAWBUFFER_H
3 3
4#include <qcolor.h>
4#include "StyleConsts.h" 5#include "StyleConsts.h"
5#include "CBuffer.h" 6#include "CBuffer.h"
6#include "my_list.h" 7#include "my_list.h"
7#include "linktype.h" 8#include "linktype.h"
8 9
9class QPainter; 10class QPainter;
11class QImage;
10 12
11struct textsegment 13struct textsegment
12{ 14{
@@ -22,17 +24,23 @@ class FontControl;
22 24
23class CDrawBuffer : public CBuffer 25class CDrawBuffer : public CBuffer
24{ 26{
27 bool m_hastext;
25 CList<textsegment> segs; 28 CList<textsegment> segs;
26 int len; 29 int len;
27 FontControl* fc; 30 FontControl* fc;
28 int m_maxstyle, m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing; 31 int m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing;
29 bool m_bEof; 32 bool m_bEof, m_bBop;
30 bool m_bSop, m_bEop; 33 bool m_bSop, m_bEop;
34 bool m_showPartial;
31 CDrawBuffer(const CDrawBuffer&); 35 CDrawBuffer(const CDrawBuffer&);
32 CDrawBuffer& operator=(const tchar*sztmp); 36 CDrawBuffer& operator=(const tchar*sztmp);
37 void Highlight(QPainter*_p, bool drawBackground, int _x, int _y, int w, QColor bgColour);
33 public: 38 public:
34 void setstartpara() { m_bSop = true; } 39 void setstartpara() { m_bSop = true; }
40 void setBop() { m_bBop = true; }
41 bool isBop() { return m_bBop; }
35 void setendpara() { m_bEop = true; } 42 void setendpara() { m_bEop = true; }
43 void setendpara(const CStyle& cs);
36 int leftMargin(); 44 int leftMargin();
37 int rightMargin(); 45 int rightMargin();
38 void setEof() { m_bEof = true; } 46 void setEof() { m_bEof = true; }
@@ -53,13 +61,16 @@ class CDrawBuffer : public CBuffer
53 empty(); 61 empty();
54 } 62 }
55*/ 63*/
56 int width(int numchars = -1, bool onscreen = false, int scwidth = 0, unsigned char _border = 0); 64 int charwidth(int numchars, CStyle& currentstyle);
57 int offset(int, unsigned char); 65 int charwidth(int numchars);
58 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw, unsigned char); 66 int width(int availht, int numchars = -1, bool onscreen = false, int scwidth = 0, unsigned short _lborder = 0, unsigned short _rborder = 0);
67 int offset(int, unsigned short, unsigned short, int);
68 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw, unsigned short, unsigned short, const QColor&, int availht);
59 void empty(); 69 void empty();
60 void addch(tchar ch, CStyle _style); 70 void addch(tchar ch, CStyle _style);
61 void truncate(int); 71 void truncate(int);
62 void setright(CDrawBuffer&, int); 72 void setright(CDrawBuffer&, int);
73 CStyle firststyle();
63 CStyle laststyle(); 74 CStyle laststyle();
64 int ascent() { return m_ascent; } 75 int ascent() { return m_ascent; }
65 int descent() { return m_descent; } 76 int descent() { return m_descent; }
@@ -67,7 +78,10 @@ class CDrawBuffer : public CBuffer
67 int lineExtraSpacing() { return m_lineExtraSpacing; } 78 int lineExtraSpacing() { return m_lineExtraSpacing; }
68 79
69// void frig(); 80// void frig();
70 linkType getLinkType(int numchars, size_t& tgt); 81 linkType getLinkType(int numchars, size_t& tgt, size_t& offset, size_t& pictgt, QImage*&);
71 void resize(); 82 void resize(int);
83 bool showPartial() { return m_showPartial; }
84 CStyle* getNextLink(int&);
85 int invertLink(int);
72}; 86};
73#endif 87#endif