CLbtTriggerEntry Class Reference

#include <mw/lbttriggerentry.h>

Link against: lbt.lib

class CLbtTriggerEntry : public CBase

Inherits from

  • CLbtTriggerEntry

    Detailed Description

    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.

    Since
    S60 5.1

    Member Enumeration 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.

    EnumeratorValueDescription
    EAttributeId0x0001

    Trigger Id

    EAttributeName0x0002

    Trigger name

    EAttributeState0x0004

    Trigger state

    EAttributeRequestor0x0008

    Trigger requestor

    EAttributeManagerUi0x0010

    Trigger manager UI

    EAttributeRearmTime0x0020

    Trigger rearm time

    EAttributeCondition0x0080

    Trigger condition

    EAttributeStartUpProcessId0x0100

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

    EAttributeStartUpCommandLine0x0200

    Command-line argument string for start-up trigger

    Enum TLbtTriggerState

    Specifies the state of a trigger.

    EnumeratorValueDescription
    EStateEnabled1

    The trigger is enabled

    EStateDisabled2

    The trigger is disabled

    Enum TType

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

    EnumeratorValueDescription
    ETypeSession1

    Session trigger

    ETypeStartup2

    Start-up trigger

    Constructor & Destructor Documentation

    CLbtTriggerEntry ( )

    CLbtTriggerEntry()[protected]

    Constructor.

    ~CLbtTriggerEntry ( )

    IMPORT_C~CLbtTriggerEntry()[virtual]

    Destructor

    Member Function Documentation

    DoExternalizeL ( RWriteStream & )

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

    Externalize method that subclass must implement.

    ParameterDescription
    aStreamStream to which the object should be externalized.

    DoInternalizeL ( RReadStream & )

    voidDoInternalizeL(RReadStream &aStream)[protected, pure virtual]

    Internalize method that subclass must implement.

    ParameterDescription
    aStreamStream from which the object should be internalized.

    ExternalizeL ( RWriteStream & )

    IMPORT_C voidExternalizeL(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.

    ParameterDescription
    aStreamStream 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.

    Returns: A non-const pointer to the trigger's trigger condition. NULL if the trigger condition is not set.

    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.

    Returns: A const pointer to the trigger's trigger condition. NULL if the trigger condition is not set.

    GetRequestorsL ( RRequestorStack & )

    IMPORT_C voidGetRequestorsL(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

    ParameterDescription
    aRequestorsThe 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.

    Returns: The ID of the trigger entry, or KLbtNullTriggerId if the trigger ID has not been set.

    InternalizeL ( RReadStream & )

    IMPORT_C voidInternalizeL(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.

    ParameterDescription
    aStreamStream from which the object should be internalized.

    ManagerUi ( )

    IMPORT_C TUidManagerUi()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.

    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.

    Returns: The name of the trigger entry.

    SetCondition ( CLbtTriggerConditionBase * )

    IMPORT_C voidSetCondition(CLbtTriggerConditionBase *aCondition)

    Sets trigger condition.

    This object takes the ownership of the trigger condition object.

    ParameterDescription
    aConditionPointer 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 voidSetId(TLbtTriggerIdaId)

    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.

    ParameterDescription
    aIdThe ID of the trigger entry, or KLbtNullTriggerId.

    SetManagerUi ( TUid )

    IMPORT_C voidSetManagerUi(TUidaUid)

    Sets UID of the manager UI.

    ParameterDescription
    aUidThe 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 voidSetNameL(const TDesC &aName)

    Sets the name of the trigger entry.

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

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

    IMPORT_C voidSetRequestorL(CRequestor::TRequestorTypeaType,
    CRequestor::TRequestorFormataFormat,
    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()

    ParameterDescription
    aTypeidentifies the type of requestor, a service or a contact.
    aFormatdetermines the type of data held in aData
    aDatais requestor data. Can be a telephone number, a URL etc.

    SetRequestorsL ( const RRequestorStack & )

    IMPORT_C voidSetRequestorsL(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()

    leave
    KErrArgument The stack contains no requestors.
    ParameterDescription
    aRequestorsThe requestors of trigger entry.

    SetState ( TLbtTriggerState )

    IMPORT_C voidSetState(TLbtTriggerStateaState)

    Sets the trigger entry state.

    ParameterDescription
    aStateThe trigger entry state.

    SetTimeToRearm ( TInt )

    IMPORT_C voidSetTimeToRearm(TIntaSeconds)

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

    panic
    KErrArgument If the time set is out of range.
    ParameterDescription
    aSecondsThe 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 TLbtTriggerStateState()const

    Gets trigger entry state.

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

    Returns: The trigger entry state.

    TimeToRearm ( )

    IMPORT_C TIntTimeToRearm()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.

    Type ( )

    IMPORT_C TTypeType()const [pure virtual]

    Gets the type of the trigger.

    Returns: The type of trigger entry.