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     void setUpdateNeeded();
00067 
00073     QDate month() const;
00074 
00075   public slots:
00076     void selectDates( const KCal::DateList & );
00077     void updateView();
00078     void updateConfig();
00079     void updateDayMatrix();
00080     void updateToday();
00081 
00082   signals:
00083     void datesSelected( const KCal::DateList & );
00084     void incidenceDropped( Incidence *, const QDate & );
00085     void incidenceDroppedMove( Incidence *, const QDate & );
00086     void weekClicked( const QDate & );
00087 
00088     void goPrevious();
00089     void goNext();
00090     void nextMonthClicked();
00091     void prevMonthClicked();
00092     void nextYearClicked();
00093     void prevYearClicked();
00094 
00095     void monthSelected( int month );
00096     void yearSelected( int year );
00097 
00098   protected:
00099     void updateDates();
00100 
00101     void wheelEvent( QWheelEvent * );
00102 
00103     bool eventFilter( QObject *, QEvent * );
00104 
00105     void setShowWeekNums( bool enabled );
00106 
00107   private:
00108     NavigatorBar *mNavigatorBar;
00109 
00110     QLabel *mHeadings[ 7 ];
00111     QLabel *mWeeknos[ 7 ];
00112 
00113     KODayMatrix *mDayMatrix;
00114 
00115     KCal::DateList mSelectedDates;
00116     QDate mBaseDate;
00117 
00118     // Disabling copy constructor and assignment operator
00119     KDateNavigator( const KDateNavigator & );
00120     KDateNavigator &operator=( const KDateNavigator & );
00121 };
00122 
00123 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys