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