1 /* |
|
2 * Copyright (c) 2007-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: For CSC application startup parameter handling |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CSCENGSTARTUPHANDLER_H |
|
20 #define C_CSCENGSTARTUPHANDLER_H |
|
21 |
|
22 |
|
23 /** |
|
24 * An instance of CSCEngStartupHandler |
|
25 * For CSC application startup parameter handling |
|
26 * |
|
27 * @lib CSCEngine.lib |
|
28 * @since S60 v3.2 |
|
29 */ |
|
30 NONSHARABLE_CLASS ( CCSCEngStartupHandler ) : public CBase |
|
31 { |
|
32 public: |
|
33 |
|
34 /** Enumeration for different startup actions */ |
|
35 enum TAction |
|
36 { |
|
37 EDefaultAction = 0, |
|
38 EAddSetupPluginService, // for service setup plugins |
|
39 ERemoveSetupPluginService, |
|
40 EOpenUiExtension, // for ui extensions plugins |
|
41 EOpenSettingsUi |
|
42 }; |
|
43 |
|
44 |
|
45 /** Enumeration for different uid types */ |
|
46 enum TUidType |
|
47 { |
|
48 EPluginUid = 0, |
|
49 EAppUid |
|
50 }; |
|
51 |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 IMPORT_C static CCSCEngStartupHandler* NewL(); |
|
57 |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CCSCEngStartupHandler(); |
|
63 |
|
64 |
|
65 /** |
|
66 * Sets CSC startup parameters. |
|
67 * |
|
68 * @since S60 v3.2 |
|
69 * @param aParameters string containing startup parameters |
|
70 * @return KErrNone if successful |
|
71 */ |
|
72 IMPORT_C TInt SetStartupParametersL( const TDesC& aParameters ); |
|
73 |
|
74 |
|
75 /** |
|
76 * Gets startup parameter Action |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 * @return action enum |
|
80 */ |
|
81 IMPORT_C TAction GetParamAction() const; |
|
82 |
|
83 /** |
|
84 * Gets startup parameter service id |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 * @return service id |
|
88 */ |
|
89 IMPORT_C TUint GetParamServiceId() const; |
|
90 |
|
91 |
|
92 /** |
|
93 * Gets startup parameter UI Extension Plug-in UID |
|
94 * |
|
95 * @since S60 v3.2 |
|
96 * @return plugin uid |
|
97 */ |
|
98 IMPORT_C const TUid GetParamPluginUid() const; |
|
99 |
|
100 |
|
101 /** |
|
102 * Gets startup parameter application UID |
|
103 * |
|
104 * @since S60 v3.2 |
|
105 * @return application uid |
|
106 */ |
|
107 IMPORT_C const TUid GetParamAppUid() const; |
|
108 |
|
109 |
|
110 /** |
|
111 * Gets startup parameter URL. |
|
112 * |
|
113 * @since S60 v3.2 |
|
114 * @param aUrl url is stored here |
|
115 * @return error code |
|
116 */ |
|
117 IMPORT_C TInt GetParamUrl( TDes& aUrl ) const; |
|
118 |
|
119 |
|
120 /** |
|
121 * Resets uid value by uid type |
|
122 * |
|
123 * @since S60 v3.2 |
|
124 * @param aType plugin type |
|
125 */ |
|
126 IMPORT_C void ResetUid( TUidType aType ); |
|
127 |
|
128 |
|
129 /** |
|
130 * Resets service id |
|
131 * |
|
132 * @since S60 v3.2 |
|
133 */ |
|
134 IMPORT_C void ResetServiceId(); |
|
135 |
|
136 /** |
|
137 * For settings flag if csc was started from homescreen. |
|
138 * |
|
139 * @since S60 v5.0 |
|
140 */ |
|
141 IMPORT_C void SetStartedFromHomescreen( TBool aStartedFromHomescreen ); |
|
142 |
|
143 /** |
|
144 * For getting flag if csc was started from homescreen. |
|
145 * |
|
146 * @since S60 v5.0 |
|
147 */ |
|
148 IMPORT_C TBool StartedFromHomescreen() const; |
|
149 |
|
150 |
|
151 private: |
|
152 |
|
153 CCSCEngStartupHandler(); |
|
154 |
|
155 |
|
156 void ConstructL(); |
|
157 |
|
158 |
|
159 /** |
|
160 * Parses and sets startup parameter action |
|
161 * |
|
162 * @since S60 v3.2 |
|
163 * @param aParameters string containing startup parameters |
|
164 */ |
|
165 void SetAction( const TDesC& aParameters ); |
|
166 |
|
167 |
|
168 /** |
|
169 * Parses and sets startup parameter service id |
|
170 * |
|
171 * @since S60 v3.2 |
|
172 * @param aParameters string containing startup parameters |
|
173 */ |
|
174 void SetServiceId( const TDesC& aParameters ); |
|
175 |
|
176 |
|
177 /** |
|
178 * Parses and sets startup parameter plugin uid |
|
179 * |
|
180 * @since S60 v3.2 |
|
181 * @param aParameters string containing startup parameters |
|
182 * @param aUidType uid type |
|
183 */ |
|
184 void SetUid( const TDesC& aParameters, TUidType aUidType ); |
|
185 |
|
186 |
|
187 /** |
|
188 * Parses and sets startup parameter URL |
|
189 * |
|
190 * @since S60 v3.2 |
|
191 * @param aParameters string containing startup parameters |
|
192 */ |
|
193 void SetUrlL( const TDesC& aParameters ); |
|
194 |
|
195 |
|
196 private: // data |
|
197 |
|
198 /** |
|
199 * Action type parameter |
|
200 */ |
|
201 TAction iAction; |
|
202 |
|
203 /** |
|
204 * Service id parameter |
|
205 */ |
|
206 TUint iServiceId; |
|
207 |
|
208 /** |
|
209 * Plugin uid parameter |
|
210 */ |
|
211 TUid iPluginUid; |
|
212 |
|
213 /** |
|
214 * Application uid parameter |
|
215 */ |
|
216 TUid iAppUid; |
|
217 |
|
218 /** |
|
219 * URL parameter |
|
220 * Own. |
|
221 */ |
|
222 HBufC* iURL; |
|
223 |
|
224 /** |
|
225 * To deternmine if csc was started from homescreen. |
|
226 * Own. |
|
227 */ |
|
228 TBool iStartedFromHomescreen; |
|
229 }; |
|
230 |
|
231 #endif // C_CSCENGSTARTUPHANDLER_H |
|