locsrv_pub/location_triggering_api/inc/lbtsessiontrigger.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Concrete class representing session trigger entries.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef LBTSESSIONTRIGGER_H
       
    20 #define LBTSESSIONTRIGGER_H
       
    21 
       
    22 #include <lbttriggerentry.h>
       
    23 #include <lbs.h>
       
    24 
       
    25 /**
       
    26  * Concrete class representing session trigger entries.
       
    27  *
       
    28  * Session triggers are not stored in persistent
       
    29  * storage. They are deleted by Location Triggering Server if the 
       
    30  * client application's subsession to the server is closed 
       
    31  * or if the client calls RLbt::DeleteTriggerL(). 
       
    32  *
       
    33  * Client application shall make request to Location
       
    34  * Triggering Server to receive session trigger firing event. 
       
    35  *
       
    36  * @see RLbt
       
    37  *
       
    38  * @lib lbt.lib
       
    39  *
       
    40  * @since S60 5.1
       
    41  */
       
    42 class CLbtSessionTrigger : public CLbtTriggerEntry
       
    43     {
       
    44 public:
       
    45     /**
       
    46      * Allocates and constructs a new session trigger entry.
       
    47      *
       
    48      * In returned object, default values are set to the
       
    49      * attributes of the trigger. The default values are
       
    50      *  - Trigger Id is KLbtNullTriggerId.
       
    51      *
       
    52      *  - Trigger Name is an empty string.
       
    53      *
       
    54      *  - Trigger State is CLbtTriggerEntry::EStateEnabled.
       
    55      *  
       
    56      *  - Requestors are not set. 
       
    57      *
       
    58      *  - Manager UI is not set(KNullUid). 
       
    59      *
       
    60      *  - Trigger condition is not set.
       
    61      *
       
    62      *
       
    63      * @return Pointer to the new session trigger entry.
       
    64      */
       
    65     IMPORT_C static CLbtSessionTrigger* NewL();
       
    66 
       
    67     /**
       
    68      * Allocates and constructs a new session trigger entry. The 
       
    69      * constructed object is pushed onto cleanup stack.
       
    70      *
       
    71      * In returned object, default values are set to the
       
    72      * attributes of the trigger. The default values are
       
    73      *  - Trigger Id is KLbtNullTriggerId.
       
    74      *
       
    75      *  - Trigger Name is an empty string.
       
    76      *
       
    77      *  - Trigger State is CLbtTriggerEntry::EStateEnabled.
       
    78      *  
       
    79      *  - Requestors are not set. 
       
    80      *
       
    81      *  - Manager UI is not set(KNullUid). 
       
    82      *
       
    83      *  - Trigger condition is not set.
       
    84      *
       
    85      *
       
    86      * @return Pointer to the new session trigger entry.
       
    87      */
       
    88     IMPORT_C static CLbtSessionTrigger* NewLC();
       
    89 
       
    90 
       
    91     /**
       
    92      * Allocates and constructs a new session trigger entry
       
    93      * with specified attribute values.
       
    94      *
       
    95      * @since S60 5.1
       
    96      *
       
    97      * @param[in] aName The name of the trigger entry.
       
    98      * @param[in] aState The state of trigger entry.
       
    99      * @param[in] aRequestorType Identifies the type of requestor, 
       
   100      * a service or a contact.
       
   101      * @param[in] aRequestorFormat Determines the type of data held in 
       
   102      * aRequestorData
       
   103      * @param[in] aRequestorData Requestor data. Can be a telephone 
       
   104      * number, a URL etc.
       
   105      * @param[in] aManagerUi The UID of the manager UI application. 
       
   106      * @param[in] aCondition Pointer to the new trigger condition object.
       
   107      * This object takes the ownership of aCondition.
       
   108      * @return Pointer to the new session trigger entry.
       
   109      *
       
   110      * @leave KErrArgument If the name of the trigger is longer than
       
   111      *   @p KLbtMaxNameLength.
       
   112      * @leave Other standard symbian error code, such as KErrNoMemory,
       
   113      * KErrGeneral, etc.
       
   114      */
       
   115     IMPORT_C static CLbtSessionTrigger* NewL( 
       
   116         const TDesC& aName,
       
   117         TLbtTriggerState aState,
       
   118         CRequestor::TRequestorType aRequestorType,
       
   119         CRequestor::TRequestorFormat aRequestorFormat,
       
   120         const TDesC& aRequestorData,
       
   121         TUid aManagerUi,
       
   122         CLbtTriggerConditionBase* aCondition );
       
   123         
       
   124     /**
       
   125      * Allocates and constructs a new session trigger entry
       
   126      * with specified attribute values.
       
   127      *
       
   128      * @param[in] aName The name of the trigger entry.
       
   129      * @param[in] aState The state of trigger entry.
       
   130      * @param[in] aRequestors The requestor for the service. This
       
   131      * object does not take ownership of aRequestors.
       
   132      * @param[in] aManagerUi The UID of manager UI application.
       
   133      * @param[in] aCondition Pointer to the new trigger condition object.
       
   134      * This object takes the ownership of aCondition.
       
   135      * @return Pointer to the new session trigger entry.
       
   136      *
       
   137      * @leave KErrArgument If the name of the trigger is longer than
       
   138      *   @p KLbtMaxNameLength.
       
   139      * @leave Other standard symbian error code, such as KErrNoMemory,
       
   140      * KErrGeneral, etc.
       
   141      */
       
   142     IMPORT_C static CLbtSessionTrigger* NewL( 
       
   143         const TDesC& aName,
       
   144         TLbtTriggerState aState,
       
   145         const RRequestorStack& aRequestors,
       
   146         TUid aManagerUi,
       
   147         CLbtTriggerConditionBase* aCondition );
       
   148 
       
   149     /**
       
   150      * Destructor
       
   151      */
       
   152     IMPORT_C ~CLbtSessionTrigger();
       
   153     
       
   154     /**
       
   155      * Get the type of the trigger entry, CLbtTriggerEntry::ESession.
       
   156      *
       
   157      * @return CLbtTriggerEntry::ESession.
       
   158      */
       
   159     IMPORT_C TType Type() const;
       
   160     
       
   161 	
       
   162     
       
   163 protected:
       
   164     /**
       
   165      * Externalize method that subclass must implement.
       
   166      * @param[in] aStream Stream to which the object should be externalized.
       
   167      */
       
   168     virtual void DoExternalizeL(RWriteStream& aStream) const ;
       
   169     
       
   170     /**
       
   171      * Internalize method that subclass must implement.
       
   172      * @param[in] aStream Stream from which the object should be internalized.
       
   173      */
       
   174     virtual void DoInternalizeL(RReadStream& aStream)  ;
       
   175     
       
   176 
       
   177 private:
       
   178     
       
   179     /**
       
   180      * Symbian 2nd phase constructor.
       
   181      *
       
   182      * @param[in] aName The name of the trigger entry.
       
   183      * @param[in] aState The state of trigger entry.
       
   184      * @param[in] aRequestorType Identifies the type of requestor, 
       
   185      * a service or a contact.
       
   186      * @param[in] aRequestorFormat Determines the type of data held in 
       
   187      * aRequestorData
       
   188      * @param[in] aRequestorData Requestor data. Can be a telephone 
       
   189      * number, a URL etc.
       
   190      * @param[in] aManagerUi The UID of the manager UI application. 
       
   191      * @param[in] aCondition Pointer to the new trigger condition object.
       
   192      */
       
   193     void ConstructL(const TDesC& aName,TLbtTriggerState aState,
       
   194         CRequestor::TRequestorType aRequestorType,
       
   195         CRequestor::TRequestorFormat aRequestorFormat,
       
   196         const TDesC& aRequestorData,
       
   197         TUid aManagerUi,
       
   198         CLbtTriggerConditionBase* aCondition);
       
   199     /**
       
   200      * Symbian 2nd phase constructor.
       
   201      *
       
   202      * @param[in] aName The name of the trigger entry.
       
   203      * @param[in] aState The state of trigger entry.
       
   204      * @param[in] aRequestor The requestor for the service. This
       
   205      * object does not take ownership of aRequestor.
       
   206      * @param[in] aManagerUi The UID of manager UI application.
       
   207      * @param[in] aCondition Pointer to the new trigger condition object.    
       
   208      */
       
   209     void ConstructL(const TDesC& aName,
       
   210         CLbtTriggerEntry::TLbtTriggerState aState,
       
   211         const RRequestorStack& aRequestors,
       
   212         TUid aManagerUi,
       
   213         CLbtTriggerConditionBase* aCondition);
       
   214    
       
   215    /**
       
   216     * Symbian 2nd phase constructor.
       
   217     */     
       
   218    void ConstructL();         
       
   219    
       
   220    /**
       
   221     * Default constructor
       
   222     */ 
       
   223    CLbtSessionTrigger();
       
   224    
       
   225    /**
       
   226     * By default, prohibit copy constructor
       
   227     */
       
   228    CLbtSessionTrigger(  CLbtSessionTrigger& aEntry);
       
   229    
       
   230    /**
       
   231     * Prohibit assigment operator
       
   232     */ 
       
   233    CLbtSessionTrigger& operator= ( const CLbtSessionTrigger& );
       
   234 
       
   235     };
       
   236 
       
   237 
       
   238 #endif // LBTSESSIONTRIGGER_H