kalarm/lib

#include <synchtimer.h>

Inheritance diagram for DailyTimer:
SynchTimer

Public Member Functions

void changeTime (const TQTime &newTimeOfDay, bool triggerMissed=true)
 
TQTime timeOfDay () const
 

Static Public Member Functions

static void connect (const TQTime &timeOfDay, TQObject *receiver, const char *member)
 
static void disconnect (const TQTime &timeOfDay, TQObject *receiver, const char *member=0)
 

Protected Slots

virtual void slotTimer ()
 
- Protected Slots inherited from SynchTimer
virtual void slotTimer ()=0
 

Protected Member Functions

 DailyTimer (const TQTime &, bool fixed)
 
virtual void start ()
 
- Protected Member Functions inherited from SynchTimer
void connecT (TQObject *receiver, const char *member)
 
void disconnecT (TQObject *receiver, const char *member=0)
 
bool hasConnections () const
 

Static Protected Member Functions

static DailyTimerfixedInstance (const TQTime &timeOfDay, bool create=true)
 

Additional Inherited Members

- Protected Attributes inherited from SynchTimer
TQTimer * mTimer
 

Detailed Description

DailyTimer is an application-wide timer synchronised to a specified time of day, local time.

Daily timers come in two flavours: fixed, which can only be accessed through static methods, and variable, whose time can be adjusted and which are accessed through non-static methods.

Author
David Jarvie softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 117 of file synchtimer.h.

Constructor & Destructor Documentation

◆ DailyTimer()

DailyTimer::DailyTimer ( const TQTime &  timeOfDay,
bool  fixed 
)
protected

Construct an instance.

The constructor is protected to ensure that for variable timers, only derived classes can construct instances. This ensures that multiple timers are not created for the same use.

Definition at line 124 of file synchtimer.cpp.

Member Function Documentation

◆ changeTime()

void DailyTimer::changeTime ( const TQTime &  newTimeOfDay,
bool  triggerMissed = true 
)

Change the time at which this variable timer triggers.

Parameters
newTimeOfDayNew time at which the timer should trigger.
triggerMissedIf true, and if newTimeOfDay < oldTimeOfDay, and if the current time is between newTimeOfDay and oldTimeOfDay, the timer will be triggered immediately so as to avoid missing today's trigger.

Definition at line 163 of file synchtimer.cpp.

◆ connect()

static void DailyTimer::connect ( const TQTime &  timeOfDay,
TQObject *  receiver,
const char *  member 
)
inlinestatic

Connect to the timer signal which triggers at the given fixed time of day.

A new timer is created if necessary.

Parameters
timeOfDayTime at which the timer is to trigger.
receiverReceiving object.
memberSlot to activate.

Definition at line 129 of file synchtimer.h.

◆ disconnect()

void DailyTimer::disconnect ( const TQTime &  timeOfDay,
TQObject *  receiver,
const char *  member = 0 
)
static

Disconnect from the timer signal which triggers at the given fixed time of day.

If there are no remaining connections to that timer, it is destroyed.

Parameters
timeOfDayTime at which the timer triggers.
receiverReceiving object.
memberSlot to disconnect. If null, all slots belonging to receiver will be disconnected.

Definition at line 150 of file synchtimer.cpp.

◆ fixedInstance()

DailyTimer * DailyTimer::fixedInstance ( const TQTime &  timeOfDay,
bool  create = true 
)
staticprotected

Return the instance which triggers at the specified fixed time of day, optionally creating a new instance if necessary.

Parameters
timeOfDayTime at which the timer triggers.
createIf true, create a new instance if none already exists for timeOfDay.
Returns
The instance for timeOfDay, or 0 if it does not exist.

Definition at line 138 of file synchtimer.cpp.

◆ timeOfDay()

TQTime DailyTimer::timeOfDay ( ) const
inline

Return the current time of day at which this variable timer triggers.

Definition at line 147 of file synchtimer.h.


The documentation for this class was generated from the following files: