williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Concrete class representing session trigger entries. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef LBTSESSIONTRIGGER_H williamr@2: #define LBTSESSIONTRIGGER_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: * Concrete class representing session trigger entries. williamr@2: * williamr@2: * Session triggers are not stored in persistent williamr@2: * storage. They are deleted by Location Triggering Server if the williamr@2: * client application's subsession to the server is closed williamr@2: * or if the client calls RLbt::DeleteTriggerL(). williamr@2: * williamr@2: * Client application shall make request to Location williamr@2: * Triggering Server to receive session trigger firing event. williamr@2: * williamr@2: * @see RLbt williamr@2: * williamr@2: * @lib lbt.lib williamr@2: * williamr@2: * @since S60 5.1 williamr@2: */ williamr@2: class CLbtSessionTrigger : public CLbtTriggerEntry williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Allocates and constructs a new session trigger entry. williamr@2: * williamr@2: * In returned object, default values are set to the williamr@2: * attributes of the trigger. The default values are williamr@2: * - Trigger Id is KLbtNullTriggerId. williamr@2: * williamr@2: * - Trigger Name is an empty string. williamr@2: * williamr@2: * - Trigger State is CLbtTriggerEntry::EStateEnabled. williamr@2: * williamr@2: * - Requestors are not set. williamr@2: * williamr@2: * - Manager UI is not set(KNullUid). williamr@2: * williamr@2: * - Trigger condition is not set. williamr@2: * williamr@2: * williamr@2: * @return Pointer to the new session trigger entry. williamr@2: */ williamr@2: IMPORT_C static CLbtSessionTrigger* NewL(); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new session trigger entry. The williamr@2: * constructed object is pushed onto cleanup stack. williamr@2: * williamr@2: * In returned object, default values are set to the williamr@2: * attributes of the trigger. The default values are williamr@2: * - Trigger Id is KLbtNullTriggerId. williamr@2: * williamr@2: * - Trigger Name is an empty string. williamr@2: * williamr@2: * - Trigger State is CLbtTriggerEntry::EStateEnabled. williamr@2: * williamr@2: * - Requestors are not set. williamr@2: * williamr@2: * - Manager UI is not set(KNullUid). williamr@2: * williamr@2: * - Trigger condition is not set. williamr@2: * williamr@2: * williamr@2: * @return Pointer to the new session trigger entry. williamr@2: */ williamr@2: IMPORT_C static CLbtSessionTrigger* NewLC(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new session trigger entry williamr@2: * with specified attribute values. williamr@2: * williamr@2: * @since S60 5.1 williamr@2: * williamr@2: * @param[in] aName The name of the trigger entry. williamr@2: * @param[in] aState The state of trigger entry. williamr@2: * @param[in] aRequestorType Identifies the type of requestor, williamr@2: * a service or a contact. williamr@2: * @param[in] aRequestorFormat Determines the type of data held in williamr@2: * aRequestorData williamr@2: * @param[in] aRequestorData Requestor data. Can be a telephone williamr@2: * number, a URL etc. williamr@2: * @param[in] aManagerUi The UID of the manager UI application. williamr@2: * @param[in] aCondition Pointer to the new trigger condition object. williamr@2: * This object takes the ownership of aCondition. williamr@2: * @return Pointer to the new session trigger entry. williamr@2: * williamr@2: * @leave KErrArgument If the name of the trigger is longer than williamr@2: * @p KLbtMaxNameLength. williamr@2: * @leave Other standard symbian error code, such as KErrNoMemory, williamr@2: * KErrGeneral, etc. williamr@2: */ williamr@2: IMPORT_C static CLbtSessionTrigger* NewL( williamr@2: const TDesC& aName, williamr@2: TLbtTriggerState aState, williamr@2: CRequestor::TRequestorType aRequestorType, williamr@2: CRequestor::TRequestorFormat aRequestorFormat, williamr@2: const TDesC& aRequestorData, williamr@2: TUid aManagerUi, williamr@2: CLbtTriggerConditionBase* aCondition ); williamr@2: williamr@2: /** williamr@2: * Allocates and constructs a new session trigger entry williamr@2: * with specified attribute values. williamr@2: * williamr@2: * @param[in] aName The name of the trigger entry. williamr@2: * @param[in] aState The state of trigger entry. williamr@2: * @param[in] aRequestors The requestor for the service. This williamr@2: * object does not take ownership of aRequestors. williamr@2: * @param[in] aManagerUi The UID of manager UI application. williamr@2: * @param[in] aCondition Pointer to the new trigger condition object. williamr@2: * This object takes the ownership of aCondition. williamr@2: * @return Pointer to the new session trigger entry. williamr@2: * williamr@2: * @leave KErrArgument If the name of the trigger is longer than williamr@2: * @p KLbtMaxNameLength. williamr@2: * @leave Other standard symbian error code, such as KErrNoMemory, williamr@2: * KErrGeneral, etc. williamr@2: */ williamr@2: IMPORT_C static CLbtSessionTrigger* NewL( williamr@2: const TDesC& aName, williamr@2: TLbtTriggerState aState, williamr@2: const RRequestorStack& aRequestors, williamr@2: TUid aManagerUi, williamr@2: CLbtTriggerConditionBase* aCondition ); williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CLbtSessionTrigger(); williamr@2: williamr@2: /** williamr@2: * Get the type of the trigger entry, CLbtTriggerEntry::ESession. williamr@2: * williamr@2: * @return CLbtTriggerEntry::ESession. williamr@2: */ williamr@2: IMPORT_C TType Type() const; williamr@2: williamr@2: williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Externalize method that subclass must implement. williamr@2: * @param[in] aStream Stream to which the object should be externalized. williamr@2: */ williamr@2: virtual void DoExternalizeL(RWriteStream& aStream) const ; williamr@2: williamr@2: /** williamr@2: * Internalize method that subclass must implement. williamr@2: * @param[in] aStream Stream from which the object should be internalized. williamr@2: */ williamr@2: virtual void DoInternalizeL(RReadStream& aStream) ; williamr@2: williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: * williamr@2: * @param[in] aName The name of the trigger entry. williamr@2: * @param[in] aState The state of trigger entry. williamr@2: * @param[in] aRequestorType Identifies the type of requestor, williamr@2: * a service or a contact. williamr@2: * @param[in] aRequestorFormat Determines the type of data held in williamr@2: * aRequestorData williamr@2: * @param[in] aRequestorData Requestor data. Can be a telephone williamr@2: * number, a URL etc. williamr@2: * @param[in] aManagerUi The UID of the manager UI application. williamr@2: * @param[in] aCondition Pointer to the new trigger condition object. williamr@2: */ williamr@2: void ConstructL(const TDesC& aName,TLbtTriggerState aState, williamr@2: CRequestor::TRequestorType aRequestorType, williamr@2: CRequestor::TRequestorFormat aRequestorFormat, williamr@2: const TDesC& aRequestorData, williamr@2: TUid aManagerUi, williamr@2: CLbtTriggerConditionBase* aCondition); williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: * williamr@2: * @param[in] aName The name of the trigger entry. williamr@2: * @param[in] aState The state of trigger entry. williamr@2: * @param[in] aRequestor The requestor for the service. This williamr@2: * object does not take ownership of aRequestor. williamr@2: * @param[in] aManagerUi The UID of manager UI application. williamr@2: * @param[in] aCondition Pointer to the new trigger condition object. williamr@2: */ williamr@2: void ConstructL(const TDesC& aName, williamr@2: CLbtTriggerEntry::TLbtTriggerState aState, williamr@2: const RRequestorStack& aRequestors, williamr@2: TUid aManagerUi, williamr@2: CLbtTriggerConditionBase* aCondition); williamr@2: williamr@2: /** williamr@2: * Symbian 2nd phase constructor. williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Default constructor williamr@2: */ williamr@2: CLbtSessionTrigger(); williamr@2: williamr@2: /** williamr@2: * By default, prohibit copy constructor williamr@2: */ williamr@2: CLbtSessionTrigger( CLbtSessionTrigger& aEntry); williamr@2: williamr@2: /** williamr@2: * Prohibit assigment operator williamr@2: */ williamr@2: CLbtSessionTrigger& operator= ( const CLbtSessionTrigger& ); williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // LBTSESSIONTRIGGER_H