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

« back to all changes in this revision

Viewing changes to calendarviews/eventviews/agenda/timelabels.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) 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>
 
5
 
 
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.
 
10
 
 
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.
 
15
 
 
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.
 
19
 
 
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.
 
23
*/
 
24
#ifndef EVENTVIEWS_TIMELABELS_H
 
25
#define EVENTVIEWS_TIMELABELS_H
 
26
 
 
27
#include "eventviews_export.h"
 
28
 
 
29
#include <KDateTime>
 
30
 
 
31
#include <QFrame>
 
32
 
 
33
#include <boost/shared_ptr.hpp>
 
34
 
 
35
namespace EventViews {
 
36
 
 
37
class Agenda;
 
38
class TimeLabelsZone;
 
39
 
 
40
class Prefs;
 
41
typedef boost::shared_ptr<Prefs> PrefsPtr;
 
42
 
 
43
class EVENTVIEWS_EXPORT TimeLabels : public QFrame
 
44
{
 
45
  Q_OBJECT
 
46
  public:
 
47
    typedef QList<TimeLabels *> List;
 
48
 
 
49
    TimeLabels( const KDateTime::Spec &spec, int rows,
 
50
                TimeLabelsZone *parent = 0, Qt::WFlags f = 0 );
 
51
 
 
52
    /** updates widget's internal state */
 
53
    void updateConfig();
 
54
 
 
55
    /**  */
 
56
    void setAgenda( Agenda *agenda );
 
57
 
 
58
    /**  */
 
59
    virtual void paintEvent( QPaintEvent *e );
 
60
 
 
61
    /** */
 
62
    virtual void contextMenuEvent( QContextMenuEvent *event );
 
63
 
 
64
    /** Returns time spec of this label */
 
65
    KDateTime::Spec timeSpec();
 
66
 
 
67
    /**
 
68
      Return string which can be used as a header for the time label.
 
69
    */
 
70
    QString header() const;
 
71
 
 
72
    /**
 
73
      Return string which can be used as a tool tip for the header.
 
74
    */
 
75
    QString headerToolTip() const;
 
76
 
 
77
    QSize sizeHint() const;
 
78
 
 
79
    QSize minimumSizeHint() const;
 
80
 
 
81
  private slots:
 
82
    /** update the position of the marker showing the mouse position */
 
83
    void mousePosChanged( const QPoint &pos );
 
84
 
 
85
    void showMousePos();
 
86
    void hideMousePos();
 
87
 
 
88
    void setCellHeight( double height );
 
89
 
 
90
  private:
 
91
    void colorMousePos();
 
92
    KDateTime::Spec mSpec;
 
93
    int mRows;
 
94
    double mCellHeight;
 
95
    int mMiniWidth;
 
96
    Agenda *mAgenda;
 
97
    TimeLabelsZone *mTimeLabelsZone;
 
98
 
 
99
    QFrame *mMousePos;  // shows a marker for the current mouse position in y direction
 
100
};
 
101
 
 
102
}
 
103
 
 
104
#endif