Warning, file /pim/kalarm/src/startdaytimer.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  *  startdaytimer.h  -  timer triggered at the user-defined start-of-day time
0003  *  Program:  kalarm
0004  *  SPDX-FileCopyrightText: 2004, 2005, 2009 David Jarvie <djarvie@kde.org>
0005  *
0006  *  SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #pragma once
0010 
0011 /* @file startdaytimer.h - timer triggered at the user-defined start-of-day time */
0012 
0013 #include "lib/synchtimer.h"
0014 
0015 
0016 /** StartOfDayTimer is an application-wide timer synchronized to the user-defined
0017  *  start-of-day time (set in KAlarm's Preferences dialog).
0018  *  It automatically adjusts to any changes in the start-of-day time.
0019  *
0020  *  @author David Jarvie <djarvie@kde.org>
0021  */
0022 class StartOfDayTimer : public DailyTimer
0023 {
0024     Q_OBJECT
0025 public:
0026     ~StartOfDayTimer() override = default;
0027     /** Connect to the timer signal.
0028      *  @param receiver Receiving object.
0029      *  @param member Slot to activate.
0030      */
0031     static void connect(QObject* receiver, const char* member)
0032                        { instance()->connecT(receiver, member); }
0033     /** Disconnect from the timer signal.
0034      *  @param receiver Receiving object.
0035      *  @param member Slot to disconnect. If null, all slots belonging to
0036      *                @p receiver will be disconnected.
0037      */
0038     static void disconnect(QObject* receiver, const char* member = nullptr)
0039                        { if (mInstance) mInstance->disconnecT(receiver, member); }
0040 
0041 protected:
0042     StartOfDayTimer();
0043     static StartOfDayTimer* instance();
0044 
0045 private Q_SLOTS:
0046     void startOfDayChanged();
0047 
0048 private:
0049     static StartOfDayTimer* mInstance;    // exists solely to receive signals
0050 };
0051 
0052 // vim: et sw=4: