korganizer

kdatenavigator.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 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 KDATENAVIGATOR_H
26 #define KDATENAVIGATOR_H
27 
28 #include <tqframe.h>
29 #include <tqdatetime.h>
30 
31 #include <libkcal/incidencebase.h>
32 
33 class TQPushButton;
34 class TQLabel;
35 
36 namespace KCal {
37 class Calendar;
38 class Incidence;
39 }
40 class NavigatorBar;
41 using namespace KCal;
42 
43 class KODayMatrix;
44 
45 class KDateNavigator: public TQFrame
46 {
47  TQ_OBJECT
48 
49  public:
50  KDateNavigator( TQWidget *parent = 0, const char *name = 0 );
51  ~KDateNavigator();
52 
56  void setCalendar( Calendar * );
57 
58  void setBaseDate( const TQDate & );
59 
60  KCal::DateList selectedDates() const { return mSelectedDates; }
61 
62  TQSizePolicy sizePolicy () const;
63 
64  NavigatorBar *navigatorBar() const { return mNavigatorBar; }
65  TQDate startDate() const;
66  TQDate endDate() const;
67  void setUpdateNeeded();
68 
74  TQDate month() const;
75 
76  public slots:
77  void selectDates( const KCal::DateList & );
78  void updateView();
79  void updateConfig();
80  void updateDayMatrix();
81  void updateToday();
82 
83  signals:
84  void datesSelected( const KCal::DateList & );
85  void incidenceDropped( Incidence *, const TQDate & );
86  void incidenceDroppedMove( Incidence *, const TQDate & );
87  void weekClicked( const TQDate & );
88 
89  void goPrevious();
90  void goNext();
91  void nextMonthClicked();
92  void prevMonthClicked();
93  void nextYearClicked();
94  void prevYearClicked();
95 
96  void monthSelected( int month );
97  void yearSelected( int year );
98 
99  protected:
100  void updateDates();
101 
102  void wheelEvent( TQWheelEvent * );
103 
104  bool eventFilter( TQObject *, TQEvent * );
105 
106  void setShowWeekNums( bool enabled );
107 
108  private:
109  NavigatorBar *mNavigatorBar;
110 
111  TQLabel *mHeadings[ 7 ];
112  TQLabel *mWeeknos[ 7 ];
113 
114  KODayMatrix *mDayMatrix;
115 
116  KCal::DateList mSelectedDates;
117  TQDate mBaseDate;
118 
119  // Disabling copy constructor and assignment operator
120  KDateNavigator( const KDateNavigator & );
121  KDateNavigator &operator=( const KDateNavigator & );
122 };
123 
124 #endif
Replacement for kdpdatebuton.cpp that used 42 widgets for the day matrix to be displayed.
Definition: kodaymatrix.h:106