#include <mw/lbttriggerentry.h>
class CLbtTriggerEntry : public CBase |
Public Member Enumerations | |
---|---|
enum | TAttribute { EAttributeId, EAttributeName, EAttributeState, EAttributeRequestor, ..., EAttributeStartUpCommandLine } |
enum | TLbtTriggerState { EStateEnabled, EStateDisabled } |
enum | TType { ETypeSession, ETypeStartup } |
Public Member Functions | |
---|---|
virtual | ~CLbtTriggerEntry() |
IMPORT_C void | ExternalizeL(RWriteStream &) |
IMPORT_C CLbtTriggerConditionBase * | GetCondition() |
IMPORT_C const CLbtTriggerConditionBase * | GetCondition() |
IMPORT_C void | GetRequestorsL(RRequestorStack &) |
IMPORT_C const TLbtTriggerId & | Id() |
IMPORT_C void | InternalizeL(RReadStream &) |
IMPORT_C TUid | ManagerUi() |
IMPORT_C const TDesC & | Name() |
IMPORT_C void | SetCondition(CLbtTriggerConditionBase *) |
IMPORT_C void | SetId(TLbtTriggerId) |
IMPORT_C void | SetManagerUi(TUid) |
IMPORT_C void | SetNameL(const TDesC &) |
IMPORT_C void | SetRequestorL(CRequestor::TRequestorType, CRequestor::TRequestorFormat, const TDesC &) |
IMPORT_C void | SetRequestorsL(const RRequestorStack &) |
IMPORT_C void | SetState(TLbtTriggerState) |
IMPORT_C void | SetTimeToRearm(TInt) |
IMPORT_C TLbtTriggerState | State() |
IMPORT_C TInt | TimeToRearm() |
pure virtual IMPORT_C TType | Type() |
Protected Member Functions | |
---|---|
CLbtTriggerEntry() | |
pure virtual void | DoExternalizeL(RWriteStream &) |
pure virtual void | DoInternalizeL(RReadStream &) |
Abstract base class for location triggering entries.
It provides methods to determine the trigger type and to define basic trigger attributes. The following attributes are defined in location triggering entries.
Id Defines the identity of a trigger. The Id is allocated by Location Triggering Server and it's unique among all triggers currently exist in the system. If a trigger is removed from the system, its Id may be reused by another trigger. This attribute can not be modified after the trigger is created.
Name The name attribute defines a human-readable name for the trigger. The purpose of the name attribute is mainly for the end user to be able to identify the trigger in the UI. The maximum length of the name is KLbtMaxNameLength characters. This attribute can be modified after the trigger is created.
State This attribute specifies if the trigger is enabled or disabled. A disabled trigger is not supervised by the Location Triggering Server and thus will never be fired. This attribute can be modified after the trigger is created.
Requestors The requestors attribute consists of a requestor stack with contacts and/or services using the location service. Requestor information is used for privacy queries when trigger is created and fired. Requestor information is not allowed to be changed once the trigger has been created.
Manager UI. Manager UI is the UI application that can view, edit and delete the trigger. Manager UI application shall be provided by the user of this API. If it's possible, client application must specify the manager UI application when the trigger is created. Note, Manager UI may be different from the trigger's owner. Trigger's owner is the process that created the trigger. Triggers can be directly accessed by the Manager UI application. Although this attribute is not mandatory when creating a trigger. it's highly recommended that it is specified. It cannot be modified after the trigger is created.
Trigger condition. Trigger condition specifies in what situation a trigger shall be fired. Current system supports only basic trigger condition. Basic trigger condition is defined by a trigger area and direction of terminal's movement. Only circular area can be used as trigger area in current system. This attribute can be modified after the trigger is created.
Trigger attributes identifications.
These ids can be combined and used to form an attribute mask when retrieving partial attributes from Location Triggering Server.
void | DoExternalizeL | ( | RWriteStream & | aStream | ) | const [protected, pure virtual] |
Externalize method that subclass must implement.
Parameter | Description |
---|---|
aStream | Stream to which the object should be externalized. |
void | DoInternalizeL | ( | RReadStream & | aStream | ) | [protected, pure virtual] |
Internalize method that subclass must implement.
Parameter | Description |
---|---|
aStream | Stream from which the object should be internalized. |
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
Externalizes the trigger object's details and attributes to stream.
The presence of this function means that the standard template operator<<() ( defined in s32strm.h ) is available to externalize objects of this class.
Parameter | Description |
---|---|
aStream | Stream to which the object should be externalized. |
IMPORT_C CLbtTriggerConditionBase * | GetCondition | ( | ) |
Gets the trigger condition.
The ownership of the returned trigger condition object is not transferred to the client. The pointer can be used to modify the trigger condition.
Returns: A non-const pointer to the trigger's trigger condition. NULL if the trigger condition is not set.
IMPORT_C const CLbtTriggerConditionBase * | GetCondition | ( | ) | const |
Gets the trigger condition.
The ownership of the returned trigger condition object is not transferred to the client. The pointer can be used to modify the trigger condition.
Returns: A const pointer to the trigger's trigger condition. NULL if the trigger condition is not set.
IMPORT_C void | GetRequestorsL | ( | RRequestorStack & | aRequestors | ) | const |
Gets requestors of the trigger entry.
Requestor information is used by the Location Triggering Server to verify that the user allows location information to be sent to the specified requestors when a trigger fires.
Requestors attribute is a mandatory trigger attribute. If the requestors attribute is not set when the trigger is created in the server, the trigger creation will fail.
If requestors have not been set before, this function returns an empty requestor stack.
Refer to Location Acquisition API for detailed information on requestors.
See also: RLbt::CreateTriggerL() RRequestorStack
Parameter | Description |
---|---|
aRequestors | The requestors of the trigger entry. |
IMPORT_C const TLbtTriggerId & | Id | ( | ) | const |
Gets the trigger ID.
The ID is allocated and set by the Location Triggering Server when a trigger is successfully created. Trigger ID is unique in the system. This function returns KLbtNullTriggerId if the ID is not set before.
Returns: The ID of the trigger entry, or KLbtNullTriggerId if the trigger ID has not been set.
IMPORT_C void | InternalizeL | ( | RReadStream & | aStream | ) |
Internalizes the trigger object's details and attributes from stream.
The presence of this function means that the standard template operator>>() ( defined in s32strm.h ) is available to internalize objects of this class.
Parameter | Description |
---|---|
aStream | Stream from which the object should be internalized. |
IMPORT_C TUid | ManagerUi | ( | ) | const |
Gets UID of the manager UI. The UID means the UID3 value, which identifies the particular application. If the UID of the manager UI is not set, this function returns KNullUid.
Returns: The UID of manager UI application. KNullUid if the UID has not been set.
IMPORT_C const TDesC & | Name | ( | ) | const |
Gets the name of the trigger entry.
If the name is not set, an empty string is returned. Maximum length of the name is KLbtMaxNameLength.
Returns: The name of the trigger entry.
IMPORT_C void | SetCondition | ( | CLbtTriggerConditionBase * | aCondition | ) |
Sets trigger condition.
This object takes the ownership of the trigger condition object.
Parameter | Description |
---|---|
aCondition | Pointer to the new trigger condition object. This object takes the ownership of aCondition. NULL can be used to remove previous setting. |
IMPORT_C void | SetId | ( | TLbtTriggerId | aId | ) |
Sets trigger entry id. SetId is not used during trigger creation as it is auto generated by the LBT server. This information is only used during deletion / modification of triggers. This information when specified during trigger creation, will be ignored by LBT server.
Parameter | Description |
---|---|
aId | The ID of the trigger entry, or KLbtNullTriggerId. |
IMPORT_C void | SetManagerUi | ( | TUid | aUid | ) |
Sets UID of the manager UI.
Parameter | Description |
---|---|
aUid | The SID value if available. Else the UID3 value, which is the idenfifier of the particaular application. KNullUid can be used to remove previous setting. |
IMPORT_C void | SetNameL | ( | const TDesC & | aName | ) |
Sets the name of the trigger entry.
Parameter | Description |
---|---|
aName | The name of the trigger entry. |
IMPORT_C void | SetRequestorL | ( | CRequestor::TRequestorType | aType, |
CRequestor::TRequestorFormat | aFormat, | |||
const TDesC & | aData | |||
) |
Sets requestor of trigger entry.
Requestor information is used by the Location Triggering Server to verify that the user allows information to be sent to the specified requestors when a trigger fires.
Requestors attribute is a mandatory trigger attribute. If the requestors attribute is not set when the trigger is created in the server, the trigger creation will fail.
See also: RLbt::CreateTriggerL()
Parameter | Description |
---|---|
aType | identifies the type of requestor, a service or a contact. |
aFormat | determines the type of data held in aData |
aData | is requestor data. Can be a telephone number, a URL etc. |
IMPORT_C void | SetRequestorsL | ( | const RRequestorStack & | aRequestors | ) |
Sets requestors of trigger entry.
Requestor information is used by the Location Triggering Server to verify that the user allows location information to be sent to the specified requestors when a trigger fires.
Requestors attribute is a mandatory trigger attribute. If the requestors attribute is not set when the trigger is created in the server, the trigger creation will fail.
Refer to Location Acquisition API for detailed information on requestors.
See also: RLbt::CreateTriggerL()
Parameter | Description |
---|---|
aRequestors | The requestors of trigger entry. |
IMPORT_C void | SetState | ( | TLbtTriggerState | aState | ) |
Sets the trigger entry state.
Parameter | Description |
---|---|
aState | The trigger entry state. |
IMPORT_C void | SetTimeToRearm | ( | TInt | aSeconds | ) |
Sets the time interval to reactivate the trigger after the trigger is fired.
Parameter | Description |
---|---|
aSeconds | The time interval after which the trigger is set effective by the Location Triggering Server. Client applications can set 0 to indicate no delay, in which case the trigger will remain effective through out its life span. Range is 0 (KLbtMinTimeToRearm) to +2147483647 (KLbtMaxTimeToRearm) which is +24855 days (approximately 68 years) |
IMPORT_C TLbtTriggerState | State | ( | ) | const |
Gets trigger entry state.
If no state has been set for the trigger, this function returns ELbtTriggerEnabled.
Returns: The trigger entry state.
IMPORT_C TInt | TimeToRearm | ( | ) | const |
Gets the rearm time interval.
If no interval is specified for the trigger, this function returns KLbtDefaultTimeToRearm which is 600s or 10 minutes.
Returns: Rearm time interval.
IMPORT_C TType | Type | ( | ) | const [pure virtual] |
Gets the type of the trigger.
Returns: The type of trigger entry.