korganizer

timelabels.h
1/*
2 This file is part of KOrganizer.
3
4 Copyright (c) 2000,2001,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21 As a special exception, permission is given to link this program
22 with any edition of TQt, and distribute the resulting executable,
23 without including the source code for TQt in the source distribution.
24*/
25#ifndef TIMELABELS_H
26#define TIMELABELS_H
27
28#include <tqscrollview.h>
29#include <tqlabel.h>
30
31class TQHBox;
32class TQPushButton;
33class TQBoxLayout;
34
35class KOAgenda;
36class KOAgendaItem;
37class TDEConfig;
38
39class TimeLabels : public TQScrollView
40{
41 TQ_OBJECT
42
43 public:
44 TimeLabels( int rows, TQWidget *parent = 0, const char *name = 0,
45 WFlags f = 0 );
46
48 virtual int minimumWidth() const;
49
51 void updateConfig();
52
54 void setAgenda( KOAgenda *agenda );
55
57 virtual void paintEvent( TQPaintEvent *e );
58
59 public slots:
61 void positionChanged();
62 void positionChanged( int pos );
63
64 protected:
65 void drawContents( TQPainter *p, int cx, int cy, int cw, int ch );
66
67 private slots:
69 void mousePosChanged(const TQPoint &pos);
70
71 void showMousePos();
72 void hideMousePos();
73
74 void setCellHeight( double height );
75
76 private:
77 int mRows;
78 double mCellHeight;
79 int mMiniWidth;
80 KOAgenda* mAgenda;
81
82 TQFrame *mMousePos; // shows a marker for the current mouse position in y direction
83};
84
85#endif