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.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h
index 4d3696e..0d8968c 100644
--- a/noncore/apps/opie-reader/CDrawBuffer.h
+++ b/noncore/apps/opie-reader/CDrawBuffer.h
@@ -4,56 +4,73 @@
4#include "StyleConsts.h" 4#include "StyleConsts.h"
5#include "CBuffer.h" 5#include "CBuffer.h"
6#include "my_list.h" 6#include "my_list.h"
7 7
8class QPainter; 8class QPainter;
9 9
10enum linkType
11{
12 eNone,
13 eLink,
14 ePicture
15};
16
10struct textsegment 17struct textsegment
11{ 18{
12 int start; 19 int start;
13 CStyle style; 20 CStyle style;
14 textsegment(int _start, CStyle _style) 21 textsegment(int _start, const CStyle& _style)
15 : 22 :
16 start(_start), style(_style) 23 start(_start), style(_style)
17 {} 24 {}
18}; 25};
19 26
20class FontControl; 27class FontControl;
21 28
22class CDrawBuffer : public CBuffer 29class CDrawBuffer : public CBuffer
23{ 30{
24 CList<textsegment> segs; 31 CList<textsegment> segs;
25 int len; 32 int len;
26 FontControl* fc; 33 FontControl* fc;
27 int m_maxstyle, m_ascent, m_descent, m_lineSpacing; 34 int m_maxstyle, m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing;
35 bool m_bEof;
36 CDrawBuffer(const CDrawBuffer&);
37 CDrawBuffer& operator=(const tchar*sztmp);
28 public: 38 public:
39 int leftMargin();
40 int rightMargin();
41 void setEof() { m_bEof = true; }
42 bool eof() { return m_bEof; }
43 CDrawBuffer& operator=(CDrawBuffer&);
29 CDrawBuffer(FontControl* _fs = NULL) 44 CDrawBuffer(FontControl* _fs = NULL)
30 : 45 :
31 fc(_fs) 46 fc(_fs)
32 { 47 {
33 empty(); 48 empty();
34 } 49 }
50 ~CDrawBuffer();
35/* 51/*
36 CDrawBuffer() 52 CDrawBuffer()
37 : 53 :
38 size(0) 54 size(0)
39 { 55 {
40 empty(); 56 empty();
41 } 57 }
42*/ 58*/
43 int width(int numchars = -1); 59 int width(int numchars = -1);
60 int offset(int);
44 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw); 61 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw);
45 CDrawBuffer& operator=(const tchar*sztmp);
46 CDrawBuffer& operator=(CDrawBuffer&);
47 void empty(); 62 void empty();
48 void addch(tchar ch, CStyle _style); 63 void addch(tchar ch, CStyle _style);
49 void truncate(int); 64 void truncate(int);
50 void setright(CDrawBuffer&, int); 65 void setright(CDrawBuffer&, int);
51 CStyle laststyle(); 66 CStyle laststyle();
52 int ascent() { return m_ascent; } 67 int ascent() { return m_ascent; }
53 int descent() { return m_descent; } 68 int descent() { return m_descent; }
54 int lineSpacing() { return m_lineSpacing; } 69 int lineSpacing() { return m_lineSpacing; }
70 int lineExtraSpacing() { return m_lineExtraSpacing; }
55 71
56// void frig(); 72// void frig();
57 bool isLink(int numchars, size_t& tgt); 73 linkType getLinkType(int numchars, size_t& tgt);
74 void resize();
58}; 75};
59#endif 76#endif