korganizer

datechecker.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2002 Adriaan de Groot <groot@kde.org>
5  Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 #ifndef DATECHECKER_H
26 #define DATECHECKER_H
27 
28 #include <tqobject.h>
29 #include <tqdatetime.h>
30 
31 class TQTimer;
32 
33 class KCalendarSystem;
34 
35 class NavigatorBar;
36 
37 class DateChecker: public TQObject
38 {
39  TQ_OBJECT
40 
41  public:
42  DateChecker( TQObject *parent = 0, const char *name = 0 );
43  ~DateChecker();
44 
56  enum RolloverType { None, FollowDay, FollowMonth };
57  void enableRollover( RolloverType );
58 
59  signals:
60  // Signals emitted at midnight carrying the new date.
61  void dayPassed( const TQDate & );
62  void monthPassed( const TQDate & );
63 
64  protected slots:
74  void possiblyPastMidnight();
75 
79  void passedMidnight();
80 
81  private:
82  TQTimer *mUpdateTimer;
83  TQDate mLastDayChecked;
84  RolloverType mUpdateRollover;
85 };
86 
87 #endif