|
1 /* |
|
2 * Copyright (c) 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 DLL to Geocoding API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CTESTMNGEOCODER_H |
|
20 #define CTESTMNGEOCODER_H |
|
21 |
|
22 // System Includes |
|
23 #include <StifLogger.h> |
|
24 #include <StifTestModule.h> |
|
25 #include <StifParser.h> |
|
26 #include <e32base.h> |
|
27 #include <e32std.h> |
|
28 #include <AknServerApp.h> |
|
29 |
|
30 |
|
31 // Constants |
|
32 const TInt KProviderUid = 0x03132014; |
|
33 |
|
34 //Forward Declarations |
|
35 class CMnGeocoder; |
|
36 class CMnProvider; |
|
37 class CPosLandmark; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * Test Class to invoke the CTestMNClientLib methods |
|
42 * |
|
43 * This class is a helper class. The status variable of this active obect is |
|
44 * used to provide the asynchronous method Calls. |
|
45 * |
|
46 * @lib testmnclientlib.lib |
|
47 * @since S60 v3.2 |
|
48 */ |
|
49 |
|
50 class CTestMnGeocoder :public CActive, public MAknServerAppExitObserver |
|
51 { |
|
52 public: |
|
53 |
|
54 enum TFunction |
|
55 { |
|
56 EFindAddressByCoordinateL = 0, |
|
57 EFindCoordinateByAddressL, |
|
58 EFindCoordinateByAddressDescL |
|
59 }; |
|
60 |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 static CTestMnGeocoder* NewL(CStifLogger* aLog); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 ~CTestMnGeocoder(); |
|
72 |
|
73 public: |
|
74 |
|
75 //From CActive |
|
76 void RunL(); |
|
77 void DoCancel(); |
|
78 TInt RunError(TInt aError); |
|
79 |
|
80 // |
|
81 /** |
|
82 * Test Case for Creating the new instance of CMnGeocoder |
|
83 * using NewL |
|
84 * |
|
85 * @since S60 v3.2 |
|
86 * Returns KErrNone if successful. |
|
87 * |
|
88 */ |
|
89 TInt TestNewL(); |
|
90 |
|
91 /** |
|
92 * Test Case for Creating the new instance of CMnGeocoder |
|
93 * using NewChainedL - Expected to Fail with KErrNotsupported |
|
94 * |
|
95 * @since S60 v3.2 |
|
96 * Returns KErrNone if successful. |
|
97 * |
|
98 */ |
|
99 TInt TestNewChainedL(); |
|
100 |
|
101 /** |
|
102 * Test Case for Setting and Getting options |
|
103 * of CMnGeocoder |
|
104 * |
|
105 * @since S60 v3.2 |
|
106 * Returns KErrNone if successful. |
|
107 * |
|
108 */ |
|
109 TInt TestGetSetOptionsL( CStifItemParser& aItem ); |
|
110 |
|
111 /** |
|
112 * Test Case for converting coordinate to Address |
|
113 * Asynchronous Call |
|
114 * |
|
115 * @since S60 v3.2 |
|
116 * Returns KErrNone if successful. |
|
117 * |
|
118 */ |
|
119 TInt TestFindAddressByCoordinateL( CStifItemParser& aItem ); |
|
120 |
|
121 /** |
|
122 * Test Case for converting Address(CPosLandmark) to coordinate |
|
123 * Asynchronous Call |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * Returns KErrNone if successful. |
|
127 * |
|
128 */ |
|
129 TInt TestFindCoordinateByAddressL( CStifItemParser& aItem ); |
|
130 |
|
131 /** |
|
132 * Test Case for converting Address(Desc) to coordinate |
|
133 * Asynchronous Call |
|
134 * |
|
135 * @since S60 v3.2 |
|
136 * Returns KErrNone if successful. |
|
137 * |
|
138 */ |
|
139 TInt TestFindCoordinateByAddressDescL( CStifItemParser& aItem ); |
|
140 |
|
141 /** |
|
142 * Test Case for Setting the Exit Observer |
|
143 * for CMnGeocoder |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * Returns KErrNone if successful. |
|
147 * |
|
148 */ |
|
149 TInt TestSetExitObserverL( ); |
|
150 |
|
151 /** |
|
152 * Test Case for Removing the Exit Observer |
|
153 * for CMnGeocoder |
|
154 * |
|
155 * @since S60 v3.2 |
|
156 * Returns KErrNone if successful. |
|
157 * |
|
158 */ |
|
159 TInt TestRemoveExitObserverL( ); |
|
160 |
|
161 /** |
|
162 * Test Case for Cancelling a the request given to |
|
163 * CMnGeocoder |
|
164 * |
|
165 * @since S60 v3.2 |
|
166 * Returns KErrNone if successful. |
|
167 * |
|
168 */ |
|
169 TInt TestCancelRequestL( CStifItemParser& aItem ); |
|
170 |
|
171 /** |
|
172 * Test Case for allowing a panic(KMnPanicDuplicateRequest) on |
|
173 * issuing duplicate requests on CMnGeocoder |
|
174 * |
|
175 * @since S60 v3.2 |
|
176 * Returns KErrNone if successful. |
|
177 * |
|
178 */ |
|
179 TInt TestRequestPanicL( CStifItemParser& aItem ); |
|
180 |
|
181 // From MAknServerAppExitObserver |
|
182 void HandleServerAppExit(TInt aReason); |
|
183 |
|
184 private: |
|
185 |
|
186 void ConstructL(); |
|
187 |
|
188 /** |
|
189 * C++ default constructor. |
|
190 */ |
|
191 CTestMnGeocoder(CStifLogger* aLog); |
|
192 |
|
193 private: //data |
|
194 /** |
|
195 * CMnGeocoder Client instance |
|
196 */ |
|
197 CMnGeocoder* iMnGeocoder; |
|
198 |
|
199 CMnProvider* iMnProvider; |
|
200 |
|
201 RPointerArray<CMnProvider> iProviderArray; |
|
202 |
|
203 CPosLandmark* iLmk; |
|
204 |
|
205 TUid iUid; |
|
206 |
|
207 TFunction iFunction; |
|
208 /** |
|
209 * iLog instance - Not owned |
|
210 */ |
|
211 CStifLogger* iLog; |
|
212 |
|
213 }; |
|
214 |
|
215 #endif // CTESTMNGEOCODER_H |
|
216 |
|
217 // End of File |