CLbtContainer Class Reference

class CLbtContainer : public CBase

This class provides the inteface to access the functionality of the Location Triggering Container.

The CLbtContainer is a singleton class. The same instance is shared by all the components in the subsystem.

The inteface provides the following functionality,
  • Create a Session or Startup trigger

  • Modify the static or dynamic information of a trigger

  • Delete one or more triggers based on filters.

  • Retrieve information on one or more triggers based on filters.

lbtcontainer.lib
Since
S60 v4.0

Inherits from

Public Member Functions
IMPORT_C voidCancelAsyncOperation(TInt)
IMPORT_C voidCreateTrigger(CLbtContainerTriggerEntry &, TInt &, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C voidDeleteTriggers(CLbtContainerUpdateFilter *, TInt &, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C voidDestroy()
IMPORT_C TIntGetCountOfEnabledAndValidTriggers()
IMPORT_C voidGetTriggers(const RArray< TLbtTriggerId > &, RPointerArray< CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C voidListTriggers(CLbtContainerListOptions *, RPointerArray< CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C CLbtContainer *NewL()
IMPORT_C voidRemoveObserver(MLbtContainerChangeEventObserver *)
IMPORT_C voidSetChangeObserver(MLbtContainerChangeEventObserver *, TLbtTriggerEventMask)
IMPORT_C voidSetTimeTillCompaction(TTime)
IMPORT_C voidUpdateTriggerFiredState(RArray< TLbtTriggerId > &, TInt &, TBool, TRequestStatus &)
IMPORT_C voidUpdateTriggerL(CLbtContainerTriggerEntry &, TLbtTriggerDataMask, TLbtTriggerAttributeFieldsMask, TInt &, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C voidUpdateTriggersState(CLbtTriggerEntry::TLbtTriggerState, CLbtContainerUpdateFilter *, TInt &, TLbtFireOnUpdate, TRequestStatus &, TLbtSecurityPolicy)
IMPORT_C voidUpdateTriggersValidity(TLbtTriggerDynamicInfo::TLbtTriggerValidity, RArray< TLbtTriggerId > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)
Private Member Functions
CLbtContainer()
CLbtContainer(const CLbtContainer &)
~CLbtContainer()
voidConstructL()
TInt GenerateRandomOpCode()
CLbtContainer &operator=(const CLbtContainer &)
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
enumTLbtTriggerChangeEvent {
ELbtConTriggerCreated = 0x0001, ELbtConTriggerDeleted = 0x0002, ELbtConTriggerNameFieldChanged = 0x0004, ELbtConTriggerStateFieldChanged = 0x0008, ELbtConTriggerRequestorFieldChanged = 0x0010, ELbtConTriggerManagerUiFieldChanged = 0x0020, ELbtConTriggerConditionFieldChanged = 0x0040, ELbtConTriggerStartupFieldChanged = 0x0080, ELbtConTriggerHysteresisFieldChanged = 0x0100, ELbtConTriggerRectAreaFieldChanged = 0x0200, ELbtConTriggerFiredFieldChanged = 0x0400, ELbtConTriggerStrategyDataFieldChanged = 0x0800, ELbtConTriggerValidityFieldChanged = 0x1000, ELbtConTriggerFireOnCreationFieldChanged = 0x2000, ELbtConTriggerEnabledAndValidCreated = 0x4000
}
Private Attributes
CLbtContainerAO *iContainerAO
CLbtContainer *iContainerInstance
RArray< TLbtTriggerStoreChangeObserver >iObservers
TInt64 iRandNumRef
TInt iRefCount
TLbtTriggerId iTrigId
CLbtTriggerIdGenerator *iTrigIdGenerator
RPointerArray< MLbtTriggerStore >iTriggerStores

Constructor & Destructor Documentation

CLbtContainer()

CLbtContainer()[private]

C++ constructor

CLbtContainer(const CLbtContainer &)

CLbtContainer(const CLbtContainer &aContainer)[private]

C++ Copy Constructor The private copy constructor prevents the usage of copy constructors with this class.

Parameters

const CLbtContainer & aContainer

~CLbtContainer()

~CLbtContainer()[private, virtual]

Destructor.

Member Functions Documentation

CancelAsyncOperation(TInt)

IMPORT_C voidCancelAsyncOperation(TIntaOpId)

Cancel Async Operation operation in the container

Parameters

TInt aOpId

ConstructL()

voidConstructL()[private]

Symbian 2nd phase of construction

CreateTrigger(CLbtContainerTriggerEntry &, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidCreateTrigger(CLbtContainerTriggerEntry &aEntry,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Create a trigger in the Container. Both session and startup triggers are created using this method. This is an synchronous method call.

Parameters

CLbtContainerTriggerEntry & aEntryThis parameter contains trigger information.
TInt & aOpId
TRequestStatus & aStatusContains the error code once the operation is completed. The value can be,any Symbian error code.KErrNoMemory if the trigger was not created because of low memoryKErrDiskFull if the startup trigger was not created because of low disk space.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

DeleteTriggers(CLbtContainerUpdateFilter *, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidDeleteTriggers(CLbtContainerUpdateFilter *aFilter,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Asynchronous delete triggers in the Container based on a filter. Both session and startup triggers can be deleted using this method.

Note:

The Filter can specify a list of trigger Ids. Hence using this method it is possible to delete a list of triggers.

Parameters

CLbtContainerUpdateFilter * aFilterThis parameter specifies the triggers which need to be deleted. The Container will take ownership of the filter paramter.
TInt & aOpId
TRequestStatus & aStatusContains the error code once the operation is completed.The value can be,KErrNotFound if the filter does not match any triggerany other Symbian error code.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

Destroy()

IMPORT_C voidDestroy()[static]

Destroy the Container Instance. Since this class is a singleton class, this does not necessarily destroy the Container instance.

GenerateRandomOpCode()

TInt GenerateRandomOpCode()[private]

Generates op code to identify requests

GetCountOfEnabledAndValidTriggers()

IMPORT_C TIntGetCountOfEnabledAndValidTriggers()

GetTriggers(const RArray< TLbtTriggerId > &, RPointerArray< CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidGetTriggers(const RArray< TLbtTriggerId > &aTriggerIds,
RPointerArray< CLbtContainerTriggerEntry > &aTriggers,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Retreives the specified triggers from the database. Both session and startup triggers are retreived by this API. The triggers are retreived asynchronously

Parameters

const RArray< TLbtTriggerId > & aTriggerIdsthe trigger ids which have to be retreived
RPointerArray< CLbtContainerTriggerEntry > & aTriggers
TInt & aOpIdthe operation identifier
TRequestStatus & aStatusContains the error code once the operation is completed.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

ListTriggers(CLbtContainerListOptions *, RPointerArray< CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidListTriggers(CLbtContainerListOptions *aListOptions,
RPointerArray< CLbtContainerTriggerEntry > &aTriggers,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

List triggers in the Container. The session and startup triggers can be deleted using this method.

Note:

The Filter can specify a list of trigger Ids. Hence using this method it is possible to delete a list of triggers.

Parameters

CLbtContainerListOptions * aListOptionsSpecifies the options used for listing triggers. Default value is NULL, which will retrieve all triggers owned by the client application. The Container will take ownership of the list options paramter.
RPointerArray< CLbtContainerTriggerEntry > & aTriggersAn Array of trigger entry objects. It contains the triggers that match the specified criteria. The ownership of the trigger entry objects in the array is transferred to the client.
TInt & aOpId
TRequestStatus & aStatusContains the error code once the operation is completed.The value can be,KErrNotFound if the filter does not match any triggerany other Symbian error code.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

NewL()

IMPORT_C CLbtContainer *NewL()[static]

The Symbian 2 phase constructor. This method does not create new instances of the container. It creates an instance the first time and then returns the same instance.

RemoveObserver(MLbtContainerChangeEventObserver *)

IMPORT_C voidRemoveObserver(MLbtContainerChangeEventObserver *aObserver)

De-register request for container trigger store change notification.

Note:

The observer will be not notified when a change occurs in the Container in future.

Parameters

MLbtContainerChangeEventObserver * aObserverThis parameter specifies the observer that has to be de-registered. The Container doesn't take onwership of this parameter.

SetChangeObserver(MLbtContainerChangeEventObserver *, TLbtTriggerEventMask)

IMPORT_C voidSetChangeObserver(MLbtContainerChangeEventObserver *aObserver,
TLbtTriggerEventMaskaEventMask
)

Register for notifications when the container trigger store changes. The parameters specify the events for which the observer can choose to get notification.

Note:

the client should implement the observer methods to obtain the events.

Parameters

MLbtContainerChangeEventObserver * aObserverThis parameter specifies the observer for the events. The observer will be notified when ever a change occurs in the Container. The container does not take ownership of this parameter.
TLbtTriggerEventMask aEventMaskThis parameter specifies the specific events for which the client wants to obtain notifications

SetTimeTillCompaction(TTime)

IMPORT_C voidSetTimeTillCompaction(TTimeaTime)

Used to set the time till when compaction is preferred. Over the time specified compaction should not happed in ideal cases. As and when compaction happens this time is check to see that compaction does not over shoot this time interval

Parameters

TTime aTimethe time untill which compaction can proceed without effecting the system

UpdateTriggerFiredState(RArray< TLbtTriggerId > &, TInt &, TBool, TRequestStatus &)

IMPORT_C voidUpdateTriggerFiredState(RArray< TLbtTriggerId > &aTriggerIds,
TInt &aOpId,
TBoolaFireBool,
TRequestStatus &aStatus
)

Modify the trigger fire state.The fires state of both session and startup triggers can be modified using this method.

Parameters

RArray< TLbtTriggerId > & aTriggerIdsan array containing the trigger ids whose fired state needs to be updated
TInt & aOpIdthe operation identifier
TBool aFireBoolthe state to which the fires state has to be updated
TRequestStatus & aStatusthe request status of the client

UpdateTriggerL(CLbtContainerTriggerEntry &, TLbtTriggerDataMask, TLbtTriggerAttributeFieldsMask, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidUpdateTriggerL(CLbtContainerTriggerEntry &aEntry,
TLbtTriggerDataMaskaDataMask,
TLbtTriggerAttributeFieldsMaskaAttrMask,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Modifies the fields of a particular trigger in container. The fields of both session and startup triggers can be changed using this method.

leave
KErrNoMemory The trigger was not updated because of low memory
leave
KErrDiskFull The trigger was not updated because of low disk space. This happens when the commandline or the name of the trigger is updated and there is no disk space for the update.
Note:

The Update Trigger potentially allows modification for any trigger attribute except the trigger ID. The Container does not perform any checks regarding non modifiable attributes.

Parameters

CLbtContainerTriggerEntry & aEntryrefrence to the trigger entry whose fields have to be changed
TLbtTriggerDataMask aDataMaskthe mask of the data fields that have to be changed
TLbtTriggerAttributeFieldsMask aAttrMaskthe mask of the attribute fields that have to be changed
TInt & aOpIdthe operation identifier
TRequestStatus & aStatusthe request status of the client
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

UpdateTriggersState(CLbtTriggerEntry::TLbtTriggerState, CLbtContainerUpdateFilter *, TInt &, TLbtFireOnUpdate, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidUpdateTriggersState(CLbtTriggerEntry::TLbtTriggerStateaState,
CLbtContainerUpdateFilter *aFilter,
TInt &aOpId,
TLbtFireOnUpdateaFireOnUpdate,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Modify the state of triggers in the Container. The state of both session and startup triggers can be modified using this method.

Note:

The Update Trigger potentially allows modification for any trigger attribute except the trigger ID. The Container does not perform any checks regarding non modifiable attributes.

The Filter can specify a list of trigger Ids. Hence using this method it is possible to enable or disable a list of triggers.

Parameters

CLbtTriggerEntry::TLbtTriggerState aStateThis parameter specifies the state to which the trigger should be set to.
CLbtContainerUpdateFilter * aFilterThis parameter specifies the triggers for which the state has to be changed. The Container will take ownership of the filter paramter.
TInt & aOpId
TLbtFireOnUpdate aFireOnUpdate
TRequestStatus & aStatusContains the error code once the operation is completed. The value can be any Symbian error code.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

UpdateTriggersValidity(TLbtTriggerDynamicInfo::TLbtTriggerValidity, RArray< TLbtTriggerId > &, TInt &, TRequestStatus &, TLbtSecurityPolicy)

IMPORT_C voidUpdateTriggersValidity(TLbtTriggerDynamicInfo::TLbtTriggerValidityaValidity,
RArray< TLbtTriggerId > &aTriggerIds,
TInt &aOpId,
TRequestStatus &aStatus,
TLbtSecurityPolicyaSecurityPolicy = KLbtNullSecurity
)

Modify the validity of triggers in the Container. The validity attribute of both session and startup triggers can be modified using this method.

Note:

The Update Trigger potentially allows modification for any trigger attribute except the trigger ID. The Container does not perform any checks regarding non modifiable attributes.

The Filter can specify a list of trigger Ids. Hence using this method it is possible to set a list of triggers to valid or invalid.

Parameters

TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidityThis parameter specifies the validity to which the trigger should be set to.
RArray< TLbtTriggerId > & aTriggerIds
TInt & aOpId
TRequestStatus & aStatusContains the error code once the operation is completed.The value can be any Symbian error code.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

operator=(const CLbtContainer &)

CLbtContainer &operator=(const CLbtContainer &aContainer)[private]

Overload equality operator The private overload of the equality operator prevents the usage of equality operator with this class.

Parameters

const CLbtContainer & aContainer

Member Enumerations Documentation

Enum TLbtTriggerChangeEvent

enumerator to specify the different trigger store events .

Enumerators

ELbtConTriggerCreated = 0x0001
ELbtConTriggerDeleted = 0x0002
ELbtConTriggerNameFieldChanged = 0x0004
ELbtConTriggerStateFieldChanged = 0x0008
ELbtConTriggerRequestorFieldChanged = 0x0010
ELbtConTriggerManagerUiFieldChanged = 0x0020
ELbtConTriggerConditionFieldChanged = 0x0040
ELbtConTriggerStartupFieldChanged = 0x0080
ELbtConTriggerHysteresisFieldChanged = 0x0100
ELbtConTriggerRectAreaFieldChanged = 0x0200
ELbtConTriggerFiredFieldChanged = 0x0400
ELbtConTriggerStrategyDataFieldChanged = 0x0800
ELbtConTriggerValidityFieldChanged = 0x1000
ELbtConTriggerFireOnCreationFieldChanged = 0x2000
ELbtConTriggerEnabledAndValidCreated = 0x4000

Member Data Documentation

CLbtContainerAO * iContainerAO

CLbtContainerAO *iContainerAO[private]

CLbtContainer * iContainerInstance

CLbtContainer *iContainerInstance[private, static]

Pointer to an instance of this class. Owns

RArray< TLbtTriggerStoreChangeObserver > iObservers

RArray< TLbtTriggerStoreChangeObserver >iObservers[private]

Array of Trigger Store Change Observers. Owns

TInt64 iRandNumRef

TInt64 iRandNumRef[private]

TInt iRefCount

TInt iRefCount[private, static]

variable to maintain usage reference count for the shared instance of this class.

TLbtTriggerId iTrigId

TLbtTriggerId iTrigId[private]

CLbtTriggerIdGenerator * iTrigIdGenerator

CLbtTriggerIdGenerator *iTrigIdGenerator[private]

RPointerArray< MLbtTriggerStore > iTriggerStores

RPointerArray< MLbtTriggerStore >iTriggerStores[private]

Array of Pointers to Trigger Store Managers. Owns