epoc32/include/mw/lbtsessiontrigger.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/lbtsessiontrigger.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,238 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Concrete class representing session trigger entries.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef LBTSESSIONTRIGGER_H
    1.23 +#define LBTSESSIONTRIGGER_H
    1.24 +
    1.25 +#include <lbttriggerentry.h>
    1.26 +#include <lbs.h>
    1.27 +
    1.28 +/**
    1.29 + * Concrete class representing session trigger entries.
    1.30 + *
    1.31 + * Session triggers are not stored in persistent
    1.32 + * storage. They are deleted by Location Triggering Server if the 
    1.33 + * client application's subsession to the server is closed 
    1.34 + * or if the client calls RLbt::DeleteTriggerL(). 
    1.35 + *
    1.36 + * Client application shall make request to Location
    1.37 + * Triggering Server to receive session trigger firing event. 
    1.38 + *
    1.39 + * @see RLbt
    1.40 + *
    1.41 + * @lib lbt.lib
    1.42 + *
    1.43 + * @since S60 5.1
    1.44 + */
    1.45 +class CLbtSessionTrigger : public CLbtTriggerEntry
    1.46 +    {
    1.47 +public:
    1.48 +    /**
    1.49 +     * Allocates and constructs a new session trigger entry.
    1.50 +     *
    1.51 +     * In returned object, default values are set to the
    1.52 +     * attributes of the trigger. The default values are
    1.53 +     *  - Trigger Id is KLbtNullTriggerId.
    1.54 +     *
    1.55 +     *  - Trigger Name is an empty string.
    1.56 +     *
    1.57 +     *  - Trigger State is CLbtTriggerEntry::EStateEnabled.
    1.58 +     *  
    1.59 +     *  - Requestors are not set. 
    1.60 +     *
    1.61 +     *  - Manager UI is not set(KNullUid). 
    1.62 +     *
    1.63 +     *  - Trigger condition is not set.
    1.64 +     *
    1.65 +     *
    1.66 +     * @return Pointer to the new session trigger entry.
    1.67 +     */
    1.68 +    IMPORT_C static CLbtSessionTrigger* NewL();
    1.69 +
    1.70 +    /**
    1.71 +     * Allocates and constructs a new session trigger entry. The 
    1.72 +     * constructed object is pushed onto cleanup stack.
    1.73 +     *
    1.74 +     * In returned object, default values are set to the
    1.75 +     * attributes of the trigger. The default values are
    1.76 +     *  - Trigger Id is KLbtNullTriggerId.
    1.77 +     *
    1.78 +     *  - Trigger Name is an empty string.
    1.79 +     *
    1.80 +     *  - Trigger State is CLbtTriggerEntry::EStateEnabled.
    1.81 +     *  
    1.82 +     *  - Requestors are not set. 
    1.83 +     *
    1.84 +     *  - Manager UI is not set(KNullUid). 
    1.85 +     *
    1.86 +     *  - Trigger condition is not set.
    1.87 +     *
    1.88 +     *
    1.89 +     * @return Pointer to the new session trigger entry.
    1.90 +     */
    1.91 +    IMPORT_C static CLbtSessionTrigger* NewLC();
    1.92 +
    1.93 +
    1.94 +    /**
    1.95 +     * Allocates and constructs a new session trigger entry
    1.96 +     * with specified attribute values.
    1.97 +     *
    1.98 +     * @since S60 5.1
    1.99 +     *
   1.100 +     * @param[in] aName The name of the trigger entry.
   1.101 +     * @param[in] aState The state of trigger entry.
   1.102 +     * @param[in] aRequestorType Identifies the type of requestor, 
   1.103 +     * a service or a contact.
   1.104 +     * @param[in] aRequestorFormat Determines the type of data held in 
   1.105 +     * aRequestorData
   1.106 +     * @param[in] aRequestorData Requestor data. Can be a telephone 
   1.107 +     * number, a URL etc.
   1.108 +     * @param[in] aManagerUi The UID of the manager UI application. 
   1.109 +     * @param[in] aCondition Pointer to the new trigger condition object.
   1.110 +     * This object takes the ownership of aCondition.
   1.111 +     * @return Pointer to the new session trigger entry.
   1.112 +     *
   1.113 +     * @leave KErrArgument If the name of the trigger is longer than
   1.114 +     *   @p KLbtMaxNameLength.
   1.115 +     * @leave Other standard symbian error code, such as KErrNoMemory,
   1.116 +     * KErrGeneral, etc.
   1.117 +     */
   1.118 +    IMPORT_C static CLbtSessionTrigger* NewL( 
   1.119 +        const TDesC& aName,
   1.120 +        TLbtTriggerState aState,
   1.121 +        CRequestor::TRequestorType aRequestorType,
   1.122 +        CRequestor::TRequestorFormat aRequestorFormat,
   1.123 +        const TDesC& aRequestorData,
   1.124 +        TUid aManagerUi,
   1.125 +        CLbtTriggerConditionBase* aCondition );
   1.126 +        
   1.127 +    /**
   1.128 +     * Allocates and constructs a new session trigger entry
   1.129 +     * with specified attribute values.
   1.130 +     *
   1.131 +     * @param[in] aName The name of the trigger entry.
   1.132 +     * @param[in] aState The state of trigger entry.
   1.133 +     * @param[in] aRequestors The requestor for the service. This
   1.134 +     * object does not take ownership of aRequestors.
   1.135 +     * @param[in] aManagerUi The UID of manager UI application.
   1.136 +     * @param[in] aCondition Pointer to the new trigger condition object.
   1.137 +     * This object takes the ownership of aCondition.
   1.138 +     * @return Pointer to the new session trigger entry.
   1.139 +     *
   1.140 +     * @leave KErrArgument If the name of the trigger is longer than
   1.141 +     *   @p KLbtMaxNameLength.
   1.142 +     * @leave Other standard symbian error code, such as KErrNoMemory,
   1.143 +     * KErrGeneral, etc.
   1.144 +     */
   1.145 +    IMPORT_C static CLbtSessionTrigger* NewL( 
   1.146 +        const TDesC& aName,
   1.147 +        TLbtTriggerState aState,
   1.148 +        const RRequestorStack& aRequestors,
   1.149 +        TUid aManagerUi,
   1.150 +        CLbtTriggerConditionBase* aCondition );
   1.151 +
   1.152 +    /**
   1.153 +     * Destructor
   1.154 +     */
   1.155 +    IMPORT_C ~CLbtSessionTrigger();
   1.156 +    
   1.157 +    /**
   1.158 +     * Get the type of the trigger entry, CLbtTriggerEntry::ESession.
   1.159 +     *
   1.160 +     * @return CLbtTriggerEntry::ESession.
   1.161 +     */
   1.162 +    IMPORT_C TType Type() const;
   1.163 +    
   1.164 +	
   1.165 +    
   1.166 +protected:
   1.167 +    /**
   1.168 +     * Externalize method that subclass must implement.
   1.169 +     * @param[in] aStream Stream to which the object should be externalized.
   1.170 +     */
   1.171 +    virtual void DoExternalizeL(RWriteStream& aStream) const ;
   1.172 +    
   1.173 +    /**
   1.174 +     * Internalize method that subclass must implement.
   1.175 +     * @param[in] aStream Stream from which the object should be internalized.
   1.176 +     */
   1.177 +    virtual void DoInternalizeL(RReadStream& aStream)  ;
   1.178 +    
   1.179 +
   1.180 +private:
   1.181 +    
   1.182 +    /**
   1.183 +     * Symbian 2nd phase constructor.
   1.184 +     *
   1.185 +     * @param[in] aName The name of the trigger entry.
   1.186 +     * @param[in] aState The state of trigger entry.
   1.187 +     * @param[in] aRequestorType Identifies the type of requestor, 
   1.188 +     * a service or a contact.
   1.189 +     * @param[in] aRequestorFormat Determines the type of data held in 
   1.190 +     * aRequestorData
   1.191 +     * @param[in] aRequestorData Requestor data. Can be a telephone 
   1.192 +     * number, a URL etc.
   1.193 +     * @param[in] aManagerUi The UID of the manager UI application. 
   1.194 +     * @param[in] aCondition Pointer to the new trigger condition object.
   1.195 +     */
   1.196 +    void ConstructL(const TDesC& aName,TLbtTriggerState aState,
   1.197 +        CRequestor::TRequestorType aRequestorType,
   1.198 +        CRequestor::TRequestorFormat aRequestorFormat,
   1.199 +        const TDesC& aRequestorData,
   1.200 +        TUid aManagerUi,
   1.201 +        CLbtTriggerConditionBase* aCondition);
   1.202 +    /**
   1.203 +     * Symbian 2nd phase constructor.
   1.204 +     *
   1.205 +     * @param[in] aName The name of the trigger entry.
   1.206 +     * @param[in] aState The state of trigger entry.
   1.207 +     * @param[in] aRequestor The requestor for the service. This
   1.208 +     * object does not take ownership of aRequestor.
   1.209 +     * @param[in] aManagerUi The UID of manager UI application.
   1.210 +     * @param[in] aCondition Pointer to the new trigger condition object.    
   1.211 +     */
   1.212 +    void ConstructL(const TDesC& aName,
   1.213 +        CLbtTriggerEntry::TLbtTriggerState aState,
   1.214 +        const RRequestorStack& aRequestors,
   1.215 +        TUid aManagerUi,
   1.216 +        CLbtTriggerConditionBase* aCondition);
   1.217 +   
   1.218 +   /**
   1.219 +    * Symbian 2nd phase constructor.
   1.220 +    */     
   1.221 +   void ConstructL();         
   1.222 +   
   1.223 +   /**
   1.224 +    * Default constructor
   1.225 +    */ 
   1.226 +   CLbtSessionTrigger();
   1.227 +   
   1.228 +   /**
   1.229 +    * By default, prohibit copy constructor
   1.230 +    */
   1.231 +   CLbtSessionTrigger(  CLbtSessionTrigger& aEntry);
   1.232 +   
   1.233 +   /**
   1.234 +    * Prohibit assigment operator
   1.235 +    */ 
   1.236 +   CLbtSessionTrigger& operator= ( const CLbtSessionTrigger& );
   1.237 +
   1.238 +    };
   1.239 +
   1.240 +
   1.241 +#endif // LBTSESSIONTRIGGER_H