summaryrefslogtreecommitdiffabout
path: root/korganizer/timeline.h
blob: bf301fa8710db4a6a20f0bf48ca2d77e0523ebb1 (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
#ifndef TIMELINE_H
#define TIMELINE_H

#include <q3scrollview.h>
#include <qdatetime.h>

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

    void setDateRange( const QDateTime &start, const QDateTime &end );
    
  public slots:
    void setContentsPos( int pos );
    
  protected:
    void drawContents(QPainter* p, int cx, int cy, int cw, int ch);

  private:
    QDateTime mStartDate;
    QDateTime mEndDate;

    int mPixelWidth;
    int mDaySpacing;
    int mDayOffset;
    int mSecsPerPixel;
};

#endif