|
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 //if the length of opaque data is more than 4k, we will truncate it to 4k. |
|
361 const TInt KMaxOpaqueDataLength = 4096; |
|
362 if (aOpaqueData.Length() > KMaxOpaqueDataLength) |
|
363 { |
|
364 iOpaqueData = HBufC8::NewL(KMaxOpaqueDataLength); |
|
365 iOpaqueData->Des().Copy(aOpaqueData.Ptr(),KMaxOpaqueDataLength); |
|
366 } |
|
367 else |
|
368 { |
|
369 iOpaqueData = aOpaqueData.AllocL(); |
|
370 } |
|
371 iLanguage = aLanguage; |
|
372 } |
|
373 |
|
374 EXPORT_C HBufC8& COpaqueData::OpaqueData() |
|
375 { |
|
376 return *iOpaqueData; |
|
377 } |
|
378 |
|
379 EXPORT_C TLanguage COpaqueData::Language() |
|
380 { |
|
381 return iLanguage; |
|
382 } |
|
383 |
|
384 |
|
385 EXPORT_C void COpaqueData::ExternalizeL(RWriteStream& aStream) const |
|
386 { |
|
387 aStream.WriteInt32L(iOpaqueData->Length()); |
|
388 aStream << *iOpaqueData; |
|
389 aStream.WriteUint16L(iLanguage); |
|
390 } |
|
391 |
|
392 EXPORT_C void COpaqueData::InternalizeL(RReadStream& aStream) |
|
393 { |
|
394 DeleteObjectZ(iOpaqueData); |
|
395 |
|
396 TInt32 opaqueDataLength = aStream.ReadInt32L(); |
|
397 iOpaqueData = HBufC8::NewL(aStream, opaqueDataLength); |
|
398 iLanguage = (TLanguage) aStream.ReadUint16L(); |
|
399 } |
|
400 |
|
401 /////////////////////// |
|
402 // CApplicationRegistrationData |
|
403 /////////////////////// |
|
404 |
|
405 CApplicationRegistrationData::CApplicationRegistrationData() |
|
406 { |
|
407 // empty |
|
408 } |
|
409 |
|
410 CApplicationRegistrationData::~CApplicationRegistrationData() |
|
411 { |
|
412 iOwnedFileArray.ResetAndDestroy(); |
|
413 iServiceArray.ResetAndDestroy(); |
|
414 iLocalizableAppInfoList.ResetAndDestroy(); |
|
415 iAppPropertiesArray.ResetAndDestroy(); |
|
416 iOpaqueDataArray.ResetAndDestroy(); |
|
417 delete iAppFile; |
|
418 } |
|
419 |
|
420 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL() |
|
421 { |
|
422 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(); |
|
423 CleanupStack::Pop(self); |
|
424 return self; |
|
425 } |
|
426 |
|
427 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC() |
|
428 { |
|
429 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
430 CleanupStack::PushL(self); |
|
431 self->ConstructL(KNullDesC()); |
|
432 return self; |
|
433 } |
|
434 |
|
435 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL(RReadStream& aStream) |
|
436 { |
|
437 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(); |
|
438 self->InternalizeL(aStream); |
|
439 CleanupStack::Pop(self); |
|
440 return self; |
|
441 } |
|
442 |
|
443 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<CServiceInfo>& aServiceArray, RPointerArray<CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
444 RPointerArray<CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
445 const TDesC& aAppFile) |
|
446 { |
|
447 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
448 aAppPropertiesArray, aAppUid, aAppFile); |
|
449 CleanupStack::Pop(self); |
|
450 return self; |
|
451 } |
|
452 |
|
453 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<CServiceInfo>& aServiceArray, RPointerArray<CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
454 RPointerArray<CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
455 const TDesC& aAppFile) |
|
456 { |
|
457 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
458 CleanupStack::PushL(self); |
|
459 self->ConstructL(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
460 aAppPropertiesArray, aAppUid, aAppFile); |
|
461 return self; |
|
462 } |
|
463 |
|
464 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewL( |
|
465 RPointerArray<HBufC>& aOwnedFileArray, RPointerArray< |
|
466 Usif::CServiceInfo>& aServiceArray, RPointerArray< |
|
467 Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
468 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
469 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
470 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
471 TInt aDefaultScreenNumber, TInt aTypeId) |
|
472 { |
|
473 CApplicationRegistrationData *self = CApplicationRegistrationData::NewLC( |
|
474 aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
475 aAppPropertiesArray, aOpaqueDataArray, aAppUid, aAppFile, |
|
476 aCharacteristics, aDefaultScreenNumber, aTypeId); |
|
477 CleanupStack::Pop(self); |
|
478 return self; |
|
479 } |
|
480 |
|
481 EXPORT_C CApplicationRegistrationData* CApplicationRegistrationData::NewLC(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
482 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
483 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
484 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
485 TInt aDefaultScreenNumber, TInt aTypeId) |
|
486 { |
|
487 CApplicationRegistrationData *self = new(ELeave) CApplicationRegistrationData(); |
|
488 CleanupStack::PushL(self); |
|
489 self->ConstructL(aOwnedFileArray, aServiceArray, aLocalizableAppInfoList, |
|
490 aAppPropertiesArray, aOpaqueDataArray, aAppUid, aAppFile, aCharacteristics, |
|
491 aDefaultScreenNumber, aTypeId); |
|
492 return self; |
|
493 } |
|
494 |
|
495 void CApplicationRegistrationData::ConstructL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
496 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, |
|
497 RPointerArray<Usif::COpaqueData>& aOpaqueDataArray, TUid aAppUid, |
|
498 const TDesC& aAppFile, TApplicationCharacteristics& aCharacteristics, |
|
499 TInt aDefaultScreenNumber, TInt aTypeId) |
|
500 { |
|
501 iOwnedFileArray = aOwnedFileArray; |
|
502 iServiceArray = aServiceArray; |
|
503 iLocalizableAppInfoList = aLocalizableAppInfoList; |
|
504 iAppPropertiesArray = aAppPropertiesArray; |
|
505 iOpaqueDataArray = aOpaqueDataArray; |
|
506 iAppUid = aAppUid; |
|
507 DeleteObjectZ(iAppFile); |
|
508 iAppFile = aAppFile.AllocL(); |
|
509 iTypeId = aTypeId; |
|
510 iCharacteristics.iAttributes = aCharacteristics.iAttributes; |
|
511 iCharacteristics.iAppIsHidden = aCharacteristics.iAppIsHidden; |
|
512 iCharacteristics.iEmbeddability = aCharacteristics.iEmbeddability; |
|
513 iCharacteristics.iSupportsNewFile = aCharacteristics.iSupportsNewFile; |
|
514 iCharacteristics.iLaunchInBackground = aCharacteristics.iLaunchInBackground; |
|
515 iCharacteristics.iGroupName = aCharacteristics.iGroupName; |
|
516 iDefaultScreenNumber = aDefaultScreenNumber; |
|
517 } |
|
518 |
|
519 void CApplicationRegistrationData::ConstructL(RPointerArray<HBufC>& aOwnedFileArray, RPointerArray<Usif::CServiceInfo> &aServiceArray, RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoList, |
|
520 RPointerArray<Usif::CPropertyEntry>& aAppPropertiesArray, TUid aAppUid, |
|
521 const TDesC& aAppFile) |
|
522 { |
|
523 iOwnedFileArray = aOwnedFileArray; |
|
524 iServiceArray = aServiceArray; |
|
525 iLocalizableAppInfoList = aLocalizableAppInfoList; |
|
526 iAppPropertiesArray = aAppPropertiesArray; |
|
527 iAppUid = aAppUid; |
|
528 DeleteObjectZ(iAppFile); |
|
529 iAppFile = aAppFile.AllocL(); |
|
530 } |
|
531 |
|
532 void CApplicationRegistrationData::ConstructL(const TDesC& aAppFile) |
|
533 { |
|
534 DeleteObjectZ(iAppFile); |
|
535 iAppFile = aAppFile.AllocL(); |
|
536 } |
|
537 |
|
538 EXPORT_C void CApplicationRegistrationData::ExternalizeL(RWriteStream& aStream) const |
|
539 { |
|
540 ExternalizePointersArrayL(iOwnedFileArray, aStream); |
|
541 ExternalizePointersArrayL(iServiceArray, aStream); |
|
542 ExternalizePointersArrayL(iLocalizableAppInfoList, aStream); |
|
543 ExternalizePointersArrayL(iAppPropertiesArray, aStream); |
|
544 ExternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
545 aStream << iAppUid; |
|
546 aStream << *iAppFile; |
|
547 aStream.WriteInt32L(iTypeId); |
|
548 aStream << iCharacteristics; |
|
549 aStream.WriteInt32L(iDefaultScreenNumber); |
|
550 } |
|
551 |
|
552 EXPORT_C void CApplicationRegistrationData::InternalizeL(RReadStream& aStream) |
|
553 { |
|
554 iOwnedFileArray.ResetAndDestroy(); |
|
555 InternalizePointersArrayL(iOwnedFileArray, aStream); |
|
556 iServiceArray.ResetAndDestroy(); |
|
557 InternalizePointersArrayL(iServiceArray, aStream); |
|
558 iLocalizableAppInfoList.ResetAndDestroy(); |
|
559 InternalizePointersArrayL(iLocalizableAppInfoList, aStream); |
|
560 iAppPropertiesArray.ResetAndDestroy(); |
|
561 InternalizePointersArrayL(iAppPropertiesArray, aStream); |
|
562 iOpaqueDataArray.ResetAndDestroy(); |
|
563 InternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
564 |
|
565 aStream >> iAppUid; |
|
566 |
|
567 DeleteObjectZ(iAppFile); |
|
568 iAppFile = HBufC::NewL(aStream, KMaxTInt); |
|
569 |
|
570 iTypeId = aStream.ReadInt32L(); |
|
571 aStream >> iCharacteristics; |
|
572 iDefaultScreenNumber = aStream.ReadInt32L(); |
|
573 } |
|
574 |
|
575 EXPORT_C const TUid CApplicationRegistrationData::AppUid() const |
|
576 { |
|
577 return iAppUid; |
|
578 } |
|
579 |
|
580 EXPORT_C const TDesC& CApplicationRegistrationData::AppFile() const |
|
581 { |
|
582 return *iAppFile; |
|
583 } |
|
584 |
|
585 EXPORT_C TInt CApplicationRegistrationData::TypeId() const |
|
586 { |
|
587 return iTypeId; |
|
588 } |
|
589 |
|
590 EXPORT_C TUint CApplicationRegistrationData::Attributes() const |
|
591 { |
|
592 return iCharacteristics.iAttributes; |
|
593 } |
|
594 |
|
595 EXPORT_C TBool CApplicationRegistrationData::Hidden() const |
|
596 { |
|
597 return iCharacteristics.iAppIsHidden; |
|
598 } |
|
599 |
|
600 EXPORT_C TApplicationCharacteristics::TAppEmbeddability CApplicationRegistrationData::Embeddability() const |
|
601 { |
|
602 return iCharacteristics.iEmbeddability; |
|
603 } |
|
604 |
|
605 EXPORT_C TBool CApplicationRegistrationData::NewFile() const |
|
606 { |
|
607 return iCharacteristics.iSupportsNewFile; |
|
608 } |
|
609 |
|
610 EXPORT_C TBool CApplicationRegistrationData::Launch() const |
|
611 { |
|
612 return iCharacteristics.iLaunchInBackground; |
|
613 } |
|
614 |
|
615 EXPORT_C const TDesC& CApplicationRegistrationData::GroupName() const |
|
616 { |
|
617 return iCharacteristics.iGroupName; |
|
618 } |
|
619 |
|
620 EXPORT_C TInt CApplicationRegistrationData::DefaultScreenNumber() const |
|
621 { |
|
622 return iDefaultScreenNumber; |
|
623 } |
|
624 |
|
625 EXPORT_C const RPointerArray<HBufC>& CApplicationRegistrationData::OwnedFileArray() const |
|
626 { |
|
627 return iOwnedFileArray; |
|
628 } |
|
629 |
|
630 EXPORT_C const RPointerArray<CServiceInfo>& CApplicationRegistrationData::ServiceArray() const |
|
631 { |
|
632 return iServiceArray; |
|
633 } |
|
634 |
|
635 EXPORT_C const RPointerArray<CLocalizableAppInfo>& CApplicationRegistrationData::LocalizableAppInfoList() const |
|
636 { |
|
637 return iLocalizableAppInfoList; |
|
638 } |
|
639 |
|
640 EXPORT_C const RPointerArray<CPropertyEntry>& CApplicationRegistrationData::AppProperties() const |
|
641 { |
|
642 return iAppPropertiesArray; |
|
643 } |
|
644 |
|
645 EXPORT_C const RPointerArray<COpaqueData>& CApplicationRegistrationData::AppOpaqueData() const |
|
646 { |
|
647 return iOpaqueDataArray; |
|
648 } |
|
649 |
|
650 /////////////////////// |
|
651 // CDataType |
|
652 /////////////////////// |
|
653 |
|
654 CDataType::CDataType() |
|
655 { |
|
656 // empty |
|
657 } |
|
658 |
|
659 CDataType::~CDataType() |
|
660 { |
|
661 delete iType; |
|
662 } |
|
663 |
|
664 EXPORT_C CDataType* CDataType::NewL() |
|
665 { |
|
666 CDataType *self = CDataType::NewLC(); |
|
667 CleanupStack::Pop(self); |
|
668 return self; |
|
669 } |
|
670 |
|
671 EXPORT_C CDataType* CDataType::NewLC() |
|
672 { |
|
673 CDataType *self = new(ELeave) CDataType(); |
|
674 CleanupStack::PushL(self); |
|
675 self->ConstructL(0, KNullDesC()); |
|
676 return self; |
|
677 } |
|
678 |
|
679 EXPORT_C CDataType* CDataType::NewL(RReadStream& aStream) |
|
680 { |
|
681 CDataType *self = CDataType::NewLC(); |
|
682 self->InternalizeL(aStream); |
|
683 CleanupStack::Pop(self); |
|
684 return self; |
|
685 } |
|
686 |
|
687 EXPORT_C CDataType* CDataType::NewL(TInt aPriority, const TDesC& aType) |
|
688 { |
|
689 CDataType *self = CDataType::NewLC(aPriority, aType); |
|
690 CleanupStack::Pop(self); |
|
691 return self; |
|
692 } |
|
693 |
|
694 EXPORT_C CDataType* CDataType::NewLC(TInt aPriority, const TDesC& aType) |
|
695 { |
|
696 CDataType *self = new(ELeave) CDataType(); |
|
697 CleanupStack::PushL(self); |
|
698 self->ConstructL(aPriority, aType); |
|
699 return self; |
|
700 } |
|
701 |
|
702 void CDataType::ConstructL(TInt aPriority, const TDesC& aType) |
|
703 { |
|
704 iPriority = aPriority; |
|
705 DeleteObjectZ(iType); |
|
706 iType = aType.AllocL(); |
|
707 } |
|
708 |
|
709 EXPORT_C void CDataType::ExternalizeL(RWriteStream& aStream) const |
|
710 { |
|
711 aStream.WriteInt32L(iPriority); |
|
712 aStream << *iType; |
|
713 } |
|
714 |
|
715 EXPORT_C void CDataType::InternalizeL(RReadStream& aStream) |
|
716 { |
|
717 iPriority = aStream.ReadInt32L(); |
|
718 DeleteObjectZ(iType); |
|
719 iType = HBufC::NewL(aStream, KMaxTInt); |
|
720 } |
|
721 |
|
722 EXPORT_C TInt CDataType::Priority() const |
|
723 { |
|
724 return iPriority; |
|
725 } |
|
726 |
|
727 EXPORT_C const TDesC& CDataType::Type() const |
|
728 { |
|
729 return *iType; |
|
730 } |
|
731 |
|
732 /////////////////////// |
|
733 // CServiceInfo |
|
734 /////////////////////// |
|
735 |
|
736 CServiceInfo::CServiceInfo() |
|
737 { |
|
738 // empty |
|
739 } |
|
740 |
|
741 CServiceInfo::~CServiceInfo() |
|
742 { |
|
743 iDataTypes.ResetAndDestroy(); |
|
744 iOpaqueDataArray.ResetAndDestroy(); |
|
745 } |
|
746 |
|
747 EXPORT_C CServiceInfo* CServiceInfo::NewL() |
|
748 { |
|
749 CServiceInfo *self = CServiceInfo::NewLC(); |
|
750 CleanupStack::Pop(self); |
|
751 return self; |
|
752 } |
|
753 |
|
754 EXPORT_C CServiceInfo* CServiceInfo::NewLC() |
|
755 { |
|
756 CServiceInfo *self = new(ELeave) CServiceInfo(); |
|
757 CleanupStack::PushL(self); |
|
758 return self; |
|
759 } |
|
760 |
|
761 EXPORT_C CServiceInfo* CServiceInfo::NewL(RReadStream& aStream) |
|
762 { |
|
763 CServiceInfo *self = CServiceInfo::NewLC(); |
|
764 self->InternalizeL(aStream); |
|
765 CleanupStack::Pop(self); |
|
766 return self; |
|
767 } |
|
768 |
|
769 EXPORT_C CServiceInfo* CServiceInfo::NewL(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
770 { |
|
771 CServiceInfo *self = CServiceInfo::NewLC(aUid, aOpaqueDataArray, aDataTypes); |
|
772 CleanupStack::Pop(self); |
|
773 return self; |
|
774 } |
|
775 |
|
776 EXPORT_C CServiceInfo* CServiceInfo::NewLC(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
777 { |
|
778 CServiceInfo *self = new(ELeave) CServiceInfo(); |
|
779 CleanupStack::PushL(self); |
|
780 self->ConstructL(aUid, aOpaqueDataArray, aDataTypes); |
|
781 return self; |
|
782 } |
|
783 |
|
784 void CServiceInfo::ConstructL(const TUid aUid, RPointerArray<COpaqueData>& aOpaqueDataArray, RPointerArray<CDataType>& aDataTypes) |
|
785 { |
|
786 iUid = aUid; |
|
787 iOpaqueDataArray = aOpaqueDataArray; |
|
788 iDataTypes = aDataTypes; |
|
789 } |
|
790 |
|
791 EXPORT_C void CServiceInfo::ExternalizeL(RWriteStream& aStream) const |
|
792 { |
|
793 aStream << iUid; |
|
794 ExternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
795 ExternalizePointersArrayL(iDataTypes, aStream); |
|
796 } |
|
797 |
|
798 EXPORT_C void CServiceInfo::InternalizeL(RReadStream& aStream) |
|
799 { |
|
800 aStream >> iUid; |
|
801 iOpaqueDataArray.Reset(); |
|
802 InternalizePointersArrayL(iOpaqueDataArray, aStream); |
|
803 InternalizePointersArrayL(iDataTypes, aStream); |
|
804 } |
|
805 |
|
806 EXPORT_C const TUid CServiceInfo::Uid() const |
|
807 { |
|
808 return iUid; |
|
809 } |
|
810 |
|
811 EXPORT_C const RPointerArray<CDataType>& CServiceInfo::DataTypes() const |
|
812 { |
|
813 return iDataTypes; |
|
814 } |
|
815 |
|
816 EXPORT_C const RPointerArray<COpaqueData>& CServiceInfo::OpaqueData() const |
|
817 { |
|
818 return iOpaqueDataArray; |
|
819 } |
|
820 |
|
821 /////////////////////// |
|
822 // CLocalizableAppInfo |
|
823 /////////////////////// |
|
824 |
|
825 CLocalizableAppInfo::CLocalizableAppInfo() |
|
826 { |
|
827 // empty |
|
828 } |
|
829 |
|
830 CLocalizableAppInfo::~CLocalizableAppInfo() |
|
831 { |
|
832 delete iShortCaption; |
|
833 delete iGroupName; |
|
834 delete iCaptionAndIconInfo; |
|
835 iViewDataList.ResetAndDestroy(); |
|
836 } |
|
837 |
|
838 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL() |
|
839 { |
|
840 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(); |
|
841 CleanupStack::Pop(self); |
|
842 return self; |
|
843 } |
|
844 |
|
845 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewLC() |
|
846 { |
|
847 CLocalizableAppInfo *self = new(ELeave) CLocalizableAppInfo(); |
|
848 CleanupStack::PushL(self); |
|
849 self->ConstructL(KNullDesC(), KNullDesC()); |
|
850 return self; |
|
851 } |
|
852 |
|
853 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL(RReadStream& aStream) |
|
854 { |
|
855 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(); |
|
856 self->InternalizeL(aStream); |
|
857 CleanupStack::Pop(self); |
|
858 return self; |
|
859 } |
|
860 |
|
861 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewL(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<CAppViewData>& aViewDataList) |
|
862 { |
|
863 CLocalizableAppInfo *self = CLocalizableAppInfo::NewLC(aShortCaption, aApplicationLanguage, aGroupName, aCaptionAndIconInfo, aViewDataList); |
|
864 CleanupStack::Pop(self); |
|
865 return self; |
|
866 } |
|
867 |
|
868 EXPORT_C CLocalizableAppInfo* CLocalizableAppInfo::NewLC(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<CAppViewData>& aViewDataList) |
|
869 { |
|
870 CLocalizableAppInfo *self = new(ELeave) CLocalizableAppInfo(); |
|
871 CleanupStack::PushL(self); |
|
872 self->ConstructL(aShortCaption, aApplicationLanguage, aGroupName, aCaptionAndIconInfo, aViewDataList); |
|
873 return self; |
|
874 } |
|
875 |
|
876 void CLocalizableAppInfo::ConstructL(const TDesC& aShortCaption, TLanguage aApplicationLanguage, const TDesC& aGroupName, CCaptionAndIconInfo* aCaptionAndIconInfo, RPointerArray<Usif::CAppViewData> aViewDataList) |
|
877 { |
|
878 DeleteObjectZ(iShortCaption); |
|
879 iShortCaption = aShortCaption.AllocL(); |
|
880 iApplicationLanguage = aApplicationLanguage; |
|
881 DeleteObjectZ(iGroupName); |
|
882 iGroupName = aGroupName.AllocL(); |
|
883 iCaptionAndIconInfo = aCaptionAndIconInfo; |
|
884 iViewDataList = aViewDataList; |
|
885 } |
|
886 |
|
887 void CLocalizableAppInfo::ConstructL(const TDesC& aShortCaption, const TDesC& aGroupName) |
|
888 { |
|
889 DeleteObjectZ(iShortCaption); |
|
890 iShortCaption = aShortCaption.AllocL(); |
|
891 DeleteObjectZ(iGroupName); |
|
892 iGroupName = aGroupName.AllocL(); |
|
893 } |
|
894 |
|
895 |
|
896 EXPORT_C void CLocalizableAppInfo::ExternalizeL(RWriteStream& aStream) const |
|
897 { |
|
898 aStream << *iShortCaption; |
|
899 aStream << TCardinality(iApplicationLanguage); |
|
900 aStream << *iGroupName; |
|
901 if(NULL != iCaptionAndIconInfo) |
|
902 { |
|
903 aStream.WriteInt8L(ETrue); |
|
904 aStream << *iCaptionAndIconInfo; |
|
905 } |
|
906 else |
|
907 { |
|
908 aStream.WriteInt8L(EFalse); |
|
909 } |
|
910 ExternalizePointersArrayL(iViewDataList, aStream); |
|
911 } |
|
912 |
|
913 EXPORT_C void CLocalizableAppInfo::InternalizeL(RReadStream& aStream) |
|
914 { |
|
915 DeleteObjectZ(iShortCaption); |
|
916 iShortCaption = HBufC::NewL(aStream, KMaxTInt); |
|
917 TCardinality c; |
|
918 aStream >> c; |
|
919 iApplicationLanguage = static_cast<TLanguage>(static_cast<TInt>(c)); |
|
920 DeleteObjectZ(iGroupName); |
|
921 iGroupName = HBufC::NewL(aStream, KMaxTInt); |
|
922 DeleteObjectZ(iCaptionAndIconInfo); |
|
923 TBool isCaptionAndIconInfo= aStream.ReadInt8L(); |
|
924 if(isCaptionAndIconInfo) |
|
925 { |
|
926 iCaptionAndIconInfo = CCaptionAndIconInfo::NewL(aStream); |
|
927 } |
|
928 InternalizePointersArrayL(iViewDataList, aStream); |
|
929 } |
|
930 |
|
931 EXPORT_C const TDesC& CLocalizableAppInfo::ShortCaption() const |
|
932 { |
|
933 return *iShortCaption; |
|
934 } |
|
935 |
|
936 EXPORT_C TLanguage CLocalizableAppInfo::ApplicationLanguage() const |
|
937 { |
|
938 return iApplicationLanguage; |
|
939 } |
|
940 |
|
941 EXPORT_C const TDesC& CLocalizableAppInfo::GroupName() const |
|
942 { |
|
943 return *iGroupName; |
|
944 } |
|
945 |
|
946 EXPORT_C const RPointerArray<CAppViewData>& CLocalizableAppInfo::ViewDataList() const |
|
947 { |
|
948 return iViewDataList; |
|
949 } |
|
950 |
|
951 EXPORT_C const CCaptionAndIconInfo* CLocalizableAppInfo::CaptionAndIconInfo() const |
|
952 { |
|
953 return iCaptionAndIconInfo; |
|
954 } |
|
955 |
|
956 /////////////////////// |
|
957 // CCaptionAndIconInfo |
|
958 /////////////////////// |
|
959 |
|
960 CCaptionAndIconInfo::CCaptionAndIconInfo() |
|
961 { |
|
962 // empty |
|
963 } |
|
964 |
|
965 CCaptionAndIconInfo::~CCaptionAndIconInfo() |
|
966 { |
|
967 delete iCaption; |
|
968 delete iIconFileName; |
|
969 } |
|
970 |
|
971 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL() |
|
972 { |
|
973 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(); |
|
974 CleanupStack::Pop(self); |
|
975 return self; |
|
976 } |
|
977 |
|
978 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewLC() |
|
979 { |
|
980 CCaptionAndIconInfo *self = new(ELeave) CCaptionAndIconInfo(); |
|
981 CleanupStack::PushL(self); |
|
982 self->ConstructL(KNullDesC(), KNullDesC(), 0); |
|
983 return self; |
|
984 } |
|
985 |
|
986 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL(RReadStream& aStream) |
|
987 { |
|
988 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(); |
|
989 self->InternalizeL(aStream); |
|
990 CleanupStack::Pop(self); |
|
991 return self; |
|
992 } |
|
993 |
|
994 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewL(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
995 { |
|
996 CCaptionAndIconInfo *self = CCaptionAndIconInfo::NewLC(aCaption, aIconFileName, aNumOfAppIcons); |
|
997 CleanupStack::Pop(self); |
|
998 return self; |
|
999 } |
|
1000 |
|
1001 EXPORT_C CCaptionAndIconInfo* CCaptionAndIconInfo::NewLC(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
1002 { |
|
1003 CCaptionAndIconInfo *self = new(ELeave) CCaptionAndIconInfo(); |
|
1004 CleanupStack::PushL(self); |
|
1005 self->ConstructL(aCaption, aIconFileName, aNumOfAppIcons); |
|
1006 return self; |
|
1007 } |
|
1008 |
|
1009 void CCaptionAndIconInfo::ConstructL(const TDesC& aCaption, const TDesC& aIconFileName, TInt aNumOfAppIcons) |
|
1010 { |
|
1011 DeleteObjectZ(iCaption); |
|
1012 iCaption = aCaption.AllocL(); |
|
1013 DeleteObjectZ(iIconFileName); |
|
1014 iIconFileName = aIconFileName.AllocL(); |
|
1015 iNumOfAppIcons = aNumOfAppIcons; |
|
1016 } |
|
1017 |
|
1018 EXPORT_C void CCaptionAndIconInfo::ExternalizeL(RWriteStream& aStream) const |
|
1019 { |
|
1020 aStream << *iCaption; |
|
1021 aStream << *iIconFileName; |
|
1022 aStream.WriteInt32L(iNumOfAppIcons); |
|
1023 } |
|
1024 |
|
1025 EXPORT_C void CCaptionAndIconInfo::InternalizeL(RReadStream& aStream) |
|
1026 { |
|
1027 DeleteObjectZ(iCaption); |
|
1028 iCaption = HBufC::NewL(aStream, KMaxTInt); |
|
1029 DeleteObjectZ(iIconFileName); |
|
1030 iIconFileName = HBufC::NewL(aStream, KMaxTInt); |
|
1031 iNumOfAppIcons = aStream.ReadInt32L(); |
|
1032 } |
|
1033 |
|
1034 EXPORT_C const TDesC& CCaptionAndIconInfo::Caption() const |
|
1035 { |
|
1036 return *iCaption; |
|
1037 } |
|
1038 |
|
1039 EXPORT_C const TDesC& CCaptionAndIconInfo::IconFileName() const |
|
1040 { |
|
1041 return *iIconFileName; |
|
1042 } |
|
1043 |
|
1044 EXPORT_C TInt CCaptionAndIconInfo::NumOfAppIcons() const |
|
1045 { |
|
1046 return iNumOfAppIcons; |
|
1047 } |
|
1048 |
|
1049 /////////////////////// |
|
1050 // CAppViewData |
|
1051 /////////////////////// |
|
1052 |
|
1053 CAppViewData::CAppViewData() |
|
1054 { |
|
1055 // empty |
|
1056 } |
|
1057 |
|
1058 CAppViewData::~CAppViewData() |
|
1059 { |
|
1060 delete iCaptionAndIconInfo; |
|
1061 } |
|
1062 |
|
1063 EXPORT_C CAppViewData* CAppViewData::NewL() |
|
1064 { |
|
1065 CAppViewData *self = CAppViewData::NewLC(); |
|
1066 CleanupStack::Pop(self); |
|
1067 return self; |
|
1068 } |
|
1069 |
|
1070 EXPORT_C CAppViewData* CAppViewData::NewLC() |
|
1071 { |
|
1072 CAppViewData *self = new(ELeave) CAppViewData(); |
|
1073 CleanupStack::PushL(self); |
|
1074 return self; |
|
1075 } |
|
1076 |
|
1077 EXPORT_C CAppViewData* CAppViewData::NewL(RReadStream& aStream) |
|
1078 { |
|
1079 CAppViewData *self = CAppViewData::NewLC(); |
|
1080 self->InternalizeL(aStream); |
|
1081 CleanupStack::Pop(self); |
|
1082 return self; |
|
1083 } |
|
1084 |
|
1085 EXPORT_C CAppViewData* CAppViewData::NewL(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1086 { |
|
1087 CAppViewData *self = CAppViewData::NewLC(aUid, aScreenMode, aCaptionAndIconInfo); |
|
1088 CleanupStack::Pop(self); |
|
1089 return self; |
|
1090 } |
|
1091 |
|
1092 EXPORT_C CAppViewData* CAppViewData::NewLC(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1093 { |
|
1094 CAppViewData *self = new(ELeave) CAppViewData(); |
|
1095 CleanupStack::PushL(self); |
|
1096 self->ConstructL(aUid, aScreenMode, aCaptionAndIconInfo); |
|
1097 return self; |
|
1098 } |
|
1099 |
|
1100 void CAppViewData::ConstructL(TUid aUid, TInt aScreenMode, CCaptionAndIconInfo* aCaptionAndIconInfo) |
|
1101 { |
|
1102 iUid = aUid; |
|
1103 iScreenMode = aScreenMode; |
|
1104 iCaptionAndIconInfo = aCaptionAndIconInfo; |
|
1105 } |
|
1106 |
|
1107 EXPORT_C void CAppViewData::ExternalizeL(RWriteStream& aStream) const |
|
1108 { |
|
1109 aStream << iUid; |
|
1110 aStream.WriteInt32L(iScreenMode); |
|
1111 if(NULL != iCaptionAndIconInfo) |
|
1112 { |
|
1113 aStream.WriteInt8L(ETrue); |
|
1114 aStream << *iCaptionAndIconInfo; |
|
1115 } |
|
1116 else |
|
1117 { |
|
1118 aStream.WriteInt8L(EFalse); |
|
1119 } |
|
1120 } |
|
1121 |
|
1122 EXPORT_C void CAppViewData::InternalizeL(RReadStream& aStream) |
|
1123 { |
|
1124 aStream >> iUid; |
|
1125 iScreenMode = aStream.ReadInt32L(); |
|
1126 DeleteObjectZ(iCaptionAndIconInfo); |
|
1127 TBool isCaptionAndIconInfo= aStream.ReadInt8L(); |
|
1128 if(isCaptionAndIconInfo) |
|
1129 { |
|
1130 iCaptionAndIconInfo = CCaptionAndIconInfo::NewL(aStream); |
|
1131 } |
|
1132 } |
|
1133 |
|
1134 EXPORT_C const TUid CAppViewData::Uid() const |
|
1135 { |
|
1136 return iUid; |
|
1137 } |
|
1138 |
|
1139 EXPORT_C TInt CAppViewData::ScreenMode() const |
|
1140 { |
|
1141 return iScreenMode; |
|
1142 } |
|
1143 |
|
1144 EXPORT_C const CCaptionAndIconInfo* CAppViewData::CaptionAndIconInfo() const |
|
1145 { |
|
1146 return iCaptionAndIconInfo; |
|
1147 } |
|
1148 |
|
1149 |
|
1150 /////////////////////// |
|
1151 // CLauncherExecutable |
|
1152 /////////////////////// |
|
1153 |
|
1154 CLauncherExecutable::CLauncherExecutable() |
|
1155 { |
|
1156 } |
|
1157 |
|
1158 CLauncherExecutable::~CLauncherExecutable() |
|
1159 { |
|
1160 delete iLauncher; |
|
1161 } |
|
1162 |
|
1163 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL() |
|
1164 { |
|
1165 CLauncherExecutable *self = CLauncherExecutable::NewLC(); |
|
1166 CleanupStack::Pop(self); |
|
1167 return self; |
|
1168 } |
|
1169 |
|
1170 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewLC() |
|
1171 { |
|
1172 CLauncherExecutable *self = new(ELeave) CLauncherExecutable(); |
|
1173 CleanupStack::PushL(self); |
|
1174 self->ConstructL(0, KNullDesC()); |
|
1175 return self; |
|
1176 } |
|
1177 |
|
1178 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL(TInt aTypeId, const TDesC& aLauncher) |
|
1179 { |
|
1180 CLauncherExecutable *self = CLauncherExecutable::NewLC(aTypeId, aLauncher); |
|
1181 CleanupStack::Pop(self); |
|
1182 return self; |
|
1183 } |
|
1184 |
|
1185 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewLC(TInt aTypeId, const TDesC& aLauncher) |
|
1186 { |
|
1187 CLauncherExecutable *self = new(ELeave) CLauncherExecutable(); |
|
1188 CleanupStack::PushL(self); |
|
1189 self->ConstructL(aTypeId, aLauncher); |
|
1190 return self; |
|
1191 } |
|
1192 |
|
1193 EXPORT_C CLauncherExecutable* CLauncherExecutable::NewL(RReadStream& aStream) |
|
1194 { |
|
1195 CLauncherExecutable *self = CLauncherExecutable::NewLC(); |
|
1196 self->InternalizeL(aStream); |
|
1197 CleanupStack::Pop(self); |
|
1198 return self; |
|
1199 } |
|
1200 |
|
1201 void CLauncherExecutable::ConstructL(TInt aTypeId, const TDesC& aLauncher) |
|
1202 { |
|
1203 iTypeId = aTypeId; |
|
1204 DeleteObjectZ(iLauncher); |
|
1205 iLauncher = aLauncher.AllocL(); |
|
1206 } |
|
1207 |
|
1208 EXPORT_C const TDesC& CLauncherExecutable::Launcher() const |
|
1209 { |
|
1210 return *iLauncher; |
|
1211 } |
|
1212 |
|
1213 EXPORT_C TInt CLauncherExecutable::TypeId() const |
|
1214 { |
|
1215 return iTypeId; |
|
1216 } |
|
1217 |
|
1218 EXPORT_C void CLauncherExecutable::ExternalizeL(RWriteStream& aStream) const |
|
1219 { |
|
1220 aStream.WriteInt32L(iTypeId); |
|
1221 aStream << *iLauncher; |
|
1222 } |
|
1223 |
|
1224 EXPORT_C void CLauncherExecutable::InternalizeL(RReadStream& aStream) |
|
1225 { |
|
1226 iTypeId = aStream.ReadInt32L(); |
|
1227 |
|
1228 DeleteObjectZ(iLauncher); |
|
1229 iLauncher = HBufC::NewL(aStream, KMaxTInt); |
|
1230 } |
|
1231 |