2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Concrete class representing session trigger entries.
19 #ifndef LBTSESSIONTRIGGER_H
20 #define LBTSESSIONTRIGGER_H
22 #include <lbttriggerentry.h>
26 * Concrete class representing session trigger entries.
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().
33 * Client application shall make request to Location
34 * Triggering Server to receive session trigger firing event.
42 class CLbtSessionTrigger : public CLbtTriggerEntry
46 * Allocates and constructs a new session trigger entry.
48 * In returned object, default values are set to the
49 * attributes of the trigger. The default values are
50 * - Trigger Id is KLbtNullTriggerId.
52 * - Trigger Name is an empty string.
54 * - Trigger State is CLbtTriggerEntry::EStateEnabled.
56 * - Requestors are not set.
58 * - Manager UI is not set(KNullUid).
60 * - Trigger condition is not set.
63 * @return Pointer to the new session trigger entry.
65 IMPORT_C static CLbtSessionTrigger* NewL();
68 * Allocates and constructs a new session trigger entry. The
69 * constructed object is pushed onto cleanup stack.
71 * In returned object, default values are set to the
72 * attributes of the trigger. The default values are
73 * - Trigger Id is KLbtNullTriggerId.
75 * - Trigger Name is an empty string.
77 * - Trigger State is CLbtTriggerEntry::EStateEnabled.
79 * - Requestors are not set.
81 * - Manager UI is not set(KNullUid).
83 * - Trigger condition is not set.
86 * @return Pointer to the new session trigger entry.
88 IMPORT_C static CLbtSessionTrigger* NewLC();
92 * Allocates and constructs a new session trigger entry
93 * with specified attribute values.
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
103 * @param[in] aRequestorData Requestor data. Can be a telephone
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.
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,
115 IMPORT_C static CLbtSessionTrigger* NewL(
117 TLbtTriggerState aState,
118 CRequestor::TRequestorType aRequestorType,
119 CRequestor::TRequestorFormat aRequestorFormat,
120 const TDesC& aRequestorData,
122 CLbtTriggerConditionBase* aCondition );
125 * Allocates and constructs a new session trigger entry
126 * with specified attribute values.
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.
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,
142 IMPORT_C static CLbtSessionTrigger* NewL(
144 TLbtTriggerState aState,
145 const RRequestorStack& aRequestors,
147 CLbtTriggerConditionBase* aCondition );
152 IMPORT_C ~CLbtSessionTrigger();
155 * Get the type of the trigger entry, CLbtTriggerEntry::ESession.
157 * @return CLbtTriggerEntry::ESession.
159 IMPORT_C TType Type() const;
165 * Externalize method that subclass must implement.
166 * @param[in] aStream Stream to which the object should be externalized.
168 virtual void DoExternalizeL(RWriteStream& aStream) const ;
171 * Internalize method that subclass must implement.
172 * @param[in] aStream Stream from which the object should be internalized.
174 virtual void DoInternalizeL(RReadStream& aStream) ;
180 * Symbian 2nd phase constructor.
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
188 * @param[in] aRequestorData Requestor data. Can be a telephone
190 * @param[in] aManagerUi The UID of the manager UI application.
191 * @param[in] aCondition Pointer to the new trigger condition object.
193 void ConstructL(const TDesC& aName,TLbtTriggerState aState,
194 CRequestor::TRequestorType aRequestorType,
195 CRequestor::TRequestorFormat aRequestorFormat,
196 const TDesC& aRequestorData,
198 CLbtTriggerConditionBase* aCondition);
200 * Symbian 2nd phase constructor.
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.
209 void ConstructL(const TDesC& aName,
210 CLbtTriggerEntry::TLbtTriggerState aState,
211 const RRequestorStack& aRequestors,
213 CLbtTriggerConditionBase* aCondition);
216 * Symbian 2nd phase constructor.
221 * Default constructor
223 CLbtSessionTrigger();
226 * By default, prohibit copy constructor
228 CLbtSessionTrigger( CLbtSessionTrigger& aEntry);
231 * Prohibit assigment operator
233 CLbtSessionTrigger& operator= ( const CLbtSessionTrigger& );
238 #endif // LBTSESSIONTRIGGER_H