korganizer

datenavigatorcontainer.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of TQt, and distribute the resulting executable,
00023     without including the source code for TQt in the source distribution.
00024 */
00025 #ifndef DATENAVIGATORCONTAINER_H
00026 #define DATENAVIGATORCONTAINER_H
00027 
00028 #include <tqframe.h>
00029 
00030 class KDateNavigator;
00031 
00032 class DateNavigatorContainer: public TQFrame
00033 {
00034     Q_OBJECT
00035   
00036   public:
00037     DateNavigatorContainer( TQWidget *parent = 0, const char *name = 0 );
00038     ~DateNavigatorContainer();
00039 
00043     void setCalendar( Calendar * );
00044 
00045     TQSize minimumSizeHint() const;
00046     TQSize sizeHint() const;
00047     void setUpdateNeeded();
00048   public slots:
00054     void selectDates( const KCal::DateList &, const TQDate &preferredMonth = TQDate() );
00055     void updateView();
00056     void updateConfig();
00057     void updateDayMatrix();
00058     void updateToday();
00059 
00060     void goPrevMonth();
00061     void goNextMonth();
00062 
00063   signals:
00064     void datesSelected( const KCal::DateList & );
00065     void incidenceDropped( Incidence *, const TQDate & );
00066     void incidenceDroppedMove( Incidence *, const TQDate & );
00067     void weekClicked( const TQDate & );
00068 
00069     void goPrevious();
00070     void goNext();
00071 
00072     void nextYearClicked();
00073     void prevYearClicked();
00074 
00083     void prevMonthClicked( const TQDate &currentMonth,
00084                            const TQDate &selectionLowerLimit,
00085                            const TQDate &selectionUpperLimit );
00086 
00087     void nextMonthClicked( const TQDate &currentMonth,
00088                            const TQDate &selectionLowerLimit,
00089                            const TQDate &selectionUpperLimit );
00090 
00091     void monthSelected( int month );
00092 
00093     void yearSelected( int year );
00094 
00095   protected:
00096     void resizeEvent( TQResizeEvent * );
00097     void setBaseDates( const TQDate &start );
00098     void connectNavigatorView( KDateNavigator *v );
00099   protected slots:
00104     void resizeAllContents();
00105 
00106   private:
00107     /* Returns the first day of the first KDateNavigator, and the last day
00108        of the last KDateNavigator.
00109 
00110        @param monthOffset If you have two KDateNavigators displaying January and February
00111        and want to know the boundaries of, for e.g. displaying February and March,
00112        use monthOffset = 1.
00113     */
00114     TQPair<TQDate,TQDate> dateLimits( int monthOffset = 0 );
00115 
00116     KDateNavigator *mNavigatorView;
00117 
00118     KCal::Calendar *mCalendar;
00119 
00120     TQPtrList<KDateNavigator> mExtraViews;
00121 
00122     int mHorizontalCount;
00123     int mVerticalCount;
00124 };
00125 
00126 #endif