~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to calendarviews/eventviews/agenda/timelabelszone.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (c) 2007 Bruno Virlet <bruno@virlet.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
17
 
 
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.
 
21
*/
 
22
#ifndef EVENTVIEWS_TIMELABELSZONE_H
 
23
#define EVENTVIEWS_TIMELABELSZONE_H
 
24
 
 
25
#include "eventviews_export.h"
 
26
 
 
27
#include <KDateTime>
 
28
 
 
29
#include <QWidget>
 
30
 
 
31
#include <boost/shared_ptr.hpp>
 
32
 
 
33
class QHBoxLayout;
 
34
class QScrollArea;
 
35
 
 
36
namespace EventViews {
 
37
 
 
38
class Agenda;
 
39
class AgendaView;
 
40
 
 
41
class Prefs;
 
42
typedef boost::shared_ptr<Prefs> PrefsPtr;
 
43
 
 
44
class EVENTVIEWS_EXPORT TimeLabelsZone : public QWidget
 
45
{
 
46
  Q_OBJECT
 
47
  public:
 
48
    explicit TimeLabelsZone( QWidget *parent, const PrefsPtr &preferences, Agenda *agenda = 0 );
 
49
 
 
50
    /** Add a new time label with the given spec.
 
51
        If spec is not valid, use the display timespec.
 
52
    */
 
53
    void addTimeLabels( const KDateTime::Spec &spec );
 
54
 
 
55
    /**
 
56
       Returns the best width for each TimeLabels widget
 
57
    */
 
58
    int preferedTimeLabelsWidth() const;
 
59
 
 
60
    void updateAll();
 
61
    void reset();
 
62
    void init();
 
63
    void setAgendaView( AgendaView *agenda );
 
64
 
 
65
    QList<QScrollArea*> timeLabels() const;
 
66
 
 
67
    void setPreferences( const PrefsPtr &prefs );
 
68
    PrefsPtr preferences() const;
 
69
 
 
70
    /** Checks how much agenda is scrolled relative to it's QScrollArea
 
71
        and makes each TimeLabels scroll that amount
 
72
    */
 
73
    void updateTimeLabelsPosition();
 
74
 
 
75
  private:
 
76
    void setupTimeLabel( QScrollArea *area );
 
77
    Agenda *mAgenda;
 
78
    PrefsPtr mPrefs;
 
79
    AgendaView *mParent;
 
80
 
 
81
    QHBoxLayout *mTimeLabelsLayout;
 
82
    QList<QScrollArea*> mTimeLabelsList;
 
83
};
 
84
 
 
85
}
 
86
 
 
87
#endif