-rw-r--r-- | korganizer/lineview.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/korganizer/lineview.h b/korganizer/lineview.h new file mode 100644 index 0000000..aa34dbc --- a/dev/null +++ b/korganizer/lineview.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef LINEVIEW_H | ||
2 | #define LINEVIEW_H | ||
3 | |||
4 | #include <qscrollview.h> | ||
5 | #include <qptrlist.h> | ||
6 | |||
7 | class LineView : public QScrollView | ||
8 | { | ||
9 | Q_OBJECT | ||
10 | public: | ||
11 | LineView( QWidget *parent = 0, const char *name = 0 ); | ||
12 | virtual ~LineView(); | ||
13 | |||
14 | int pixelWidth(); | ||
15 | |||
16 | void addLine( int start, int end ); | ||
17 | |||
18 | void clear(); | ||
19 | |||
20 | protected: | ||
21 | void drawContents(QPainter* p, int cx, int cy, int cw, int ch); | ||
22 | |||
23 | private: | ||
24 | struct Line { | ||
25 | Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {} | ||
26 | int column; | ||
27 | int start; | ||
28 | int end; | ||
29 | }; | ||
30 | |||
31 | QPtrList<Line> mLines; | ||
32 | int mPixelWidth; | ||
33 | }; | ||
34 | |||
35 | #endif | ||
36 | |||