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 void CancelAsyncOperation ( TInt )
IMPORT_C void CreateTrigger ( CLbtContainerTriggerEntry &, TInt &, TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C void DeleteTriggers ( CLbtContainerUpdateFilter *, TInt &, TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C void Destroy ()
IMPORT_C TInt GetCountOfEnabledAndValidTriggers ()
IMPORT_C void GetTriggers (const RArray < TLbtTriggerId > &, RPointerArray < CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C void ListTriggers ( CLbtContainerListOptions *, RPointerArray < CLbtContainerTriggerEntry > &, TInt &, TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C CLbtContainer * NewL ()
IMPORT_C void RemoveObserver ( MLbtContainerChangeEventObserver *)
IMPORT_C void SetChangeObserver ( MLbtContainerChangeEventObserver *, TLbtTriggerEventMask )
IMPORT_C void SetTimeTillCompaction ( TTime )
IMPORT_C void UpdateTriggerFiredState ( RArray < TLbtTriggerId > &, TInt &, TBool , TRequestStatus &)
IMPORT_C void UpdateTriggerL ( CLbtContainerTriggerEntry &, TLbtTriggerDataMask , TLbtTriggerAttributeFieldsMask , TInt &, TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C void UpdateTriggersState ( CLbtTriggerEntry::TLbtTriggerState , CLbtContainerUpdateFilter *, TInt &, TLbtFireOnUpdate , TRequestStatus &, TLbtSecurityPolicy )
IMPORT_C void UpdateTriggersValidity ( TLbtTriggerDynamicInfo::TLbtTriggerValidity , RArray < TLbtTriggerId > &, TInt &, TRequestStatus &, TLbtSecurityPolicy )
Private Member Functions
CLbtContainer ()
CLbtContainer (const CLbtContainer &)
~CLbtContainer ()
void ConstructL ()
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
enum TLbtTriggerChangeEvent {
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 void CancelAsyncOperation ( TInt aOpId )

Cancel Async Operation operation in the container

Parameters

TInt aOpId

ConstructL()

void ConstructL ( ) [private]

Symbian 2nd phase of construction

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

IMPORT_C void CreateTrigger ( CLbtContainerTriggerEntry & aEntry,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 & aEntry This parameter contains trigger information.
TInt & aOpId
TRequestStatus & aStatus Contains 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 void DeleteTriggers ( CLbtContainerUpdateFilter * aFilter,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 * aFilter This parameter specifies the triggers which need to be deleted. The Container will take ownership of the filter paramter.
TInt & aOpId
TRequestStatus & aStatus Contains 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 void Destroy ( ) [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 TInt GetCountOfEnabledAndValidTriggers ( )

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

IMPORT_C void GetTriggers ( const RArray < TLbtTriggerId > & aTriggerIds,
RPointerArray < CLbtContainerTriggerEntry > & aTriggers,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 > & aTriggerIds the trigger ids which have to be retreived
RPointerArray < CLbtContainerTriggerEntry > & aTriggers
TInt & aOpId the operation identifier
TRequestStatus & aStatus Contains the error code once the operation is completed.
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

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

IMPORT_C void ListTriggers ( CLbtContainerListOptions * aListOptions,
RPointerArray < CLbtContainerTriggerEntry > & aTriggers,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 * aListOptions Specifies 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 > & aTriggers An 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 & aStatus Contains 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 void RemoveObserver ( 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 * aObserver This parameter specifies the observer that has to be de-registered. The Container doesn't take onwership of this parameter.

SetChangeObserver(MLbtContainerChangeEventObserver *, TLbtTriggerEventMask)

IMPORT_C void SetChangeObserver ( MLbtContainerChangeEventObserver * aObserver,
TLbtTriggerEventMask aEventMask
)

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 * aObserver This 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 aEventMask This parameter specifies the specific events for which the client wants to obtain notifications

SetTimeTillCompaction(TTime)

IMPORT_C void SetTimeTillCompaction ( TTime aTime )

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 aTime the time untill which compaction can proceed without effecting the system

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

IMPORT_C void UpdateTriggerFiredState ( RArray < TLbtTriggerId > & aTriggerIds,
TInt & aOpId,
TBool aFireBool,
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 > & aTriggerIds an array containing the trigger ids whose fired state needs to be updated
TInt & aOpId the operation identifier
TBool aFireBool the state to which the fires state has to be updated
TRequestStatus & aStatus the request status of the client

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

IMPORT_C void UpdateTriggerL ( CLbtContainerTriggerEntry & aEntry,
TLbtTriggerDataMask aDataMask,
TLbtTriggerAttributeFieldsMask aAttrMask,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 & aEntry refrence to the trigger entry whose fields have to be changed
TLbtTriggerDataMask aDataMask the mask of the data fields that have to be changed
TLbtTriggerAttributeFieldsMask aAttrMask the mask of the attribute fields that have to be changed
TInt & aOpId the operation identifier
TRequestStatus & aStatus the request status of the client
TLbtSecurityPolicy aSecurityPolicy = KLbtNullSecurity

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

IMPORT_C void UpdateTriggersState ( CLbtTriggerEntry::TLbtTriggerState aState,
CLbtContainerUpdateFilter * aFilter,
TInt & aOpId,
TLbtFireOnUpdate aFireOnUpdate,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 aState This parameter specifies the state to which the trigger should be set to.
CLbtContainerUpdateFilter * aFilter This 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 & aStatus Contains 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 void UpdateTriggersValidity ( TLbtTriggerDynamicInfo::TLbtTriggerValidity aValidity,
RArray < TLbtTriggerId > & aTriggerIds,
TInt & aOpId,
TRequestStatus & aStatus,
TLbtSecurityPolicy aSecurityPolicy = 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 aValidity This parameter specifies the validity to which the trigger should be set to.
RArray < TLbtTriggerId > & aTriggerIds
TInt & aOpId
TRequestStatus & aStatus Contains 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