Public Types | Public Member Functions

QAlarms Class Reference

The QAlarms class can be used to set, remove and modifying alarms. More...

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

This enum defines the possible errors for a QAlarms object.

Enumerator:
NoError 

No error occured.

OutOfMemoryError 

Not enough memory.

NotFoundError 

Not enough memory.

CouldNotConnectError 

Not enough memory.

AccessDeniedError 

Not enough memory.

UnknownError 

Unknown error.


Constructor & Destructor Documentation

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.

See also:
error()
QAlarms::~QAlarms (  ) 

Destroys the QAlarms object.


Member Function Documentation

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.

Parameters:
alarmData An QAlarm object
Returns:
If false is returned, an error has occurred. Call error() to get the QAlarms::Error value that indicates which error occurred
See also:
deleteAlarm(), error()
QAlarm QAlarms::alarm ( int  alarmId  )  const

Gets the alarm specified by the alarmId

Parameters:
alarmId Alarm's id
Returns:
QAlarm object
See also:
alarmIds
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

Returns:
List of alarm ids
See also:
error()
bool QAlarms::deleteAlarm ( int  alarmId  ) 

Removes the alarm with given id.

Parameters:
alarmId Alarm to be removed
Returns:
If false is returned, an error has occurred. Call error() to get the QAlarms::Error value that indicates which error occurred
See also:
addAlarm(), error()
QAlarms::Error QAlarms::error (  )  const
Returns:
The type of error that occurred when the last function call failed, otherwise returns NoError.
bool QAlarms::isEnabled ( int  alarmId  )  const
Parameters:
alarmId Alarm id to find the status of
Returns:
True if the alarm is enabled, otherwise false.
See also:
setEnabled()
bool QAlarms::setEnabled ( int  alarmId,
bool  status 
)

This sets an alarm to be enabled or disabled.

Parameters:
alarmId The id of the alarm to enable or disable
status Sets the alarm's next due time.
Returns:
If false is returned, an error has occurred. Call error() to get the QAlarms::Error value that indicates which error occurred
See also:
isEnabled(), error()

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations Enumerator