|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: Test module to implement Cell based triggering test cases |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef T_TRIGGERFIREOBSERVER_H |
|
24 #define T_TRIGGERFIREOBSERVER_H |
|
25 |
|
26 // INCLUDES |
|
27 |
|
28 #include <lbtcommon.h> |
|
29 #include <lbttriggerfiringeventobserver.h> |
|
30 #include <lbttriggerfiringeventnotifier.h> |
|
31 #include <lbtsessiontrigger.h> |
|
32 #include <lbtstartuptrigger.h> |
|
33 #include <lbttriggerentry.h> |
|
34 #include <lbtgeocell.h> |
|
35 |
|
36 #include "lbtcidchangenotifier.h" |
|
37 // FORWARD DECLARATIONS |
|
38 |
|
39 class RLbt; |
|
40 class CLbtTriggerFiringEventNotifier; |
|
41 class CLbtTriggerEntry; |
|
42 class CLbtTriggerInfo; |
|
43 // class CLBTOperation; |
|
44 const TUid KPSUidTriggerIdInfo = { 0xA0000196 }; |
|
45 const TUint32 KLbttesttriggerid = 0x00000001; |
|
46 |
|
47 class CTriggerFireObserver: public CTimer,MLbtTriggerFiringEventObserver |
|
48 |
|
49 { |
|
50 |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 static CTriggerFireObserver* NewL( RLbt& aLbt); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CTriggerFireObserver(); |
|
62 |
|
63 |
|
64 void TriggerFiredL( const TLbtTriggerFireInfo& aFireInfo ); |
|
65 |
|
66 void StartNotification( CActiveSchedulerWait* aWait ); |
|
67 |
|
68 void CancelNotification( ); |
|
69 |
|
70 void CreateTrigger( ); |
|
71 |
|
72 void CheckPositionInfoL( const TLbtTriggerFireInfo& aFireInfo ); |
|
73 |
|
74 |
|
75 void CreateTriggers( RLbt& aLbt, |
|
76 CLbtTriggerEntry& aEntry, |
|
77 TLbtTriggerId& aId, |
|
78 TBool aFireOnCreation, |
|
79 CActiveSchedulerWait* aWait |
|
80 ); |
|
81 |
|
82 void GetTriggersList(RLbt& aLbt, RPointerArray < CLbtTriggerInfo >& aTriggerList, |
|
83 CActiveSchedulerWait* aWait ,CLbtListTriggerOptions* aListOptions=NULL) ; |
|
84 void ListTriggerIdsList(RLbt& aLbt, RArray < TLbtTriggerId >& aTriggerIdList, |
|
85 CActiveSchedulerWait* aWait,CLbtListTriggerOptions* aListOptions=NULL); |
|
86 void CreateIterator(RLbt& aLbt,CActiveSchedulerWait* aWait,CLbtListTriggerOptions* aListOptions=NULL); |
|
87 void CTriggerFireObserver::DeleteFilteredTriggers( RLbt& aLbt,CLbtTriggerFilterBase* aFilter,CActiveSchedulerWait* aWait ); |
|
88 TInt GetFireCount( ) ; |
|
89 TInt GetError( ) ; |
|
90 |
|
91 TLbtTriggerFireInfo GetFiredTrigger( ) ; |
|
92 void UpdateTriggersState(RLbt& aLbt, CLbtTriggerEntry::TLbtTriggerState aState, |
|
93 CActiveSchedulerWait* aWait,CLbtTriggerFilterBase * aFilter=NULL) ; |
|
94 |
|
95 void CTriggerFireObserver::PopulateFromCurrentCell(CLbtGeoCell& cell,CActiveSchedulerWait* aWait ) ; |
|
96 |
|
97 void RunL( ); |
|
98 |
|
99 void DoCancel( ); |
|
100 |
|
101 // CLBTOperation * CreateGeoAreaForCurrentLocationL(CLbtGeoAreaBase::TGeoAreaType aTechType,CLbtGeoAreaBase** aArea,CActiveSchedulerWait* aWait); |
|
102 |
|
103 |
|
104 // RTimer iTimer; |
|
105 TRequestStatus iWaitStatus; |
|
106 TInt iTriggerFireCount ; |
|
107 private: |
|
108 |
|
109 /** |
|
110 * C++ default constructor. |
|
111 */ |
|
112 CTriggerFireObserver( ); |
|
113 |
|
114 /** |
|
115 * By default Symbian 2nd phase constructor is private. |
|
116 */ |
|
117 void ConstructL( RLbt& aLbt ); |
|
118 |
|
119 private: |
|
120 |
|
121 CLbtTriggerFiringEventNotifier* iNotifier; |
|
122 |
|
123 CActiveSchedulerWait* iWait; |
|
124 |
|
125 |
|
126 TLbtTriggerFireInfo iFireInfo; |
|
127 TInt error; |
|
128 |
|
129 }; |
|
130 |
|
131 class CLbtEventObserver : public CTimer,MLbtCidChangeObsrvr |
|
132 |
|
133 { |
|
134 |
|
135 public: // Constructors and destructor |
|
136 |
|
137 /** |
|
138 * Two-phased constructor. |
|
139 */ |
|
140 static CLbtEventObserver* NewL( RLbt& aLbt ); |
|
141 |
|
142 |
|
143 /** |
|
144 * Destructor. |
|
145 */ |
|
146 ~CLbtEventObserver(); |
|
147 |
|
148 |
|
149 void CreateTriggers( RLbt& aLbt, |
|
150 CLbtTriggerEntry& aEntry, |
|
151 TLbtTriggerId& aId, |
|
152 TBool aFireOnCreation, |
|
153 CActiveSchedulerWait* aWait |
|
154 ); |
|
155 |
|
156 |
|
157 void NotifyTriggerChangeEvent( RLbt& aLbt,TLbtTriggerChangeEvent &aEvent ,CActiveSchedulerWait* aWait ) ; |
|
158 |
|
159 void RunL( ); |
|
160 |
|
161 void DoCancel( ); |
|
162 |
|
163 void HandleCIDChangeL(const CTelephony::TNetworkInfoV1 &aNwInfo); |
|
164 void StartCidNotification( CActiveSchedulerWait* aWait ); |
|
165 |
|
166 |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * C++ default constructor. |
|
172 */ |
|
173 CLbtEventObserver( ); |
|
174 |
|
175 /** |
|
176 * By default Symbian 2nd phase constructor is private. |
|
177 */ |
|
178 void ConstructL( RLbt& aLbt ); |
|
179 |
|
180 private: |
|
181 |
|
182 CLbtCidChangeNotifier* iCidchangenotifier; |
|
183 CActiveSchedulerWait* iWait; |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 }; |
|
189 |
|
190 |
|
191 #endif // T_TRIGGERFIREOBSERVER_H |
|
192 |
|
193 // End of File |