OutOfOfficeSettings

Since: BlackBerry 10.0.0

#include <bb/pim/message/OutOfOfficeSettings>

To link against this class, add the following line to your .pro file: LIBS += -lbbpim

The OutOfOfficeSettings class includes information about out-of-office replies for messages.

You can use this class to set the Out of Office option, and you can specify the text to use as the out-of-office reply message.


Overview

Public Functions Index

OutOfOfficeSettings ()
OutOfOfficeSettings (int state, const QString &text)
OutOfOfficeSettings (const OutOfOfficeSettings &other)
~OutOfOfficeSettings ()
voidclearSchedule ()
QStringexternalText () const
intisEnabled () const
boolisExternalEnabled () const
boolisValid () const
OutOfOfficeSettings &operator= (const OutOfOfficeSettings &other)
QDateTimescheduleEnd () const
QDateTimescheduleStart () const
voidsetEnabled (bool newState)
voidsetExternalEnabled (bool externalState)
voidsetExternalText (const QString &text)
voidsetSchedule (const QDateTime &startTime, const QDateTime &endTime)
voidsetText (const QString &text)
QStringtext () const

Public Functions

OutOfOfficeSettings ()

Constructs a new OutOfOfficeSettings.

Since:

BlackBerry 10.0.0

OutOfOfficeSettings (

Constructs a new OutOfOfficeSettings with the provided state and text.

The state is an integer that should be either 0 (to disable the out-of-office option) or 1 (to enable the out-of-office option). The provided text is used as the out-of-office reply.

Parameters
state

The state of the out-of-office option (either 0 or 1).

text

The out-of-office reply text.

Since:

BlackBerry 10.0.0

OutOfOfficeSettings (

Copy constructor.

This function constructs an OutOfOfficeSettings containing exactly the same values as the provided OutOfOfficeSettings.

Parameters
other

The OutOfOfficeSettings to be copied.

Since:

BlackBerry 10.0.0

~OutOfOfficeSettings ()

Destructor.

Since:

BlackBerry 10.0.0

void clearSchedule ()

Disables the scheduling of out-of-office notifications for this OutOfOfficeSettings.

This function will remove any out-of-office schedule and leave the notifications in either the enabled or disabled state. It will clear the start and end time values.

Since:

BlackBerry 10.3.1

QString externalText ()

Retrieves the out-of-office reply text for external recipients of this OutOfOfficeSettings.

If the server has the capability to send different out-of-office messages to internal and external recipients, this function will return the message for external recipients. If the server does not have the capability to send a different external message, the message in OutOfOfficeSettings::text() is sent to external recipients and the value of OutOfOfficeSettings::externalText() should be disregarded.

Return:

The text of the automatic reply notifications that will be sent to external recipients.

Since:

BlackBerry 10.3.1

int isEnabled ()

Retrieves whether out-of-office notifications are enabled for this OutOfOfficeSettings.

This function returns 1 (equivalent to true) if automatic replies are enabled or 0 otherwise (no automatic replies are sent).

Return:

The state of out-of-office automatic replies (either 0 or 1).

Since:

BlackBerry 10.0.0

bool isExternalEnabled ()

Retrieves the state of the external notifications of this OutOfOfficeSettings.

For servers that support external recipient notifications, these can be turned on or off independently from the general state of out-of-office notifications. If the general state of out-of-office notifications is off, no notifications will be sent to any recipients, regardless of the external state.

Return:

true if the external out-of-office option is enabled, false otherwise.

Since:

BlackBerry 10.3.1

bool isValid ()

Indicates whether this OutOfOfficeSettings is valid.

The validity of the OutOfOfficeSettings only applies to an OutOfOfficeSettings object returned by the MessageService::outOfOffice() function. In that case, the validity will be set based on whether the message provider was able to obtain valid out-of-office settings from the server.

Return:

true if this OutOfOfficeSettings is valid, false otherwise.

Since:

BlackBerry 10.0.0

OutOfOfficeSettings & operator= (

Assignment operator.

This operator copies all values from the provided OutOfOfficeSettings into this OutOfOfficeSettings.

Parameters
other

The OutOfOfficeSettings from which to copy all values.

Return:

An OutOfOfficeSettings with all copied data.

Since:

BlackBerry 10.0.0

QDateTime scheduleEnd ()

Retrieves the end of the scheduled time during which the out-of-office reply will be sent to recipients for this OutOfOfficeSettings.

If the server has the capability to enable a schedule during which out-of-office messages are sent, and the schedule has been set, this function will return the end time.

Return:

The end date and time of the interval during which out-of-office messages will be sent. If the schedule is not enabled, the QDateTime value returned will not be valid.

Since:

BlackBerry 10.3.1

QDateTime scheduleStart ()

Retrieves the start of the scheduled time during which the out-of-office reply will be sent to recipients for this OutOfOfficeSettings.

If the server has the capability to enable a schedule during which out-of-office messages are sent, and the schedule has been set, this function will return the start time.

Return:

The start date and time of the interval during which out-of-office messages will be sent. If the schedule is not enabled, the QDateTime value returned will not be valid.

Since:

BlackBerry 10.3.1

void setEnabled (
  • boolnewState)

Sets the enabled state of this OutOfOfficeSettings.

The provided state should either be true (if automatic replies are enabled) or false (no automatic replies are sent).

Parameters
newState

The desired state for the out-of-office notifications.

Since:

BlackBerry 10.3.1

void setExternalEnabled (
  • boolexternalState)

Sets the state for the external notifications of this OutOfOfficeSettings.

For servers that support it, external notifications can be assigned a separate text and state. This state works in conjunction with the external notification text set with the OutOfOfficeSettings::setExternalText() function. If the external text is empty, the state will not be effective and no notifications will be sent to external recipients.

Parameters
externalState

If true external out-of-office notifications are enabled, if false external out-of-office notifications are disabled.

Since:

BlackBerry 10.3.1

void setExternalText (

Sets the out-of-office reply text specifically for external recipients for this OutOfOfficeSettings.

If the server has the capability to send different out-of-office messages to internal and external recipients, this function should be used to set a different message for external recipients. If the value for the external text is left empty, the external recipients will not receive any notifications. If the server does not support different out-of-office messages for internal and external recipients, the notification sent to external recipients will be the same as that for internal recipients, regardless of the value set here.

Parameters
text

The new external out-of-office reply text.

Since:

BlackBerry 10.3.1

void setSchedule (

Sets the scheduled time during which the out-of-office reply will be sent to recipients for this OutOfOfficeSettings.

If the server has the capability to enable a schedule during which out-of-office messages are sent, this function should be used to set the schedule start and end time. Out-of-office notifications must be enabled by calling the OutOfOfficeSettings::setState() function or the schedule will have no effect. If either the startTime or endTime is invalid, the endTime is before the startTime, or the endTime is in the past, the schedule will not be enabled.

Parameters
startTime

The start date and time of the interval during which out-of-office messages will be sent.

endTime

The end date and time of the interval during which out-of-office messages will be sent.

Since:

BlackBerry 10.3.1

void setText (

Sets the out-of-office reply text of this OutOfOfficeSettings.

Parameters
text

The new out-of-office reply text.

Since:

BlackBerry 10.0.0

QString text ()

Retrieves the out-of-office reply text of this OutOfOfficeSettings.

Return:

The text of the automatic reply notifications.

Since:

BlackBerry 10.3.1

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus