|
1 /* |
|
2 * Copyright (c) 2009-2010 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 "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: |
|
15 * Implement entry classes for Software Components Registry interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <usif/scr/appregentries.h> |
|
20 #include <usif/scr/screntries.h> |
|
21 #include <scs/streamingarray.h> |
|
22 #include <scs/cleanuputils.h> |
|
23 |
|
24 using namespace Usif; |
|
25 /////////////////////// |
|
26 //TApplicationCharacteristics |
|
27 /////////////////////// |
|
28 EXPORT_C TApplicationCharacteristics::TApplicationCharacteristics() |
|
29 { |
|
30 iEmbeddability = ENotEmbeddable; |
|
31 iSupportsNewFile = EFalse; |
|
32 iAppIsHidden = EFalse; |
|
33 iLaunchInBackground = EFalse; |
|
34 iGroupName = KNullDesC; |
|
35 iAttributes = 0; |
|
36 } |
|
37 |
|
38 EXPORT_C void TApplicationCharacteristics::ExternalizeL(RWriteStream& aStream) const |
|
39 { |
|
40 aStream.WriteInt32L((TInt)iEmbeddability); |
|
41 aStream.WriteInt32L(iSupportsNewFile); |
|
42 aStream.WriteInt32L(iAppIsHidden); |
|
43 aStream.WriteInt32L(iLaunchInBackground); |
|
44 aStream.WriteInt32L(iGroupName.Length()); |
|
45 aStream.WriteL(iGroupName); |
|
46 aStream.WriteUint32L(iAttributes); |
|
47 } |
|
48 |
|
49 EXPORT_C void TApplicationCharacteristics::InternalizeL(RReadStream& aStream) |
|
50 { |
|
51 iEmbeddability = (TAppEmbeddability)aStream.ReadInt32L(); |
|
52 iSupportsNewFile = aStream.ReadInt32L(); |
|
53 iAppIsHidden = aStream.ReadInt32L(); |
|
54 iLaunchInBackground = aStream.ReadInt32L(); |
|
55 TInt groupNameLength = aStream.ReadInt32L(); |
|
56 aStream.ReadL(iGroupName, groupNameLength); |
|
57 iAttributes = aStream.ReadUint32L(); |
|
58 } |
|
59 |
|
60 /////////////////////// |
|
61 //CEmbeddabilityFilter |
|
62 /////////////////////// |
|
63 EXPORT_C TEmbeddableFilter::TEmbeddableFilter(): iEmbeddabilityFlags(0) |
|
64 { |
|
65 |
|
66 } |
|
67 |
|
68 EXPORT_C TUint TEmbeddableFilter::EmbeddabilityFlags() const |
|
69 { |
|
70 return iEmbeddabilityFlags; |
|
71 } |
|
72 |
|
73 void TEmbeddableFilter::SetEmbeddabilityFlags(TUint aEmbeddabilityFlags) |
|
74 { |
|
75 iEmbeddabilityFlags = aEmbeddabilityFlags; |
|
76 } |
|
77 |
|
78 EXPORT_C void TEmbeddableFilter::AddEmbeddability(TApplicationCharacteristics::TAppEmbeddability aEmbeddability) |
|
79 { |
|
80 iEmbeddabilityFlags |= (1 << aEmbeddability); |
|
81 } |
|
82 |
|
83 EXPORT_C TBool TEmbeddableFilter::MatchesEmbeddability(TApplicationCharacteristics::TAppEmbeddability aEmbeddability) const |
|
84 { |
|
85 TUint embeddabilityFlag = (1 << aEmbeddability); |
|
86 return ((embeddabilityFlag & iEmbeddabilityFlags) == 0) ? EFalse : ETrue; |
|
87 } |
|
88 |
|
89 ////////////////// |
|
90 //CAppInfoFilter |
|
91 ////////////////// |
|
92 |
|
93 CAppInfoFilter::CAppInfoFilter() |
|
94 { |
|
95 |
|
96 } |
|
97 |
|
98 CAppInfoFilter::~CAppInfoFilter() |
|
99 { |
|
100 |
|
101 } |
|
102 |
|
103 EXPORT_C CAppInfoFilter* CAppInfoFilter::NewLC() |
|
104 { |
|
105 CAppInfoFilter *self = new(ELeave) CAppInfoFilter(); |
|
106 CleanupStack::PushL(self); |
|
107 self->ConstructL(); |
|
108 return self; |
|
109 } |
|
110 |
|
111 |
|
112 EXPORT_C CAppInfoFilter* CAppInfoFilter::NewL() |
|
113 { |
|
114 CAppInfoFilter *self = CAppInfoFilter::NewLC(); |
|
115 CleanupStack::Pop(self); |
|
116 return self; |
|
117 } |
|
118 |
|
119 EXPORT_C CAppInfoFilter* CAppInfoFilter::NewL(RReadStream& aStream) |
|
120 { |
|
121 CAppInfoFilter *self = CAppInfoFilter::NewLC(); |
|
122 self->InternalizeL(aStream); |
|
123 CleanupStack::Pop(self); |
|
124 return self; |
|
125 } |
|
126 |
|
127 void CAppInfoFilter::ConstructL() |
|
128 { |
|
129 iSetFlag = EAllApps; |
|
130 } |
|
131 |
|
132 EXPORT_C void CAppInfoFilter::ExternalizeL(RWriteStream& aStream) const |
|
133 { |
|
134 aStream.WriteUint16L(iSetFlag); |
|
135 aStream.WriteInt32L(iScreenMode); |
|
136 aStream.WriteUint32L(iEmbeddabilityFilter.EmbeddabilityFlags()); |
|
137 aStream.WriteUint32L(iCapabilityAttributeMask); |
|
138 aStream.WriteUint32L(iCapabilityAttributeValue); |
|
139 aStream.WriteUint32L(iServiceUid.iUid); |
|
140 aStream.WriteUint32L(iAppUid.iUid); |
|
141 } |
|
142 |
|
143 void CAppInfoFilter::InternalizeL(RReadStream& aStream) |
|
144 { |
|
145 iSetFlag = aStream.ReadUint16L(); |
|
146 iScreenMode = aStream.ReadInt32L(); |
|
147 iEmbeddabilityFilter.SetEmbeddabilityFlags(aStream.ReadUint32L()); |
|
148 iCapabilityAttributeMask = aStream.ReadUint32L(); |
|
149 iCapabilityAttributeValue = aStream.ReadUint32L(); |
|
150 iServiceUid = TUid::Uid(aStream.ReadUint32L()); |
|
151 iAppUid = TUid::Uid(aStream.ReadUint32L()); |
|
152 } |
|
153 |
|
154 EXPORT_C void CAppInfoFilter::SetAllApps() |
|
155 { |
|
156 iSetFlag = EAllApps; |
|
157 } |
|
158 |
|
159 EXPORT_C void CAppInfoFilter::SetAllApps(const TInt aScreenMode) |
|
160 { |
|
161 iScreenMode = aScreenMode; |
|
162 iSetFlag = EAllAppsWithScreenMode; |
|
163 } |
|
164 |
|
165 EXPORT_C void CAppInfoFilter::SetEmbeddableApps() |
|
166 { |
|
167 iSetFlag = EGetEmbeddableApps; |
|
168 } |
|
169 |
|
170 EXPORT_C void CAppInfoFilter::SetEmbeddableApps(const TInt aScreenMode) |
|
171 { |
|
172 iScreenMode = aScreenMode; |
|
173 iSetFlag = EGetEmbeddableAppsWithSreenMode; |
|
174 } |
|
175 |
|
176 EXPORT_C void CAppInfoFilter::SetEmbeddabilityFilter(TEmbeddableFilter& aEmbeddabilityFilter) |
|
177 { |
|
178 iEmbeddabilityFilter = aEmbeddabilityFilter; |
|
179 iSetFlag = EGetFilteredAppsWithEmbeddabilityFilter; |
|
180 } |
|
181 |
|
182 EXPORT_C void CAppInfoFilter::SetEmbeddabilityFilterWithScreenMode(TEmbeddableFilter& aEmbeddabilityFilter, const TInt aScreenMode) |
|
183 { |
|
184 iEmbeddabilityFilter = aEmbeddabilityFilter; |
|
185 iScreenMode = aScreenMode; |
|
186 iSetFlag = EGetFilteredAppsWithEmbeddabilityFilterWithScreenMode; |
|
187 } |
|
188 EXPORT_C void CAppInfoFilter::SetServerApps(const TUid aServiceUid) |
|
189 { |
|
190 iServiceUid = aServiceUid; |
|
191 iSetFlag = EGetServerApps; |
|
192 } |
|
193 EXPORT_C void CAppInfoFilter::SetServerApps(const TUid aServiceUid,const TInt aScreenMode) |
|
194 { |
|
195 iServiceUid = aServiceUid; |
|
196 iScreenMode = aScreenMode; |
|
197 iSetFlag = EGetServerAppsWithScreenMode; |
|
198 } |
|
199 |
|
200 EXPORT_C void CAppInfoFilter::SetCapabilityAttributeMaskAndValue(const TInt aCapabilityAttributeMask, const TInt aCapabilityAttributeValue) |
|
201 { |
|
202 iCapabilityAttributeMask = aCapabilityAttributeMask; |
|
203 iCapabilityAttributeValue = aCapabilityAttributeValue; |
|
204 iSetFlag = EGetFilteredAppsWithCapabilityMaskAndValue; |
|
205 } |
|
206 |
|
207 EXPORT_C void CAppInfoFilter::SetCapabilityAttributeMaskAndValue(const TInt aCapabilityAttributeMask, const TInt aCapabilityAttributeValue, const TInt aScreenMode) |
|
208 { |
|
209 iCapabilityAttributeMask = aCapabilityAttributeMask; |
|
210 iCapabilityAttributeValue = aCapabilityAttributeValue; |
|
211 iScreenMode = aScreenMode; |
|
212 iSetFlag = EGetFilteredAppsWithCapabilityMaskAndValueWithScreenMode; |
|
213 } |
|
214 |
|
215 //////////////////////// |
|
216 //CAppServiceInfoFilter |
|
217 //////////////////////// |
|
218 |
|
219 CAppServiceInfoFilter::CAppServiceInfoFilter() |
|
220 { |
|
221 |
|
222 } |
|
223 |
|
224 CAppServiceInfoFilter::~CAppServiceInfoFilter() |
|
225 { |
|
226 delete iDataType; |
|
227 } |
|
228 |
|
229 EXPORT_C CAppServiceInfoFilter* CAppServiceInfoFilter::NewLC() |
|
230 { |
|
231 CAppServiceInfoFilter *self = new(ELeave) CAppServiceInfoFilter(); |
|
232 CleanupStack::PushL(self); |
|
233 self->ConstructL(); |
|
234 return self; |
|
235 } |
|
236 |
|
237 |
|
238 EXPORT_C CAppServiceInfoFilter* CAppServiceInfoFilter::NewL() |
|
239 { |
|
240 CAppServiceInfoFilter *self = CAppServiceInfoFilter::NewLC(); |
|
241 CleanupStack::Pop(self); |
|
242 return self; |
|
243 } |
|
244 |
|
245 EXPORT_C CAppServiceInfoFilter* CAppServiceInfoFilter::NewL(RReadStream& aStream) |
|
246 { |
|
247 CAppServiceInfoFilter *self = CAppServiceInfoFilter::NewLC(); |
|
248 self->InternalizeL(aStream); |
|
249 CleanupStack::Pop(self); |
|
250 return self; |
|
251 } |
|
252 |
|
253 void CAppServiceInfoFilter::ConstructL() |
|
254 { |
|
255 DeleteObjectZ(iDataType); |
|
256 iDataType = KNullDesC().AllocL(); |
|
257 |
|
258 } |
|
259 |
|
260 EXPORT_C void CAppServiceInfoFilter::ExternalizeL(RWriteStream& aStream) const |
|
261 { |
|
262 aStream.WriteUint16L(iSetFlag); |
|
263 aStream.WriteUint32L(iAppUid.iUid); |
|
264 aStream.WriteUint32L(iServiceUid.iUid); |
|
265 aStream << *iDataType; |
|
266 } |
|
267 |
|
268 void CAppServiceInfoFilter::InternalizeL(RReadStream& aStream) |
|
269 { |
|
270 iSetFlag = aStream.ReadUint16L(); |
|
271 iAppUid = TUid::Uid(aStream.ReadUint32L()); |
|
272 iServiceUid = TUid::Uid(aStream.ReadUint32L()); |
|
273 DeleteObjectZ(iDataType); |
|
274 iDataType = HBufC::NewL(aStream, KMaxTInt); |
|
275 |
|
276 } |
|
277 |
|
278 |
|
279 EXPORT_C void CAppServiceInfoFilter::SetAppUidForServiceInfo (const TUid aAppUid) |
|
280 { |
|
281 iAppUid = aAppUid; |
|
282 iSetFlag = EGetServiceInfoForApp; |
|
283 } |
|
284 |
|
285 EXPORT_C void CAppServiceInfoFilter::SetServiceUidForServiceImplementations (const TUid aServiceUid) |
|
286 { |
|
287 iServiceUid = aServiceUid; |
|
288 iSetFlag = EGetServiceImplementationForServiceUid; |
|
289 } |
|
290 |
|
291 EXPORT_C void CAppServiceInfoFilter::SetServiceUidAndDatatTypeForServiceImplementationsL (const TUid aServiceUid, const TDesC& aDataType) |
|
292 { |
|
293 iServiceUid = aServiceUid; |
|
294 DeleteObjectZ(iDataType); |
|
295 iDataType = aDataType.AllocL(); |
|
296 iSetFlag = EGetServiceImplementationForServiceUidAndDatatType; |
|
297 } |
|
298 |
|
299 EXPORT_C void CAppServiceInfoFilter::SetAppUidAndServiceUidForOpaqueData (const TUid aAppUid, const TUid aServiceUid) |
|
300 { |
|
301 iAppUid = aAppUid; |
|
302 iServiceUid = aServiceUid; |
|
303 iSetFlag = EGetOpaqueDataForAppWithServiceUid; |
|
304 } |
|
305 |
|
306 /////////////////////// |
|
307 // COpaqueData |
|
308 /////////////////////// |
|
309 |
|
310 COpaqueData::COpaqueData() |
|
311 { |
|
312 // empty |
|
313 } |
|
314 |
|
315 COpaqueData::~COpaqueData() |
|
316 { |
|
317 delete iOpaqueData; |
|
318 } |
|
319 |
|
320 EXPORT_C COpaqueData* COpaqueData::NewL() |
|
321 { |
|
322 COpaqueData *self = COpaqueData::NewLC(); |
|
323 CleanupStack::Pop(self); |
|
324 return self; |
|
325 } |
|
326 |
|
327 EXPORT_C COpaqueData* COpaqueData::NewLC() |
|
328 { |
|
329 COpaqueData *self = new(ELeave) COpaqueData(); |
|
330 CleanupStack::PushL(self); |
|
331 self->ConstructL(KNullDesC8(), TLanguage(0)); |
|
332 return self; |
|
333 } |
|
334 |
|
335 EXPORT_C COpaqueData* COpaqueData::NewL(TDesC8& aOpaqueData, TLanguage aLanguage) |
|
336 { |
|
337 COpaqueData *self = COpaqueData::NewLC(aOpaqueData, aLanguage); |
|
338 CleanupStack::Pop(self); |
|
339 return self; |
|
340 } |
|
341 |
|
342 EXPORT_C COpaqueData* COpaqueData::NewLC(TDesC8& aOpaqueData, TLanguage aLanguage) |
|
343 { |
|
344 COpaqueData *self = new(ELeave) COpaqueData(); |
|
345 CleanupStack::PushL(self); |
|
346 self->ConstructL(aOpaqueData, aLanguage); |
|
347 return self; |
|
348 } |
|
349 |
|
350 EXPORT_C COpaqueData* COpaqueData::NewL(RReadStream& aStream) |
|
351 { |
|
352 COpaqueData *self = COpaqueData::NewLC(); |
|
353 self->InternalizeL(aStream); |
|
354 CleanupStack::Pop(self); |
|
355 return self; |
|
356 } |
|
357 |
|
358 void COpaqueData::ConstructL(const TDesC8& aOpaqueData, TLanguage aLanguage) |
|
359 { |
|
360 iOpaqueData = aOpaqueData.AllocL(); |
|
361 iLanguage = aLanguage; |
|
362 } |
|
363 |
|
364 EXPORT_C HBufC8& COpaqueData::OpaqueData() |
|
365 { |
|
366 return *iOpaqueData; |
|
367 } |
|
368 |
|
369 EXPORT_C TLanguage COpaqueData::Language() |
|
370 { |
|
371 return iLanguage; |
|
372 } |
|
373 |
|
374 |
|
375 EXPORT_C void COpaqueData::ExternalizeL(RWriteStream& aStream) const |
|
376 { |
|
377 aStream.WriteInt32L(iOpaqueData->Length()); |
|
378 aStream << *iOpaqueData; |
|
379 aStream.WriteUint16L(iLanguage); |
|
380 } |
|
381 |
|
382 EXPORT_C void COpaqueData::InternalizeL(RReadStream& aStream) |
|
383 { |
|
384 DeleteObjectZ(iOpaqueData); |
|
385 |
|
386 TInt32 opaqueDataLength = aStream.ReadInt32L(); |
|
387 iOpaqueData = HBufC8::NewL(aStream, opaqueDataLength); |
|
388 iLanguage = (TLanguage) aStream.ReadUint16L(); |
|
389 } |
|
390 |
|
391 /////////////////////// |
|
392 // CApplicationRegistrationData |
|
393 /////////////////////// |
|
394 |
|
395 CApplicationRegistrationData::CApplicationRegistrationData() |
|
396 { |
|
397 // empty |
|
398 } |
|
399 |
|
400 CApplicationRegistrationData::~CApplicationRegistrationData() |
|
401 { |
|
402 iOwnedFileArray.ResetAndDestroy(); |
|
403 iServiceArray.ResetAndDestroy(); |
|
404 iLocalizableAppInfoList.ResetAndDestroy(); |
|
405 iAppPropertiesArray.ResetAndDestroy(); |
|
406 iOpaqueDataArray.ResetAndDestroy(); |
|
407 delete iAppFile; |
|
408 } |
|
409 |
|
410 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL() |
|
411 { |
|
412 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(); |
|
413 CleanupStack::Pop(self); |
|
414 return self; |
|
415 } |
|
416 |
|
417 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC() |
|
418 { |
|
419 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
420 CleanupStack::PushL(self); |
|
421 self->ConstructL(KNullDesC()); |
|
422 return self; |
|
423 } |
|
424 |
|
425 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL(RReadStream& aStream) |
|
426 { |
|
427 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(); |
|
428 self->InternalizeL(aStream); |
|
429 CleanupStack::Pop(self); |
|
430 return self; |
|
431 } |
|
432 |
|
433 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<CServiceInfo>& aServiceArray, RPointerArray<CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
434 RPointerArray<CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
435 const TDesC& aAppFile) |
|
436 { |
|
437 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
438 aAppPropertiesArray, aAppUid, aAppFile); |
|
439 CleanupStack::Pop(self); |
|
440 return self; |
|
441 } |
|
442 |
|
443 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<CServiceInfo>& aServiceArray, RPointerArray<CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
444 RPointerArray<CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
445 const TDesC& aAppFile) |
|
446 { |
|
447 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
448 CleanupStack::PushL(self); |
|
449 self->ConstructL(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
450 aAppPropertiesArray, aAppUid, aAppFile); |
|
451 return self; |
|
452 } |
|
453 |
|
454 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL( |
|
455 RPointerArray<HBufC>& aOwnedFileArray, RPointerArray< |
|
456 Usif::CServiceInfo>& aServiceArray, RPointerArray< |
|
457 Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
458 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
459 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
460 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
461 TInt aDefaultScreenNumber, TInt aTypeId) |
|
462 { |
|
463 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC( |
|
464 aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
465 aAppPropertiesArray, aOpaqueDataArray, aAppUid, aAppFile, |
|
466 aCharacteristics, aDefaultScreenNumber, aTypeId); |
|
467 CleanupStack::Pop(self); |
|
468 return self; |
|
469 } |
|
470 |
|
471 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
472 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
473 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
474 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
475 TInt aDefaultScreenNumber, TInt aTypeId) |
|
476 { |
|
477 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
478 CleanupStack::PushL(self); |
|
479 self->ConstructL(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
480 aAppPropertiesArray, aOpaqueDataArray, aAppUid, aAppFile, aCharacteristics, |
|
481 aDefaultScreenNumber, aTypeId); |
|
482 return self; |
|
483 } |
|
484 |
|
485 void CApplicationRegistrationData::ConstructL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
486 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
487 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
488 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
489 TInt aDefaultScreenNumber, TInt aTypeId) |
|
490 { |
|
491 iOwnedFileArray = aOwnedFileArray; |
|
492 iServiceArray = aServiceArray; |
|
493 iLocalizableAppInfoList = aLocalizableAppInfoList; |
|
494 iAppPropertiesArray = aAppPropertiesArray; |
|
495 iOpaqueDataArray = aOpaqueDataArray; |
|
496 iAppUid = aAppUid; |
|
497 DeleteObjectZ(iAppFile); |
|
498 iAppFile = aAppFile.AllocL(); |
|
499 iTypeId = aTypeId; |
|
500 iCharacteristics.iAttributes = aCharacteristics.iAttributes; |
|
501 iCharacteristics.iAppIsHidden = aCharacteristics.iAppIsHidden; |
|
502 iCharacteristics.iEmbeddability = aCharacteristics.iEmbeddability; |
|
503 iCharacteristics.iSupportsNewFile = aCharacteristics.iSupportsNewFile; |
|
504 iCharacteristics.iLaunchInBackground = aCharacteristics.iLaunchInBackground; |
|
505 iCharacteristics.iGroupName = aCharacteristics.iGroupName; |
|
506 iDefaultScreenNumber = aDefaultScreenNumber; |
|
507 } |
|
508 |
|
509 void CApplicationRegistrationData::ConstructL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
510 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
511 const TDesC& aAppFile) |
|
512 { |
|
513 iOwnedFileArray = aOwnedFileArray; |
|
514 iServiceArray = aServiceArray; |
|
515 iLocalizableAppInfoList = aLocalizableAppInfoList; |
|
516 iAppPropertiesArray = aAppPropertiesArray; |
|
517 iAppUid = aAppUid; |
|
518 DeleteObjectZ(iAppFile); |
|
519 iAppFile = aAppFile.AllocL(); |
|
520 } |
|
521 |
|
522 void CApplicationRegistrationData::ConstructL(const TDesC& aAppFile) |
|
523 { |
|
524 DeleteObjectZ(iAppFile); |
|
525 iAppFile = aAppFile.AllocL(); |
|
526 } |
|
527 |
|
528 EXPORT_C void CApplicationRegistrationData::ExternalizeL(RWriteStream& aStream) const |
|
529 { |
|
530 ExternalizePointersArrayL(iOwnedFileArray, aStream); |
|
531 ExternalizePointersArrayL(iServiceArray, aStream); |
|
532 ExternalizePointersArrayL(iLocalizableAppInfoList, aStream); |
|
533 ExternalizePointersArrayL(iAppPropertiesArray, aStream); |
|
534 ExternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
535 aStream << iAppUid; |
|
536 aStream << *iAppFile; |
|
537 aStream.WriteInt32L(iTypeId); |
|
538 aStream << iCharacteristics; |
|
539 aStream.WriteInt32L(iDefaultScreenNumber); |
|
540 } |
|
541 |
|
542 EXPORT_C void CApplicationRegistrationData::InternalizeL(RReadStream& aStream) |
|
543 { |
|
544 iOwnedFileArray.ResetAndDestroy(); |
|
545 InternalizePointersArrayL(iOwnedFileArray, aStream); |
|
546 iServiceArray.ResetAndDestroy(); |
|
547 InternalizePointersArrayL(iServiceArray, aStream); |
|
548 iLocalizableAppInfoList.ResetAndDestroy(); |
|
549 InternalizePointersArrayL(iLocalizableAppInfoList, aStream); |
|
550 iAppPropertiesArray.ResetAndDestroy(); |
|
551 InternalizePointersArrayL(iAppPropertiesArray, aStream); |
|
552 iOpaqueDataArray.ResetAndDestroy(); |
|
553 InternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
554 |
|
555 aStream >> iAppUid; |
|
556 |
|
557 DeleteObjectZ(iAppFile); |
|
558 iAppFile = HBufC::NewL(aStream, KMaxTInt); |
|
559 |
|
560 iTypeId = aStream.ReadInt32L(); |
|
561 aStream >> iCharacteristics; |
|
562 iDefaultScreenNumber = aStream.ReadInt32L(); |
|
563 } |
|
564 |
|
565 EXPORT_C const TUid CApplicationRegistrationData::AppUid() const |
|
566 { |
|
567 return iAppUid; |
|
568 } |
|
569 |
|
570 EXPORT_C const TDesC& CApplicationRegistrationData::AppFile() const |
|
571 { |
|
572 return *iAppFile; |
|
573 } |
|
574 |
|
575 EXPORT_C TInt CApplicationRegistrationData::TypeId() const |
|
576 { |
|
577 return iTypeId; |
|
578 } |
|
579 |
|
580 EXPORT_C TUint CApplicationRegistrationData::Attributes() const |
|
581 { |
|
582 return iCharacteristics.iAttributes; |
|
583 } |
|
584 |
|
585 EXPORT_C TBool CApplicationRegistrationData::Hidden() const |
|
586 { |
|
587 return iCharacteristics.iAppIsHidden; |
|
588 } |
|
589 |
|
590 EXPORT_C TApplicationCharacteristics::TAppEmbeddability CApplicationRegistrationData::Embeddability() const |
|
591 { |
|
592 return iCharacteristics.iEmbeddability; |
|
593 } |
|
594 |
|
595 EXPORT_C TBool CApplicationRegistrationData::NewFile() const |
|
596 { |
|
597 return iCharacteristics.iSupportsNewFile; |
|
598 } |
|
599 |
|
600 EXPORT_C TBool CApplicationRegistrationData::Launch() const |
|
601 { |
|
602 return iCharacteristics.iLaunchInBackground; |
|
603 } |
|
604 |
|
605 EXPORT_C const TDesC& CApplicationRegistrationData::GroupName() const |
|
606 { |
|
607 return iCharacteristics.iGroupName; |
|
608 } |
|
609 |
|
610 EXPORT_C TInt CApplicationRegistrationData::DefaultScreenNumber() const |
|
611 { |
|
612 return iDefaultScreenNumber; |
|
613 } |
|
614 |
|
615 EXPORT_C const RPointerArray<HBufC>& CApplicationRegistrationData::OwnedFileArray() const |
|
616 { |
|
617 return iOwnedFileArray; |
|
618 } |
|
619 |
|
620 EXPORT_C const RPointerArray<CServiceInfo>& CApplicationRegistrationData::ServiceArray() const |
|
621 { |
|
622 return iServiceArray; |
|
623 } |
|
624 |
|
625 EXPORT_C const RPointerArray<CLocalizableAppInfo>& CApplicationRegistrationData::LocalizableAppInfoList() const |
|
626 { |
|
627 return iLocalizableAppInfoList; |
|
628 } |
|
629 |
|
630 EXPORT_C const RPointerArray<CPropertyEntry>& CApplicationRegistrationData::AppProperties() const |
|
631 { |
|
632 return iAppPropertiesArray; |
|
633 } |
|
634 |
|
635 EXPORT_C const RPointerArray<COpaqueData>& CApplicationRegistrationData::AppOpaqueData() const |
|
636 { |
|
637 return iOpaqueDataArray; |
|
638 } |
|
639 |
|
640 /////////////////////// |
|
641 // CDataType |
|
642 /////////////////////// |
|
643 |
|
644 CDataType::CDataType() |
|
645 { |
|
646 // empty |
|
647 } |
|
648 |
|
649 CDataType::~CDataType() |
|
650 { |
|
651 delete iType; |
|
652 } |
|
653 |
|
654 EXPORT_C CDataType* CDataType::NewL() |
|
655 { |
|
656 CDataType *self = CDataType::NewLC(); |
|
657 CleanupStack::Pop(self); |
|
658 return self; |
|
659 } |
|
660 |
|
661 EXPORT_C CDataType* CDataType::NewLC() |
|
662 { |
|
663 CDataType *self = new(ELeave) CDataType(); |
|
664 CleanupStack::PushL(self); |
|
665 self->ConstructL(0, KNullDesC()); |
|
666 return self; |
|
667 } |
|
668 |
|
669 EXPORT_C CDataType* CDataType::NewL(RReadStream& aStream) |
|
670 { |
|
671 CDataType *self = CDataType::NewLC(); |
|
672 self->InternalizeL(aStream); |
|
673 CleanupStack::Pop(self); |
|
674 return self; |
|
675 } |
|
676 |
|
677 EXPORT_C CDataType* CDataType::NewL(TInt aPriority, const TDesC& aType) |
|
678 { |
|
679 CDataType *self = CDataType::NewLC(aPriority, aType); |
|
680 CleanupStack::Pop(self); |
|
681 return self; |
|
682 } |
|
683 |
|
684 EXPORT_C CDataType* CDataType::NewLC(TInt aPriority, const TDesC& aType) |
|
685 { |
|
686 CDataType *self = new(ELeave) CDataType(); |
|
687 CleanupStack::PushL(self); |
|
688 self->ConstructL(aPriority, aType); |
|
689 return self; |
|
690 } |
|
691 |
|
692 void CDataType::ConstructL(TInt aPriority, const TDesC& aType) |
|
693 { |
|
694 iPriority = aPriority; |
|
695 DeleteObjectZ(iType); |
|
696 iType = aType.AllocL(); |
|
697 } |
|
698 |
|
699 EXPORT_C void CDataType::ExternalizeL(RWriteStream& aStream) const |
|
700 { |
|
701 aStream.WriteInt32L(iPriority); |
|
702 aStream << *iType; |
|
703 } |
|
704 |
|
705 EXPORT_C void CDataType::InternalizeL(RReadStream& aStream) |
|
706 { |
|
707 iPriority = aStream.ReadInt32L(); |
|
708 DeleteObjectZ(iType); |
|
709 iType = HBufC::NewL(aStream, KMaxTInt); |
|
710 } |
|
711 |
|
712 EXPORT_C TInt CDataType::Priority() const |
|
713 { |
|
714 return iPriority; |
|
715 } |
|
716 |
|
717 EXPORT_C const TDesC& CDataType::Type() const |
|
718 { |
|
719 return *iType; |
|
720 } |
|
721 |
|
722 /////////////////////// |
|
723 // CServiceInfo |
|
724 /////////////////////// |
|
725 |
|
726 CServiceInfo::CServiceInfo() |
|
727 { |
|
728 // empty |
|
729 } |
|
730 |
|
731 CServiceInfo::~CServiceInfo() |
|
732 { |
|
733 iDataTypes.ResetAndDestroy(); |
|
734 iOpaqueDataArray.ResetAndDestroy(); |
|
735 } |
|
736 |
|
737 EXPORT_C CServiceInfo* CServiceInfo::NewL() |
|
738 { |
|
739 CServiceInfo *self = CServiceInfo::NewLC(); |
|
740 CleanupStack::Pop(self); |
|
741 return self; |
|
742 } |
|
743 |
|
744 EXPORT_C CServiceInfo* CServiceInfo::NewLC() |
|
745 { |
|
746 CServiceInfo *self = new(ELeave) CServiceInfo(); |
|
747 CleanupStack::PushL(self); |
|
748 return self; |
|
749 } |
|
750 |
|
751 EXPORT_C CServiceInfo* CServiceInfo::NewL(RReadStream& aStream) |
|
752 { |
|
753 CServiceInfo *self = CServiceInfo::NewLC(); |
|
754 self->InternalizeL(aStream); |
|
755 CleanupStack::Pop(self); |
|
756 return self; |
|
757 } |
|
758 |
|
759 EXPORT_C CServiceInfo* CServiceInfo::NewL(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
760 { |
|
761 CServiceInfo *self = CServiceInfo::NewLC(aUid, aOpaqueDataArray, aDataTypes); |
|
762 CleanupStack::Pop(self); |
|
763 return self; |
|
764 } |
|
765 |
|
766 EXPORT_C CServiceInfo* CServiceInfo::NewLC(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
767 { |
|
768 CServiceInfo *self = new(ELeave) CServiceInfo(); |
|
769 CleanupStack::PushL(self); |
|
770 self->ConstructL(aUid, aOpaqueDataArray, aDataTypes); |
|
771 return self; |
|
772 } |
|
773 |
|
774 void CServiceInfo::ConstructL(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
775 { |
|
776 iUid = aUid; |
|
777 iOpaqueDataArray = aOpaqueDataArray; |
|
778 iDataTypes = aDataTypes; |
|
779 } |
|
780 |
|
781 EXPORT_C void CServiceInfo::ExternalizeL(RWriteStream& aStream) const |
|
782 { |
|
783 aStream << iUid; |
|
784 ExternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
785 ExternalizePointersArrayL(iDataTypes, aStream); |
|
786 } |
|
787 |
|
788 EXPORT_C void CServiceInfo::InternalizeL(RReadStream& aStream) |
|
789 { |
|
790 aStream >> iUid; |
|
791 iOpaqueDataArray.Reset(); |
|
792 InternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
793 InternalizePointersArrayL(iDataTypes, aStream); |
|
794 } |
|
795 |
|
796 EXPORT_C const TUid CServiceInfo::Uid() const |
|
797 { |
|
798 return iUid; |
|
799 } |
|
800 |
|
801 EXPORT_C const RPointerArray<CDataType>& CServiceInfo::DataTypes() const |
|
802 { |
|
803 return iDataTypes; |
|
804 } |
|
805 |
|
806 EXPORT_C const RPointerArray<COpaqueData>& CServiceInfo::OpaqueData() const |
|
807 { |
|
808 return iOpaqueDataArray; |
|
809 } |
|
810 |
|
811 /////////////////////// |
|
812 // CLocalizableAppInfo |
|
813 /////////////////////// |
|
814 |
|
815 CLocalizableAppInfo::CLocalizableAppInfo() |
|
816 { |
|
817 // empty |
|
818 } |
|
819 |
|
820 CLocalizableAppInfo::~CLocalizableAppInfo() |
|
821 { |
|
822 delete iShortCaption; |
|
823 delete iGroupName; |
|
824 delete iCaptionAndIconInfo; |
|
825 iViewDataList.ResetAndDestroy(); |
|
826 } |
|
827 |
|
828 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL() |
|
829 { |
|
830 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(); |
|
831 CleanupStack::Pop(self); |
|
832 return self; |
|
833 } |
|
834 |
|
835 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewLC() |
|
836 { |
|
837 CLocalizableAppInfo *self = new(ELeave) CLocalizableAppInfo(); |
|
838 CleanupStack::PushL(self); |
|
839 self->ConstructL(KNullDesC(), KNullDesC()); |
|
840 return self; |
|
841 } |
|
842 |
|
843 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL(RReadStream& aStream) |
|
844 { |
|
845 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(); |
|
846 self->InternalizeL(aStream); |
|
847 CleanupStack::Pop(self); |
|
848 return self; |
|
849 } |
|
850 |
|
851 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<CAppViewData>& aViewDataList) |
|
852 { |
|
853 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(aShortCaption, aApplicationLanguage, aGroupName, aCaptionAndIconInfo, aViewDataList); |
|
854 CleanupStack::Pop(self); |
|
855 return self; |
|
856 } |
|
857 |
|
858 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewLC(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<CAppViewData>& aViewDataList) |
|
859 { |
|
860 CLocalizableAppInfo *self = new(ELeave) CLocalizableAppInfo(); |
|
861 CleanupStack::PushL(self); |
|
862 self->ConstructL(aShortCaption, aApplicationLanguage, aGroupName, aCaptionAndIconInfo, aViewDataList); |
|
863 return self; |
|
864 } |
|
865 |
|
866 void CLocalizableAppInfo::ConstructL(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<Usif::CAppViewData> aViewDataList) |
|
867 { |
|
868 DeleteObjectZ(iShortCaption); |
|
869 iShortCaption = aShortCaption.AllocL(); |
|
870 iApplicationLanguage = aApplicationLanguage; |
|
871 DeleteObjectZ(iGroupName); |
|
872 iGroupName = aGroupName.AllocL(); |
|
873 iCaptionAndIconInfo = aCaptionAndIconInfo; |
|
874 iViewDataList = aViewDataList; |
|
875 } |
|
876 |
|
877 void CLocalizableAppInfo::ConstructL(const TDesC& aShortCaption, const TDesC& aGroupName) |
|
878 { |
|
879 DeleteObjectZ(iShortCaption); |
|
880 iShortCaption = aShortCaption.AllocL(); |
|
881 DeleteObjectZ(iGroupName); |
|
882 iGroupName = aGroupName.AllocL(); |
|
883 } |
|
884 |
|
885 |
|
886 EXPORT_C void CLocalizableAppInfo::ExternalizeL(RWriteStream& aStream) const |
|
887 { |
|
888 aStream << *iShortCaption; |
|
889 aStream << TCardinality(iApplicationLanguage); |
|
890 aStream << *iGroupName; |
|
891 if(NULL != iCaptionAndIconInfo) |
|
892 { |
|
893 aStream.WriteInt8L(ETrue); |
|
894 aStream << *iCaptionAndIconInfo; |
|
895 } |
|
896 else |
|
897 { |
|
898 aStream.WriteInt8L(EFalse); |
|
899 } |
|
900 ExternalizePointersArrayL(iViewDataList, aStream); |
|
901 } |
|
902 |
|
903 EXPORT_C void CLocalizableAppInfo::InternalizeL(RReadStream& aStream) |
|
904 { |
|
905 DeleteObjectZ(iShortCaption); |
|
906 iShortCaption = HBufC::NewL(aStream, KMaxTInt); |
|
907 TCardinality c; |
|
908 aStream >> c; |
|
909 iApplicationLanguage = static_cast<TLanguage>(static_cast<TInt>(c)); |
|
910 DeleteObjectZ(iGroupName); |
|
911 iGroupName = HBufC::NewL(aStream, KMaxTInt); |
|
912 DeleteObjectZ(iCaptionAndIconInfo); |
|
913 TBool isCaptionAndIconInfo= aStream.ReadInt8L(); |
|
914 if(isCaptionAndIconInfo) |
|
915 { |
|
916 iCaptionAndIconInfo = CCaptionAndIconInfo::NewL(aStream); |
|
917 } |
|
918 InternalizePointersArrayL(iViewDataList, aStream); |
|
919 } |
|
920 |
|
921 EXPORT_C const TDesC& CLocalizableAppInfo::ShortCaption() const |
|
922 { |
|
923 return *iShortCaption; |
|
924 } |
|
925 |
|
926 EXPORT_C TLanguage CLocalizableAppInfo::ApplicationLanguage() const |
|
927 { |
|
928 return iApplicationLanguage; |
|
929 } |
|
930 |
|
931 EXPORT_C const TDesC& CLocalizableAppInfo::GroupName() const |
|
932 { |
|
933 return *iGroupName; |
|
934 } |
|
935 |
|
936 EXPORT_C const RPointerArray<CAppViewData>& CLocalizableAppInfo::ViewDataList() const |
|
937 { |
|
938 return iViewDataList; |
|
939 } |
|
940 |
|
941 EXPORT_C const CCaptionAndIconInfo* CLocalizableAppInfo::CaptionAndIconInfo() const |
|
942 { |
|
943 return iCaptionAndIconInfo; |
|
944 } |
|
945 |
|
946 /////////////////////// |
|
947 // CCaptionAndIconInfo |
|
948 /////////////////////// |
|
949 |
|
950 CCaptionAndIconInfo::CCaptionAndIconInfo() |
|
951 { |
|
952 // empty |
|
953 } |
|
954 |
|
955 CCaptionAndIconInfo::~CCaptionAndIconInfo() |
|
956 { |
|
957 delete iCaption; |
|
958 delete iIconFileName; |
|
959 } |
|
960 |
|
961 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL() |
|
962 { |
|
963 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(); |
|
964 CleanupStack::Pop(self); |
|
965 return self; |
|
966 } |
|
967 |
|
968 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewLC() |
|
969 { |
|
970 CCaptionAndIconInfo *self = new(ELeave) CCaptionAndIconInfo(); |
|
971 CleanupStack::PushL(self); |
|
972 self->ConstructL(KNullDesC(), KNullDesC(), 0); |
|
973 return self; |
|
974 } |
|
975 |
|
976 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL(RReadStream& aStream) |
|
977 { |
|
978 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(); |
|
979 self->InternalizeL(aStream); |
|
980 CleanupStack::Pop(self); |
|
981 return self; |
|
982 } |
|
983 |
|
984 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
985 { |
|
986 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(aCaption, aIconFileName, aNumOfAppIcons); |
|
987 CleanupStack::Pop(self); |
|
988 return self; |
|
989 } |
|
990 |
|
991 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewLC(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
992 { |
|
993 CCaptionAndIconInfo *self = new(ELeave) CCaptionAndIconInfo(); |
|
994 CleanupStack::PushL(self); |
|
995 self->ConstructL(aCaption, aIconFileName, aNumOfAppIcons); |
|
996 return self; |
|
997 } |
|
998 |
|
999 void CCaptionAndIconInfo::ConstructL(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
1000 { |
|
1001 DeleteObjectZ(iCaption); |
|
1002 iCaption = aCaption.AllocL(); |
|
1003 DeleteObjectZ(iIconFileName); |
|
1004 iIconFileName = aIconFileName.AllocL(); |
|
1005 iNumOfAppIcons = aNumOfAppIcons; |
|
1006 } |
|
1007 |
|
1008 EXPORT_C void CCaptionAndIconInfo::ExternalizeL(RWriteStream& aStream) const |
|
1009 { |
|
1010 aStream << *iCaption; |
|
1011 aStream << *iIconFileName; |
|
1012 aStream.WriteInt32L(iNumOfAppIcons); |
|
1013 } |
|
1014 |
|
1015 EXPORT_C void CCaptionAndIconInfo::InternalizeL(RReadStream& aStream) |
|
1016 { |
|
1017 DeleteObjectZ(iCaption); |
|
1018 iCaption = HBufC::NewL(aStream, KMaxTInt); |
|
1019 DeleteObjectZ(iIconFileName); |
|
1020 iIconFileName = HBufC::NewL(aStream, KMaxTInt); |
|
1021 iNumOfAppIcons = aStream.ReadInt32L(); |
|
1022 } |
|
1023 |
|
1024 EXPORT_C const TDesC& CCaptionAndIconInfo::Caption() const |
|
1025 { |
|
1026 return *iCaption; |
|
1027 } |
|
1028 |
|
1029 EXPORT_C const TDesC& CCaptionAndIconInfo::IconFileName() const |
|
1030 { |
|
1031 return *iIconFileName; |
|
1032 } |
|
1033 |
|
1034 EXPORT_C TInt CCaptionAndIconInfo::NumOfAppIcons() const |
|
1035 { |
|
1036 return iNumOfAppIcons; |
|
1037 } |
|
1038 |
|
1039 /////////////////////// |
|
1040 // CAppViewData |
|
1041 /////////////////////// |
|
1042 |
|
1043 CAppViewData::CAppViewData() |
|
1044 { |
|
1045 // empty |
|
1046 } |
|
1047 |
|
1048 CAppViewData::~CAppViewData() |
|
1049 { |
|
1050 delete iCaptionAndIconInfo; |
|
1051 } |
|
1052 |
|
1053 EXPORT_C CAppViewData* CAppViewData::NewL() |
|
1054 { |
|
1055 CAppViewData *self = CAppViewData::NewLC(); |
|
1056 CleanupStack::Pop(self); |
|
1057 return self; |
|
1058 } |
|
1059 |
|
1060 EXPORT_C CAppViewData* CAppViewData::NewLC() |
|
1061 { |
|
1062 CAppViewData *self = new(ELeave) CAppViewData(); |
|
1063 CleanupStack::PushL(self); |
|
1064 return self; |
|
1065 } |
|
1066 |
|
1067 EXPORT_C CAppViewData* CAppViewData::NewL(RReadStream& aStream) |
|
1068 { |
|
1069 CAppViewData *self = CAppViewData::NewLC(); |
|
1070 self->InternalizeL(aStream); |
|
1071 CleanupStack::Pop(self); |
|
1072 return self; |
|
1073 } |
|
1074 |
|
1075 EXPORT_C CAppViewData* CAppViewData::NewL(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1076 { |
|
1077 CAppViewData *self = CAppViewData::NewLC(aUid, aScreenMode, aCaptionAndIconInfo); |
|
1078 CleanupStack::Pop(self); |
|
1079 return self; |
|
1080 } |
|
1081 |
|
1082 EXPORT_C CAppViewData* CAppViewData::NewLC(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1083 { |
|
1084 CAppViewData *self = new(ELeave) CAppViewData(); |
|
1085 CleanupStack::PushL(self); |
|
1086 self->ConstructL(aUid, aScreenMode, aCaptionAndIconInfo); |
|
1087 return self; |
|
1088 } |
|
1089 |
|
1090 void CAppViewData::ConstructL(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1091 { |
|
1092 iUid = aUid; |
|
1093 iScreenMode = aScreenMode; |
|
1094 iCaptionAndIconInfo = aCaptionAndIconInfo; |
|
1095 } |
|
1096 |
|
1097 EXPORT_C void CAppViewData::ExternalizeL(RWriteStream& aStream) const |
|
1098 { |
|
1099 aStream << iUid; |
|
1100 aStream.WriteInt32L(iScreenMode); |
|
1101 if(NULL != iCaptionAndIconInfo) |
|
1102 { |
|
1103 aStream.WriteInt8L(ETrue); |
|
1104 aStream << *iCaptionAndIconInfo; |
|
1105 } |
|
1106 else |
|
1107 { |
|
1108 aStream.WriteInt8L(EFalse); |
|
1109 } |
|
1110 } |
|
1111 |
|
1112 EXPORT_C void CAppViewData::InternalizeL(RReadStream& aStream) |
|
1113 { |
|
1114 aStream >> iUid; |
|
1115 iScreenMode = aStream.ReadInt32L(); |
|
1116 DeleteObjectZ(iCaptionAndIconInfo); |
|
1117 TBool isCaptionAndIconInfo= aStream.ReadInt8L(); |
|
1118 if(isCaptionAndIconInfo) |
|
1119 { |
|
1120 iCaptionAndIconInfo = CCaptionAndIconInfo::NewL(aStream); |
|
1121 } |
|
1122 } |
|
1123 |
|
1124 EXPORT_C const TUid CAppViewData::Uid() const |
|
1125 { |
|
1126 return iUid; |
|
1127 } |
|
1128 |
|
1129 EXPORT_C TInt CAppViewData::ScreenMode() const |
|
1130 { |
|
1131 return iScreenMode; |
|
1132 } |
|
1133 |
|
1134 EXPORT_C const CCaptionAndIconInfo* CAppViewData::CaptionAndIconInfo() const |
|
1135 { |
|
1136 return iCaptionAndIconInfo; |
|
1137 } |
|
1138 |
|
1139 |
|
1140 /////////////////////// |
|
1141 // CLauncherExecutable |
|
1142 /////////////////////// |
|
1143 |
|
1144 CLauncherExecutable::CLauncherExecutable() |
|
1145 { |
|
1146 } |
|
1147 |
|
1148 CLauncherExecutable::~CLauncherExecutable() |
|
1149 { |
|
1150 delete iLauncher; |
|
1151 } |
|
1152 |
|
1153 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL() |
|
1154 { |
|
1155 CLauncherExecutable *self = CLauncherExecutable::NewLC(); |
|
1156 CleanupStack::Pop(self); |
|
1157 return self; |
|
1158 } |
|
1159 |
|
1160 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewLC() |
|
1161 { |
|
1162 CLauncherExecutable *self = new(ELeave) CLauncherExecutable(); |
|
1163 CleanupStack::PushL(self); |
|
1164 self->ConstructL(0, KNullDesC()); |
|
1165 return self; |
|
1166 } |
|
1167 |
|
1168 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL(TInt aTypeId, const TDesC& aLauncher) |
|
1169 { |
|
1170 CLauncherExecutable *self = CLauncherExecutable::NewLC(aTypeId, aLauncher); |
|
1171 CleanupStack::Pop(self); |
|
1172 return self; |
|
1173 } |
|
1174 |
|
1175 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewLC(TInt aTypeId, const TDesC& aLauncher) |
|
1176 { |
|
1177 CLauncherExecutable *self = new(ELeave) CLauncherExecutable(); |
|
1178 CleanupStack::PushL(self); |
|
1179 self->ConstructL(aTypeId, aLauncher); |
|
1180 return self; |
|
1181 } |
|
1182 |
|
1183 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL(RReadStream& aStream) |
|
1184 { |
|
1185 CLauncherExecutable *self = CLauncherExecutable::NewLC(); |
|
1186 self->InternalizeL(aStream); |
|
1187 CleanupStack::Pop(self); |
|
1188 return self; |
|
1189 } |
|
1190 |
|
1191 void CLauncherExecutable::ConstructL(TInt aTypeId, const TDesC& aLauncher) |
|
1192 { |
|
1193 iTypeId = aTypeId; |
|
1194 DeleteObjectZ(iLauncher); |
|
1195 iLauncher = aLauncher.AllocL(); |
|
1196 } |
|
1197 |
|
1198 EXPORT_C const TDesC& CLauncherExecutable::Launcher() const |
|
1199 { |
|
1200 return *iLauncher; |
|
1201 } |
|
1202 |
|
1203 EXPORT_C TInt CLauncherExecutable::TypeId() const |
|
1204 { |
|
1205 return iTypeId; |
|
1206 } |
|
1207 |
|
1208 EXPORT_C void CLauncherExecutable::ExternalizeL(RWriteStream& aStream) const |
|
1209 { |
|
1210 aStream.WriteInt32L(iTypeId); |
|
1211 aStream << *iLauncher; |
|
1212 } |
|
1213 |
|
1214 EXPORT_C void CLauncherExecutable::InternalizeL(RReadStream& aStream) |
|
1215 { |
|
1216 iTypeId = aStream.ReadInt32L(); |
|
1217 |
|
1218 DeleteObjectZ(iLauncher); |
|
1219 iLauncher = HBufC::NewL(aStream, KMaxTInt); |
|
1220 } |
|
1221 |