The QAlarms class can be used to set, remove and modifying alarms. More...
Public Types | |
enum | Error { NoError = 0, OutOfMemoryError, NotFoundError, CouldNotConnectError, AccessDeniedError, UnknownError = -1 } |
enum | Weekday { Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8, Friday = 16, Saturday = 32, Sunday = 64 } |
Public Member Functions | |
QAlarms (QObject *parent=0) | |
~QAlarms () | |
QAlarm | alarm (int alarmId) const |
QList< int > | alarmIds () const |
bool | addAlarm (QAlarm &alarmData) |
bool | deleteAlarm (int alarmId) |
bool | setEnabled (int alarmId, bool status) |
bool | isEnabled (int alarmId) const |
QAlarms::Error | error () const |
The QAlarms class can be used to set, remove and modifying alarms.
The QAlarm class stores alarm data. If category is not set, default value is clock alarm.
enum QAlarms::Error |
This enum defines the possible errors for a QAlarms object.
QAlarms::QAlarms | ( | QObject * | parent = 0 |
) |
Constructs an QAlarms object with the given parent.
Call error() to get a value of QAlarms::Error that indicates if an error occurred during construction.
QAlarms::~QAlarms | ( | ) |
Destroys the QAlarms object.
bool QAlarms::addAlarm | ( | QAlarm & | alarmData | ) |
This sets an alarm. If the QAlarm cataegory is not set, the alarm category is set to KClockAlarm. On return, alarm gets an unique identifier to identify the alarm.
alarmData | An QAlarm object |
QAlarm QAlarms::alarm | ( | int | alarmId | ) | const |
QList< int > QAlarms::alarmIds | ( | ) | const |
This function returns the list of Alarm Id list.
Note: Function may occur an error. Call error() to get the QAlarms::Error value that indicates which error occurred
bool QAlarms::deleteAlarm | ( | int | alarmId | ) |
Removes the alarm with given id.
alarmId | Alarm to be removed |
QAlarms::Error QAlarms::error | ( | ) | const |
bool QAlarms::isEnabled | ( | int | alarmId | ) | const |
alarmId | Alarm id to find the status of |
bool QAlarms::setEnabled | ( | int | alarmId, | |
bool | status | |||
) |
This sets an alarm to be enabled or disabled.
alarmId | The id of the alarm to enable or disable | |
status | Sets the alarm's next due time. |