2
Copyright (c) 2007 Bruno Virlet <bruno@virlet.org>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
As a special exception, permission is given to link this program
19
with any edition of Qt, and distribute the resulting executable,
20
without including the source code for Qt in the source distribution.
22
#ifndef EVENTVIEWS_TIMELABELSZONE_H
23
#define EVENTVIEWS_TIMELABELSZONE_H
25
#include "eventviews_export.h"
31
#include <boost/shared_ptr.hpp>
36
namespace EventViews {
42
typedef boost::shared_ptr<Prefs> PrefsPtr;
44
class EVENTVIEWS_EXPORT TimeLabelsZone : public QWidget
48
explicit TimeLabelsZone( QWidget *parent, const PrefsPtr &preferences, Agenda *agenda = 0 );
50
/** Add a new time label with the given spec.
51
If spec is not valid, use the display timespec.
53
void addTimeLabels( const KDateTime::Spec &spec );
56
Returns the best width for each TimeLabels widget
58
int preferedTimeLabelsWidth() const;
63
void setAgendaView( AgendaView *agenda );
65
QList<QScrollArea*> timeLabels() const;
67
void setPreferences( const PrefsPtr &prefs );
68
PrefsPtr preferences() const;
70
/** Checks how much agenda is scrolled relative to it's QScrollArea
71
and makes each TimeLabels scroll that amount
73
void updateTimeLabelsPosition();
76
void setupTimeLabel( QScrollArea *area );
81
QHBoxLayout *mTimeLabelsLayout;
82
QList<QScrollArea*> mTimeLabelsList;