Qt API | Qtopia API Qtopia Documentation

AlarmServer Class Reference

The AlarmServer class allows alarms to be scheduled and unscheduled. More...

#include <qtopia/alarmserver.h>

List of all member functions.

Static Public Members


Detailed Description

The AlarmServer class allows alarms to be scheduled and unscheduled.

Applications can schedule alarms with addAlarm() and can unschedule alarms with deleteAlarm(). When the time for an alarm to go off is reached the specified QCop message is sent on the specified channel (optionally with additional data).

Scheduling an alarm using this class is important (rather just using a QTimer) since the machine may be asleep and needs to get woken up using the Linux kernel which implements this at the kernel level to minimize battery usage while asleep.

See also QCopEnvelope and Qtopia Classes.


Member Function Documentation

void AlarmServer::addAlarm ( QDateTime when, const QCString & channel, const QCString & message, int data = 0 ) [static]

Schedules an alarm to go off at (or soon after) time when. When the alarm goes off, the QCop message will be sent to channel, with data as a parameter.

If this function is called with exactly the same data as a previous call the subsequent call is ignored, so there is only ever one alarm with a given set of parameters.

See also deleteAlarm().

void AlarmServer::deleteAlarm ( QDateTime when, const QCString & channel, const QCString & message, int data = 0 ) [static]

Deletes previously scheduled alarms which match when, channel, message, and data.

Passing null values for when, channel, or for the QCop message, acts as a wildcard meaning "any". Similarly, passing -1 for data indicates "any".

If there is no matching alarm, nothing happens.

See also addAlarm().


This file is part of the Qtopia , copyright © 1995-2002 Trolltech, all rights reserved.


Copyright © 2001-2002 TrolltechTrademarks
Qtopia version 1.7.0