|
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: location triggering server client interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef LBTTRIGGERFIRINGEVENTNOTIFIER_H |
|
21 #define LBTTRIGGERFIRINGEVENTNOTIFIER_H |
|
22 |
|
23 #include <lbt.h> |
|
24 #include <lbttriggerfiringeventobserver.h> |
|
25 |
|
26 /** |
|
27 * Helper class to receive trigger firing event |
|
28 * through observer interface. |
|
29 * |
|
30 * @see RLbt::NotifyTriggerFired |
|
31 * |
|
32 * @lib lbt.lib |
|
33 * |
|
34 * @since S60 5.1 |
|
35 */ |
|
36 |
|
37 class CLbtTriggerFiringEventNotifier : public CActive |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Construct a trigger firing event notifier object. |
|
42 * |
|
43 * When the object is constructed. The trigger firing event |
|
44 * notification request is not issued to the |
|
45 * Location Triggering Server. Client shall call |
|
46 * CLbtTriggerFiringEventNotifier::Start() to start |
|
47 * notification. |
|
48 * |
|
49 * @param[in] aLbt A referece to RLbt object. The subsession |
|
50 * must be opened. Otherwise a panic is raised. |
|
51 * @param[in] aObserver A referece to the |
|
52 * observer object to receive trigger firing event. |
|
53 * @param[in] aPriority An integer specifying the |
|
54 * priority of this active object. CActive::TPriority |
|
55 * defines a standard set of priorities. |
|
56 * |
|
57 * @panic LocTriggering ELbtServerBadHandle If the |
|
58 * subsession of aLbt is not opened. |
|
59 */ |
|
60 IMPORT_C static CLbtTriggerFiringEventNotifier* NewL( |
|
61 RLbt& aLbt, |
|
62 MLbtTriggerFiringEventObserver& aObserver, |
|
63 TInt aPriority = CActive::EPriorityStandard); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 * |
|
68 * If the notification is started, the |
|
69 * destructor will cancel the notification. |
|
70 */ |
|
71 IMPORT_C ~CLbtTriggerFiringEventNotifier(); |
|
72 |
|
73 /** |
|
74 * Start trigger firing event notification. |
|
75 * |
|
76 * After this function is called, when a |
|
77 * trigger is fired, the |
|
78 * client will be notified from the observer interface. |
|
79 * |
|
80 * Client shall call Cancel() function to stop the |
|
81 * trigger firing event notification. |
|
82 */ |
|
83 IMPORT_C void Start(); |
|
84 |
|
85 private: |
|
86 //Derived from CActive |
|
87 void RunL(); |
|
88 TInt RunError( TInt aError ); |
|
89 void DoCancel(); |
|
90 |
|
91 private: |
|
92 /** |
|
93 * Default constructor |
|
94 */ |
|
95 CLbtTriggerFiringEventNotifier( |
|
96 RLbt& aLbt, |
|
97 MLbtTriggerFiringEventObserver& aObserver, |
|
98 TInt aPriority = CActive::EPriorityStandard ); |
|
99 |
|
100 /** |
|
101 * Second phase constructor |
|
102 */ |
|
103 void ConstructL(); |
|
104 |
|
105 private: |
|
106 /** |
|
107 * Trigger fire info |
|
108 */ |
|
109 TLbtTriggerFireInfo iFiringEvent; |
|
110 |
|
111 /** |
|
112 * Reference to Lbt subsession. |
|
113 */ |
|
114 RLbt& iLbt; |
|
115 |
|
116 /** |
|
117 * Reference to trigger fire event observer |
|
118 */ |
|
119 MLbtTriggerFiringEventObserver& iObserver; |
|
120 }; |
|
121 |
|
122 #endif //LBTTRIGGERFIRINGEVENTNOTIFIER_H |