summaryrefslogtreecommitdiffabout
path: root/korganizer/lineview.h
blob: 52ae9cf01ed0f5611fac990b82a107f8abd0f136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LINEVIEW_H
#define LINEVIEW_H

#include <q3scrollview.h>
#include <q3ptrlist.h>

class LineView : public Q3ScrollView
{
    Q_OBJECT
  public:
    LineView( QWidget *parent = 0, const char *name = 0 );
    virtual ~LineView();

    int pixelWidth();
    
    void addLine( int start, int end );

    void clear();

  protected:
    void drawContents(QPainter* p, int cx, int cy, int cw, int ch);

  private:
    struct Line {
      Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {}
      int column;
      int start;
      int end;
    };

    Q3PtrList<Line> mLines;
    int mPixelWidth;
};

#endif