summaryrefslogtreecommitdiffabout
path: root/korganizer/timeline.h
blob: ab3e5d3e28924c09a1a42a73f7014fee858d92d6 (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 <qscrollview.h>
#include <qdatetime.h>

class TimeLine : public QScrollView
{
    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