2
Copyright (c) 2000,2001,2003 Cornelius Schumacher <schumacher@kde.org>
3
Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
4
Copyright (c) 2007 Bruno Virlet <bruno@virlet.org>
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License along
17
with this program; if not, write to the Free Software Foundation, Inc.,
18
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
As a special exception, permission is given to link this program
21
with any edition of Qt, and distribute the resulting executable,
22
without including the source code for Qt in the source distribution.
24
#ifndef EVENTVIEWS_TIMELABELS_H
25
#define EVENTVIEWS_TIMELABELS_H
27
#include "eventviews_export.h"
33
#include <boost/shared_ptr.hpp>
35
namespace EventViews {
41
typedef boost::shared_ptr<Prefs> PrefsPtr;
43
class EVENTVIEWS_EXPORT TimeLabels : public QFrame
47
typedef QList<TimeLabels *> List;
49
TimeLabels( const KDateTime::Spec &spec, int rows,
50
TimeLabelsZone *parent = 0, Qt::WFlags f = 0 );
52
/** updates widget's internal state */
56
void setAgenda( Agenda *agenda );
59
virtual void paintEvent( QPaintEvent *e );
62
virtual void contextMenuEvent( QContextMenuEvent *event );
64
/** Returns time spec of this label */
65
KDateTime::Spec timeSpec();
68
Return string which can be used as a header for the time label.
70
QString header() const;
73
Return string which can be used as a tool tip for the header.
75
QString headerToolTip() const;
77
QSize sizeHint() const;
79
QSize minimumSizeHint() const;
82
/** update the position of the marker showing the mouse position */
83
void mousePosChanged( const QPoint &pos );
88
void setCellHeight( double height );
92
KDateTime::Spec mSpec;
97
TimeLabelsZone *mTimeLabelsZone;
99
QFrame *mMousePos; // shows a marker for the current mouse position in y direction