CLbtTriggerEntry Class Reference

class CLbtTriggerEntry : public CBase

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.

lbt.lib
Since
S60 5.1

Inherits from

Public Member Functions
~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 ()
IMPORT_C TType Type ()
Protected Member Functions
CLbtTriggerEntry ()
void DoExternalizeL ( RWriteStream &)
void DoInternalizeL ( RReadStream &)
Private Member Functions
CLbtTriggerEntry (const CLbtTriggerEntry &)
CLbtTriggerEntry & operator= (const CLbtTriggerEntry &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TAttribute {
EAttributeId  = 0x0001, EAttributeName  = 0x0002, EAttributeState  = 0x0004, EAttributeRequestor  = 0x0008, EAttributeManagerUi  = 0x0010, EAttributeRearmTime  = 0x0020, EAttributeCondition  = 0x0080, EAttributeStartUpProcessId  = 0x0100, EAttributeStartUpCommandLine  = 0x0200
}
enum TLbtTriggerState { EStateEnabled  = 1, EStateDisabled  = 2 }
enum TType { ETypeSession  = 1, ETypeStartup  = 2 }
Private Attributes
TLbtTriggerId iId
TUid iManagerUi
HBufC * iName
TInt iRearmTime
RRequestorStack iRequestor
TAny * iReserved
TAny * iSchedule
TLbtTriggerState iState
CLbtTriggerConditionBase * iTriggerCondition

Constructor & Destructor Documentation

CLbtTriggerEntry()

CLbtTriggerEntry ( ) [protected]

Constructor.

CLbtTriggerEntry(const CLbtTriggerEntry &)

CLbtTriggerEntry ( const CLbtTriggerEntry & ) [private]

By default, prohibit copy constructor

Parameters

const CLbtTriggerEntry &

~CLbtTriggerEntry()

IMPORT_C ~CLbtTriggerEntry ( ) [virtual]

Destructor

Member Functions Documentation

DoExternalizeL(RWriteStream &)

void DoExternalizeL ( RWriteStream & aStream ) const [protected, pure virtual]

Externalize method that subclass must implement.

Parameters

RWriteStream & aStream Stream to which the object should be externalized.

DoInternalizeL(RReadStream &)

void DoInternalizeL ( RReadStream & aStream ) [protected, pure virtual]

Internalize method that subclass must implement.

Parameters

RReadStream & aStream Stream from which the object should be internalized.

ExternalizeL(RWriteStream &)

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.

Parameters

RWriteStream & aStream Stream to which the object should be externalized.

GetCondition()

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.

GetCondition()

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.

GetRequestorsL(RRequestorStack &)

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.

RLbt::CreateTriggerL() RRequestorStack

Parameters

RRequestorStack & aRequestors The requestors of the trigger entry.

Id()

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.

InternalizeL(RReadStream &)

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.

Parameters

RReadStream & aStream Stream from which the object should be internalized.

ManagerUi()

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.

Name()

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 .

SetCondition(CLbtTriggerConditionBase *)

IMPORT_C void SetCondition ( CLbtTriggerConditionBase * aCondition )

Sets trigger condition.

This object takes the ownership of the trigger condition object.

Parameters

CLbtTriggerConditionBase * aCondition Pointer to the new trigger condition object. This object takes the ownership of aCondition. NULL can be used to remove previous setting.

SetId(TLbtTriggerId)

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.

Parameters

TLbtTriggerId aId The ID of the trigger entry, or KLbtNullTriggerId.

SetManagerUi(TUid)

IMPORT_C void SetManagerUi ( TUid aUid )

Sets UID of the manager UI.

Parameters

TUid 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.

SetNameL(const TDesC &)

IMPORT_C void SetNameL ( const TDesC & aName )

Sets the name of the trigger entry.

leave
KErrArgument If the name of the trigger is longer than KLbtMaxNameLength .

Parameters

const TDesC & aName The name of the trigger entry.

SetRequestorL(CRequestor::TRequestorType, CRequestor::TRequestorFormat, const TDesC &)

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.

RLbt::CreateTriggerL()

Parameters

CRequestor::TRequestorType aType identifies the type of requestor, a service or a contact.
CRequestor::TRequestorFormat aFormat determines the type of data held in aData
const TDesC & aData is requestor data. Can be a telephone number, a URL etc.

SetRequestorsL(const RRequestorStack &)

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.

RLbt::CreateTriggerL()
leave
KErrArgument The stack contains no requestors.

Parameters

const RRequestorStack & aRequestors The requestors of trigger entry.

SetState(TLbtTriggerState)

IMPORT_C void SetState ( TLbtTriggerState aState )

Sets the trigger entry state.

Parameters

TLbtTriggerState aState The trigger entry state.

SetTimeToRearm(TInt)

IMPORT_C void SetTimeToRearm ( TInt aSeconds )

Sets the time interval to reactivate the trigger after the trigger is fired.

panic
KErrArgument If the time set is out of range.

Parameters

TInt 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)

State()

IMPORT_C TLbtTriggerState State ( ) const

Gets trigger entry state.

If no state has been set for the trigger, this function returns ELbtTriggerEnabled .

TimeToRearm()

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.

Type()

IMPORT_C TType Type ( ) const [pure virtual]

Gets the type of the trigger.

operator=(const CLbtTriggerEntry &)

CLbtTriggerEntry & operator= ( const CLbtTriggerEntry & ) [private]

Prohibit assigment operator

Parameters

const CLbtTriggerEntry &

Member Enumerations Documentation

Enum TAttribute

Trigger attributes identifications.

These ids can be combined and used to form an attribute mask when retrieving partial attributes from Location Triggering Server.

Enumerators

EAttributeId = 0x0001

Trigger Id

EAttributeName = 0x0002

Trigger name

EAttributeState = 0x0004

Trigger state

EAttributeRequestor = 0x0008

Trigger requestor

EAttributeManagerUi = 0x0010

Trigger manager UI

EAttributeRearmTime = 0x0020

Trigger rearm time

EAttributeCondition = 0x0080

Trigger condition

EAttributeStartUpProcessId = 0x0100

Process ID of start-up trigger. It includes process executable name and process UID type.

EAttributeStartUpCommandLine = 0x0200

Command-line argument string for start-up trigger

Enum TLbtTriggerState

Specifies the state of a trigger.

Enumerators

EStateEnabled = 1

The trigger is enabled

EStateDisabled = 2

The trigger is disabled

Enum TType

Trigger type definition. It defines the type of the trigger entry.

Enumerators

ETypeSession = 1

Session trigger

ETypeStartup = 2

Start-up trigger

Member Data Documentation

TLbtTriggerId iId

TLbtTriggerId iId [private]

Id

TUid iManagerUi

TUid iManagerUi [private]

manager UI

HBufC * iName

HBufC * iName [private]

Name

TInt iRearmTime

TInt iRearmTime [private]

Rearm time

RRequestorStack iRequestor

RRequestorStack iRequestor [private]

Requestors

TAny * iReserved

TAny * iReserved [private]

Reserved pointer for future extension

TAny * iSchedule

TAny * iSchedule [private]

Reserved for schedule information

TLbtTriggerState iState

TLbtTriggerState iState [private]

State

CLbtTriggerConditionBase * iTriggerCondition

CLbtTriggerConditionBase * iTriggerCondition [private]

Trigger condition