korganizer

kdatenavigator.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (C) 2003-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 Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef KDATENAVIGATOR_H
00026 #define KDATENAVIGATOR_H
00027 
00028 #include <qframe.h>
00029 #include <qdatetime.h>
00030 
00031 #include <libkcal/incidencebase.h>
00032 
00033 class QPushButton;
00034 class QLabel;
00035 
00036 namespace KCal {
00037 class Calendar;
00038 class Incidence;
00039 }
00040 class NavigatorBar;
00041 using namespace KCal;
00042 
00043 class KODayMatrix;
00044 
00045 class KDateNavigator: public QFrame
00046 {
00047     Q_OBJECT
00048   public:
00049     KDateNavigator( QWidget *parent = 0, const char *name = 0 );
00050     ~KDateNavigator();
00051 
00055     void setCalendar( Calendar * );
00056 
00057     void setBaseDate( const QDate & );
00058 
00059     KCal::DateList selectedDates() const { return mSelectedDates; }
00060 
00061     QSizePolicy sizePolicy () const;
00062 
00063     NavigatorBar *navigatorBar() const { return mNavigatorBar; }
00064     QDate startDate() const;
00065     QDate endDate() const;
00066 
00067   public slots:
00068     void selectDates( const KCal::DateList & );
00069     void updateView();
00070     void updateConfig();
00071     void updateDayMatrix();
00072     void updateToday();
00073 
00074   signals:
00075     void datesSelected( const KCal::DateList & );
00076     void incidenceDropped( Incidence *, const QDate & );
00077     void incidenceDroppedMove( Incidence *, const QDate & );
00078     void weekClicked( const QDate &);
00079 
00080     void goPrevious();
00081     void goNext();
00082 
00083     void goNextMonth();
00084     void goPrevMonth();
00085     void goNextYear();
00086     void goPrevYear();
00087 
00088     void goMonth( int month );
00089 
00090   protected:
00091     void updateDates();
00092 
00093     void wheelEvent( QWheelEvent * );
00094 
00095     bool eventFilter( QObject *,QEvent * );
00096 
00097     void setShowWeekNums( bool enabled );
00098 
00099   private:
00100     NavigatorBar *mNavigatorBar;
00101 
00102     QLabel *mHeadings[ 7 ];
00103     QLabel *mWeeknos[ 7 ];
00104 
00105     KODayMatrix *mDayMatrix;
00106 
00107     KCal::DateList mSelectedDates;
00108     QDate mBaseDate;
00109 
00110     // Disabling copy constructor and assignment operator
00111     KDateNavigator( const KDateNavigator & );
00112     KDateNavigator &operator=( const KDateNavigator & );
00113 };
00114 
00115 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys