|
1 /* |
|
2 * Copyright (c) 2007-2008 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: PnpProvUtil header file - This header file is used by any |
|
15 * applications using PNPMS and Provisioning utilities |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef PNP_PROV_UTIL_H |
|
21 #define PNP_PROV_UTIL_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 // Connection reason for launching online support |
|
26 enum TConnectReason |
|
27 { |
|
28 EUnKnown = 0, |
|
29 EFirstBoot, |
|
30 ENewSIM, |
|
31 EUserTriggered, |
|
32 EApplicationTriggered, |
|
33 ERemoteTriggered |
|
34 }; |
|
35 |
|
36 //Interactive or NonInteractive mode of onlinesupport startup |
|
37 enum TStartMode |
|
38 { |
|
39 EStartInteractive = 0, |
|
40 EStartNonInteractive |
|
41 }; |
|
42 |
|
43 //PnPMS servers type |
|
44 enum TServers |
|
45 { |
|
46 EHelpPortal = 0, |
|
47 ENSA, |
|
48 EPnPMSNokia, |
|
49 EWDSGlobal |
|
50 }; |
|
51 |
|
52 |
|
53 /** |
|
54 * CPnpProvUtil class provides interface for application to set UID and |
|
55 * provisioning adapters to set the settings application ID. |
|
56 * PNPMS client get these values before activating service. |
|
57 * This class can be used for launching online support in different modes |
|
58 * of operation. |
|
59 * |
|
60 * @lib PnpUtil.lib |
|
61 * @since Series 60 3.2.3 |
|
62 */ |
|
63 |
|
64 |
|
65 class CPnpProvUtil : public CBase |
|
66 { |
|
67 |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 */ |
|
73 IMPORT_C static CPnpProvUtil* NewL(); |
|
74 |
|
75 /** |
|
76 * Two-phased constructor. |
|
77 */ |
|
78 IMPORT_C static CPnpProvUtil* NewLC(); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 ~CPnpProvUtil(); |
|
84 |
|
85 public: // New methods |
|
86 |
|
87 /** |
|
88 * Set the UID of application that launched PnPMS service for downloading |
|
89 * configuration settings. |
|
90 * @param aUid - Uid of the application. |
|
91 * @return None |
|
92 * @since Series 60 3.2.3 |
|
93 */ |
|
94 IMPORT_C void SetApplicationUidL(TUint32 aUid); |
|
95 |
|
96 /** |
|
97 * Get the UID of the application to be launched. This UID is same |
|
98 * as the one that is set using SetApplicationUidL method. |
|
99 * @param None |
|
100 * @return Get UID of application to be launched |
|
101 * Default return value is Zero in case if there is no |
|
102 * call to SetApplicationUidL method |
|
103 * @since Series 60 3.2.3 |
|
104 */ |
|
105 IMPORT_C TUint32 GetApplicationUidL(); |
|
106 |
|
107 /** |
|
108 * Set Provisioning application settings ID. Provisioning adapters set |
|
109 * this value and indicate PNPMS client that application settings are |
|
110 * saved successfully. |
|
111 * @param appID - Provisioning settings application ID |
|
112 * @return None |
|
113 * @since Series 60 3.2.3 |
|
114 */ |
|
115 IMPORT_C void SetProvAdapterAppIdL(TDesC& appID); |
|
116 |
|
117 /** |
|
118 * Get Provisioning application settings ID. This value is used by |
|
119 * PNPMS client before launching application to confirm application |
|
120 * settings are downloaded successfully. |
|
121 * @param appID - Reference of array is passed which has all the |
|
122 * application IDs set by Provisioning adapters |
|
123 * @return None |
|
124 * @since Series 60 3.2.3 |
|
125 */ |
|
126 IMPORT_C void GetProvAdapterAppIdsL(RPointerArray<HBufC>& appID); |
|
127 |
|
128 |
|
129 /** |
|
130 * Launches Online Support in different modes of PnPMS operation. |
|
131 * @param aUri - URI of PnPMS server |
|
132 * aConnectReason - connection reason will be provided by whoever |
|
133 * launches PnPMS |
|
134 * aMode - PnPMS application can be started in different |
|
135 * mode |
|
136 * aTokenOverride - Token override |
|
137 * aQueryString - Help query string |
|
138 * @return None |
|
139 * @since Series 60 3.2.3 |
|
140 */ |
|
141 IMPORT_C void LaunchOnlineSupportL(TDesC& aUri, |
|
142 TConnectReason aConnectReason, |
|
143 TStartMode aMode, |
|
144 TBool aTokenOverride, |
|
145 TDesC& aQueryString); |
|
146 |
|
147 /** |
|
148 * Construct Uri with PnPUtil parameters. |
|
149 * @param aUri - URI of PnPMS server to append PnPUtil parameters |
|
150 * aServer - PnPMS server type |
|
151 * @return None |
|
152 * @since Series 60 3.2.3 |
|
153 */ |
|
154 IMPORT_C void ConstructUriWithPnPUtilL(TDes& aUri, TServers aServer); |
|
155 |
|
156 private: |
|
157 /** |
|
158 * C++ default constructor. |
|
159 */ |
|
160 CPnpProvUtil(); |
|
161 |
|
162 /** |
|
163 *By default Symbian 2nd phase constructor is private. |
|
164 */ |
|
165 void ConstructL(); |
|
166 |
|
167 /** |
|
168 * Parse application IDs set by provisioning adapters. |
|
169 * @param aValue - String containing application IDs. |
|
170 * array - Reference to array of application IDs parsed. |
|
171 * @return None |
|
172 * @since Series 60 3.2.3 |
|
173 */ |
|
174 void ParseValueL(TDesC& aValue, RPointerArray<HBufC>& array ); |
|
175 |
|
176 /** |
|
177 * Set Cenrep value to key specified as parameter. |
|
178 * @param aRepositoryUid - Central repository UID |
|
179 * aKey - repository key |
|
180 * aSetValue - value set to repository key |
|
181 * @return None |
|
182 * @since Series 60 3.2.3 |
|
183 */ |
|
184 void SetCenrepValueL(TUid aRepositoryUid, TUint32 aKey, TDesC& aSetValue); |
|
185 |
|
186 /** |
|
187 * Get Cenrep value of key specified as parameter to SetCenrepValue. |
|
188 * @param aRepositoryUid - Central repository UID |
|
189 * aKey - repository key |
|
190 * aGetValue - value retrived from repository is stored in aGetvalue |
|
191 * @return None |
|
192 * @since Series 60 3.2.3 |
|
193 */ |
|
194 void GetCenrepValueL(TUid aRepositoryUid, TUint32 aKey, TDes& aGetvalue); |
|
195 |
|
196 /** |
|
197 * Construct command Line String for starting online support. |
|
198 * @param aUri - URI of PNPMS server |
|
199 * aConnectReason - connection reason will be provided by whoever |
|
200 * launches PNPMS |
|
201 * aMode - PnPMS application can be started in different |
|
202 * mode |
|
203 * aTokenOverride - Token override |
|
204 * aQueryString - Help query string |
|
205 * aCmdString - appended command line string |
|
206 * @return None |
|
207 * @since Series 60 3.2.3 |
|
208 */ |
|
209 void ConstructCmdLineStringL(TDesC& aUri, |
|
210 TConnectReason aConnectReason, |
|
211 TStartMode aMode, TBool aTokenOverride, |
|
212 TDesC& aQueryString, TDes& aCmdString); |
|
213 |
|
214 }; |
|
215 |
|
216 #endif PNP_PROV_UTIL_H |