2 This file is part of KOrganizer.
4 Copyright (c) 2002 Adriaan de Groot <groot@kde.org>
5 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
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.
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.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
26 #ifndef KORG_DATECHECKER_H
27 #define KORG_DATECHECKER_H
34 class DateChecker
: public QObject
38 explicit DateChecker(QObject
*parent
= Q_NULLPTR
);
42 The DateChecker automatically checks for
43 the passage of midnight. If rollover type is
44 set to None, no signals are emitted and no
45 processing is done. With rollover set to
46 FollowDay, the day highlighter changes at
47 midnight and dayPassed() is emitted.
48 With FollowMonth, it has the same effect
49 as FollowDay but also adjusts the month that is
50 visible and emits monthPassed() when the month changes.
57 void enableRollover(RolloverType
);
60 // Signals emitted at midnight carrying the new date.
61 void dayPassed(const QDate
&);
62 void monthPassed(const QDate
&);
66 Called regularly to see if we need to update the view
67 wrt. the today box and the month box. Only important
68 if you leave KOrganizer idle for long periods of time.
70 Until we have a reliable way of setting QTimers to go
71 off at a particular wall-clock time, we need this,
72 which calls passedMidnight() at the right moments.
74 void possiblyPastMidnight();
77 Handles updating the view when midnight has come by due to idle time.
79 void passedMidnight();
83 QDate mLastDayChecked
;
84 RolloverType mUpdateRollover
;