korganizer

datenavigatorcontainer.h
1/*
2 This file is part of KOrganizer.
3
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 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 DATENAVIGATORCONTAINER_H
26#define DATENAVIGATORCONTAINER_H
27
28#include <tqframe.h>
29
30class KDateNavigator;
31
32class DateNavigatorContainer: public TQFrame
33{
34 TQ_OBJECT
35
36 public:
37 DateNavigatorContainer( TQWidget *parent = 0, const char *name = 0 );
38 ~DateNavigatorContainer();
39
43 void setCalendar( Calendar * );
44
45 TQSize minimumSizeHint() const;
46 TQSize sizeHint() const;
47 void setUpdateNeeded();
48 public slots:
54 void selectDates( const KCal::DateList &, const TQDate &preferredMonth = TQDate() );
55 void updateView();
56 void updateConfig();
57 void updateDayMatrix();
58 void updateToday();
59
60 void goPrevMonth();
61 void goNextMonth();
62
63 signals:
64 void datesSelected( const KCal::DateList & );
65 void incidenceDropped( Incidence *, const TQDate & );
66 void incidenceDroppedMove( Incidence *, const TQDate & );
67 void weekClicked( const TQDate & );
68
69 void goPrevious();
70 void goNext();
71
72 void nextYearClicked();
73 void prevYearClicked();
74
83 void prevMonthClicked( const TQDate &currentMonth,
84 const TQDate &selectionLowerLimit,
85 const TQDate &selectionUpperLimit );
86
87 void nextMonthClicked( const TQDate &currentMonth,
88 const TQDate &selectionLowerLimit,
89 const TQDate &selectionUpperLimit );
90
91 void monthSelected( int month );
92
93 void yearSelected( int year );
94
95 protected:
96 void resizeEvent( TQResizeEvent * );
97 void setBaseDates( const TQDate &start );
98 void connectNavigatorView( KDateNavigator *v );
99 protected slots:
104 void resizeAllContents();
105
106 private:
107 /* Returns the first day of the first KDateNavigator, and the last day
108 of the last KDateNavigator.
109
110 @param monthOffset If you have two KDateNavigators displaying January and February
111 and want to know the boundaries of, for e.g. displaying February and March,
112 use monthOffset = 1.
113 */
114 TQPair<TQDate,TQDate> dateLimits( int monthOffset = 0 );
115
116 KDateNavigator *mNavigatorView;
117
118 KCal::Calendar *mCalendar;
119
120 TQPtrList<KDateNavigator> mExtraViews;
121
122 int mHorizontalCount;
123 int mVerticalCount;
124};
125
126#endif