The K Desktop Environment

scheduleMessage

Name

scheduleMessage — schedule a new alarm message.

Synopsis

bool scheduleMessage(const QString& message, const QDateTime* dateTime, const QColor& bg, int flags)
bool scheduleMessage(const QString& message, const QDateTime* dateTime, const QColor& bg, int flags, int repeat_count, int interval)

Parameters

message

Specifies the text of the message to be scheduled.

dateTime

Specifies the scheduled date and time at which the message should be displayed.

bg

Specifies the background colour for displaying the message.

flags

Specifies the logical OR of the desired alarm message flags. The flag bits are those defined in msgevent.h

repeatCount

Specifies the number of times that the alarm message should be repeated, after its initial display.

interval

Specifies the interval in minutes between repetitions of the alarm message.

Description

scheduleMessage() is a DCOP call to schedule the specified alarm message for display at the specified date and time. It has two forms: one for a non-repeating alarm, and another for a repeating alarm.

If the scheduled time (including any repetitions) has already passed, KAlarm immediately displays the message or, if the LATE_CANCEL flag bit is set, ignores the request. If the scheduled time is in the future, KAlarm adds the alarm message to the calendar file for later display.

Use a code sequence similar to the following to set up the parameter data for the DCOP call to scheduleMessage() for a non-repeating alarm:

QString message;
QDateTime dateTime;
QColor bgColour;
Q_UINT32 flags;
. . .
QByteArray data;
QDataStream arg(data, IO_WriteOnly);
arg <<  message;
arg.writeRawBytes((char*)&dateTime, sizeof(QDateTime));
arg.writeRawBytes((char*)&bgColour, sizeof(QColor));
arg << flags;

Use a code sequence similar to the following to set up the parameter data for the DCOP call to scheduleMessage() for a repeating alarm:

QString message;
QDateTime dateTime;
QColor bgColour;
Q_UINT32 flags;
Q_INT32 repeatCount, repeatInterval;
. . .
QByteArray data;
QDataStream arg(data, IO_WriteOnly);
arg << message;
arg.writeRawBytes((char*)&dateTime, sizeof(QDateTime));
arg.writeRawBytes((char*)&bgColour, sizeof(QColor));
arg << flags << repeatCount << repeatInterval;