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 TQt, and distribute the resulting executable,
00023     without including the source code for TQt in the source distribution.
00024 */
00025 #ifndef DATECHECKER_H
00026 #define DATECHECKER_H
00027 
00028 #include <tqobject.h>
00029 #include <tqdatetime.h>
00030 
00031 class TQTimer;
00032 
00033 class KCalendarSystem;
00034 
00035 class NavigatorBar;
00036 
00037 class DateChecker: public TQObject
00038 {
00039     Q_OBJECT
00040   TQ_OBJECT
00041   public:
00042     DateChecker( TQObject *parent = 0, const char *name = 0 );
00043     ~DateChecker();
00044 
00056     enum RolloverType { None, FollowDay, FollowMonth };
00057     void enableRollover( RolloverType );
00058 
00059   signals:
00060     // Signals emitted at midnight carrying the new date.
00061     void dayPassed( const TQDate & );
00062     void monthPassed( const TQDate & );
00063 
00064   protected slots:
00074      void possiblyPastMidnight();
00075 
00079      void passedMidnight();
00080 
00081   private:
00082     TQTimer *mUpdateTimer;
00083     TQDate mLastDayChecked;
00084     RolloverType mUpdateRollover;
00085 };
00086 
00087 #endif