korganizer
datechecker.h
00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2002 Adriaan de Groot <groot@kde.org> 00005 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> 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 DATECHECKER_H 00026 #define DATECHECKER_H 00027 00028 #include <qobject.h> 00029 #include <qdatetime.h> 00030 00031 class QTimer; 00032 00033 class KCalendarSystem; 00034 00035 class NavigatorBar; 00036 00037 class DateChecker: public QObject 00038 { 00039 Q_OBJECT 00040 public: 00041 DateChecker( QObject *parent = 0, const char *name = 0 ); 00042 ~DateChecker(); 00043 00055 enum RolloverType { None, FollowDay, FollowMonth }; 00056 void enableRollover( RolloverType ); 00057 00058 signals: 00059 // Signals emitted at midnight carrying the new date. 00060 void dayPassed( const QDate & ); 00061 void monthPassed( const QDate & ); 00062 00063 protected slots: 00073 void possiblyPastMidnight(); 00074 00078 void passedMidnight(); 00079 00080 private: 00081 QTimer *mUpdateTimer; 00082 QDate mLastDayChecked; 00083 RolloverType mUpdateRollover; 00084 }; 00085 00086 #endif