1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // apaid.cpp |
15 |
15 // |
|
16 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
17 #if !defined(__APAID_PARTNER_H__) |
|
18 #include "apaidpartner.h" |
|
19 #endif |
|
20 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
16 #include <apaid.h> |
21 #include <apaid.h> |
17 #include <s32strm.h> |
22 #include <s32strm.h> |
18 #include "APASTD.H" |
23 #include "APASTD.H" |
19 |
24 |
20 |
25 const TInt KMaxOpaqueDataLength = 0x1000; // maximum length of opaque data that can be passed between client and apparc server via a TApaAppServiceInfo object - this can be increased in future if needed |
21 ///////////////////////////// |
26 |
|
27 // |
22 // TApaAppIdentifier |
28 // TApaAppIdentifier |
23 ///////////////////////////// |
29 // |
24 |
30 |
|
31 /** Constructs an empty application identifier. |
|
32 |
|
33 The data is not initialised. */ |
25 EXPORT_C TApaAppIdentifier::TApaAppIdentifier() |
34 EXPORT_C TApaAppIdentifier::TApaAppIdentifier() |
26 /** Constructs an empty application identifier. |
35 {} |
27 |
36 |
28 The data is not initialised. */ |
|
29 {} |
|
30 |
|
31 EXPORT_C TApaAppIdentifier::TApaAppIdentifier(TUid aAppUid,const TFileName& aDllName) |
|
32 : iAppUid(aAppUid), |
|
33 iFullName(aDllName) |
|
34 /** Constructs an application identifier from the specified application |
37 /** Constructs an application identifier from the specified application |
35 DLL file name and extension, and the specified application UID. |
38 DLL file name and extension, and the specified application UID. |
36 @param aAppUid The application specific UID. |
39 @param aAppUid The application specific UID. |
37 @param aDllName The filename and extension of the application DLL. */ |
40 @param aDllName The filename and extension of the application DLL. */ |
38 {} |
41 EXPORT_C TApaAppIdentifier::TApaAppIdentifier(TUid aAppUid,const TFileName& aDllName) |
39 |
42 : iAppUid(aAppUid), |
|
43 iFullName(aDllName) |
|
44 {} |
|
45 |
|
46 /** Externalises the application identifier to a write stream. |
|
47 |
|
48 @param aStream The write stream. */ |
40 EXPORT_C void TApaAppIdentifier::ExternalizeL(RWriteStream& aStream)const |
49 EXPORT_C void TApaAppIdentifier::ExternalizeL(RWriteStream& aStream)const |
41 /** Externalises the application identifier to a write stream. |
|
42 |
|
43 @param aStream The write stream. */ |
|
44 { |
50 { |
45 aStream<< iAppUid; |
51 aStream<< iAppUid; |
46 aStream<< iFullName; |
52 aStream<< iFullName; |
47 } |
53 } |
48 |
54 |
|
55 /** Internalises the application identifier from a read stream. |
|
56 |
|
57 @param aStream The read stream. */ |
49 EXPORT_C void TApaAppIdentifier::InternalizeL(RReadStream& aStream) |
58 EXPORT_C void TApaAppIdentifier::InternalizeL(RReadStream& aStream) |
50 /** Internalises the application identifier from a read stream. |
|
51 |
|
52 @param aStream The read stream. */ |
|
53 { |
59 { |
54 aStream>> iAppUid; |
60 aStream>> iAppUid; |
55 aStream>> iFullName; |
61 aStream>> iFullName; |
56 } |
62 } |
57 |
63 |
58 ///////////////////////////// |
64 // |
59 // TApaAppEntry |
|
60 ///////////////////////////// |
|
61 |
|
62 EXPORT_C TApaAppEntry::TApaAppEntry() |
|
63 : iUidType(TUidType()), |
|
64 iFullName(KNullDesC) |
|
65 /** Constructs an empty application entry object. |
|
66 |
|
67 The full path name is empty, and the triplet of UIDs forming the UID type |
|
68 are set to null UIDs. */ |
|
69 {} |
|
70 |
|
71 |
|
72 EXPORT_C TApaAppEntry::TApaAppEntry(const TUidType& aAppUidType,const TFileName& aDllName) |
|
73 : iUidType(aAppUidType), |
|
74 iFullName(aDllName) |
|
75 /** Constructs an application entry object from the specified application |
|
76 DLL full path name and UID type. |
|
77 @param aAppUidType UID type. |
|
78 @param aDllName Application DLL full path name. */ |
|
79 {} |
|
80 |
|
81 |
|
82 EXPORT_C void TApaAppEntry::ExternalizeL(RWriteStream& aStream)const |
|
83 /** Externalises the application entry to a write stream. |
|
84 |
|
85 @param aStream The write stream. */ |
|
86 { |
|
87 aStream<< iUidType[0]; |
|
88 aStream<< iUidType[1]; |
|
89 aStream<< iUidType[2]; |
|
90 aStream<< iFullName; |
|
91 } |
|
92 |
|
93 |
|
94 EXPORT_C void TApaAppEntry::InternalizeL(RReadStream& aStream) |
|
95 /** Internalises the application entry from a read stream. |
|
96 |
|
97 @param aStream The read stream. */ |
|
98 { |
|
99 TUid uid1; |
|
100 TUid uid2; |
|
101 TUid uid3; |
|
102 aStream>> uid1; |
|
103 aStream>> uid2; |
|
104 aStream>> uid3; |
|
105 iUidType = TUidType(uid1,uid2,uid3); |
|
106 aStream>> iFullName; |
|
107 } |
|
108 |
|
109 |
|
110 ///////////////////////////// |
|
111 // TApaAppInfo |
65 // TApaAppInfo |
112 ///////////////////////////// |
66 // |
113 |
67 |
|
68 /** Constructs an empty application information object. |
|
69 |
|
70 The full path name is empty, the captions are empty and the application specific |
|
71 UID is set to the null UID. */ |
114 EXPORT_C TApaAppInfo::TApaAppInfo() |
72 EXPORT_C TApaAppInfo::TApaAppInfo() |
115 : iUid(TUid()), |
73 : iUid(TUid()), |
116 iFullName(KNullDesC), |
74 iFullName(KNullDesC), |
117 iCaption(KNullDesC), |
75 iCaption(KNullDesC), |
118 iShortCaption(KNullDesC) |
76 iShortCaption(KNullDesC) |
119 /** Constructs an empty application information object. |
77 {} |
120 |
78 |
121 The full path name is empty, the captions are empty and the application specific |
79 /** Constructs an application information object from the specified full DLL path |
122 UID is set to the null UID. */ |
80 name, UID and full length caption. |
123 {} |
81 |
124 |
82 @param aAppUid The application specific UID. |
125 |
83 @param aDllName The full path name of the application DLL. |
|
84 @param aCaption The application caption. */ |
126 EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption) |
85 EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption) |
127 : iUid(aAppUid), |
86 : iUid(aAppUid), |
128 iFullName(aDllName), |
87 iFullName(aDllName), |
129 iCaption(aCaption), |
88 iCaption(aCaption), |
130 iShortCaption(aCaption) |
89 iShortCaption(aCaption) |
|
90 {} |
|
91 |
131 /** Constructs an application information object from the specified full DLL path |
92 /** Constructs an application information object from the specified full DLL path |
132 name, UID and full length caption. |
93 name, UID, caption and short caption. |
133 |
94 |
134 @param aAppUid The application specific UID. |
95 @param aAppUid The application specific UID. |
135 @param aDllName The full path name of the application DLL. |
96 @param aDllName The full path name of the application DLL. |
136 @param aCaption The application caption. */ |
97 @param aCaption The application caption. |
137 {} |
98 @param aShortCaption The application short caption. */ |
138 |
|
139 EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption) |
99 EXPORT_C TApaAppInfo::TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption) |
140 : iUid(aAppUid), |
100 : iUid(aAppUid), |
141 iFullName(aDllName), |
101 iFullName(aDllName), |
142 iCaption(aCaption), |
102 iCaption(aCaption), |
143 iShortCaption(aShortCaption) |
103 iShortCaption(aShortCaption) |
144 /** Constructs an application information object from the specified full DLL path |
104 {} |
145 name, UID, caption and short caption. |
105 |
146 |
106 /** Externalises the application information to a write stream. |
147 @param aAppUid The application specific UID. |
107 |
148 @param aDllName The full path name of the application DLL. |
108 @param aStream The write stream. */ |
149 @param aCaption The application caption. |
|
150 @param aShortCaption The application short caption. */ |
|
151 {} |
|
152 |
|
153 EXPORT_C void TApaAppInfo::ExternalizeL(RWriteStream& aStream)const |
109 EXPORT_C void TApaAppInfo::ExternalizeL(RWriteStream& aStream)const |
154 /** Externalises the application information to a write stream. |
|
155 |
|
156 @param aStream The write stream. */ |
|
157 { |
110 { |
158 aStream<< iUid; |
111 aStream<< iUid; |
159 aStream<< iFullName; |
112 aStream<< iFullName; |
160 aStream<< iCaption; |
113 aStream<< iCaption; |
161 aStream<< iShortCaption; |
114 aStream<< iShortCaption; |
162 } |
115 } |
163 |
116 |
|
117 /** Internalises the application information from a read stream. |
|
118 |
|
119 @param aStream The read stream. */ |
164 EXPORT_C void TApaAppInfo::InternalizeL(RReadStream& aStream) |
120 EXPORT_C void TApaAppInfo::InternalizeL(RReadStream& aStream) |
165 /** Internalises the application information from a read stream. |
|
166 |
|
167 @param aStream The read stream. */ |
|
168 { |
121 { |
169 aStream>> iUid; |
122 aStream>> iUid; |
170 aStream>> iFullName; |
123 aStream>> iFullName; |
171 aStream>> iCaption; |
124 aStream>> iCaption; |
172 aStream>> iShortCaption; |
125 aStream>> iShortCaption; |
173 } |
126 } |
174 |
127 |
175 |
128 |
176 ///////////////////////////// |
129 // |
177 // TApaAppViewInfo |
130 // TApaAppViewInfo |
178 ///////////////////////////// |
131 // |
179 |
132 |
|
133 /** Constructs an empty object. |
|
134 |
|
135 Specifically, it sets the view UID to KNullUid and empties the application |
|
136 caption, i.e. sets it to KNullDesC. */ |
180 EXPORT_C TApaAppViewInfo::TApaAppViewInfo() |
137 EXPORT_C TApaAppViewInfo::TApaAppViewInfo() |
181 : iUid(KNullUid), |
138 : iUid(KNullUid), |
182 iViewCaption(KNullDesC) |
139 iViewCaption(KNullDesC) |
183 /** Constructs an empty object. |
|
184 |
|
185 Specifically, it sets the view UID to KNullUid and empties the application |
|
186 caption, i.e. sets it to KNullDesC. */ |
|
187 {} |
140 {} |
188 |
141 |
189 |
142 |
190 EXPORT_C TApaAppViewInfo::TApaAppViewInfo(TUid aAppUid,const TApaAppCaption& aViewCaption, TInt aScreenMode) |
143 EXPORT_C TApaAppViewInfo::TApaAppViewInfo(TUid aAppUid,const TApaAppCaption& aViewCaption, TInt aScreenMode) |
191 : iUid(aAppUid), |
144 : iUid(aAppUid), |
192 iViewCaption(aViewCaption), |
145 iViewCaption(aViewCaption), |
193 iScreenMode(aScreenMode) |
146 iScreenMode(aScreenMode) |
194 {} |
147 {} |
195 |
148 |
196 |
149 |
|
150 /** Externalises the application view information to a write stream. |
|
151 |
|
152 @param aStream The write stream. */ |
197 EXPORT_C void TApaAppViewInfo::ExternalizeL(RWriteStream& aStream)const |
153 EXPORT_C void TApaAppViewInfo::ExternalizeL(RWriteStream& aStream)const |
198 /** Externalises the application view information to a write stream. |
|
199 |
|
200 @param aStream The write stream. */ |
|
201 { |
154 { |
202 aStream<< iUid; |
155 aStream<< iUid; |
203 aStream<< iViewCaption; |
156 aStream<< iViewCaption; |
204 aStream.WriteInt32L(iScreenMode); |
157 aStream.WriteInt32L(iScreenMode); |
205 } |
158 } |
206 |
159 |
207 |
160 |
|
161 /** Internalises the application view information from a read stream. |
|
162 |
|
163 @param aStream The read stream. */ |
208 EXPORT_C void TApaAppViewInfo::InternalizeL(RReadStream& aStream) |
164 EXPORT_C void TApaAppViewInfo::InternalizeL(RReadStream& aStream) |
209 /** Internalises the application view information from a read stream. |
|
210 |
|
211 @param aStream The read stream. */ |
|
212 { |
165 { |
213 aStream>> iUid; |
166 aStream>> iUid; |
214 aStream>> iViewCaption; |
167 aStream>> iViewCaption; |
215 iScreenMode=aStream.ReadInt32L(); |
168 iScreenMode=aStream.ReadInt32L(); |
216 } |
169 } |
217 |
170 |
218 |
171 |
219 /////////////////////////////////////// |
172 // |
220 // class TApaAppCapability |
173 // class TApaAppCapability |
221 /////////////////////////////////////// |
174 // |
222 |
175 |
223 EXPORT_C void TApaAppCapability::InternalizeL(RReadStream& aStream) |
176 EXPORT_C void TApaAppCapability::InternalizeL(RReadStream& aStream) |
224 { |
177 { |
225 DoInternalizeL(aStream, iLaunchInBackground, iGroupName); |
178 DoInternalizeL(aStream, iLaunchInBackground, iGroupName); |
226 } |
179 } |
227 |
180 |
228 EXPORT_C void TApaAppCapability::Internalize7_0L(RReadStream& aStream) |
181 /** Internalises the application capabilities from a read stream. |
229 /** |
182 |
230 @deprecated |
183 @param aStream The read stream. |
231 */ |
184 */ |
232 { |
|
233 TBool dummyBool; |
|
234 TApaAppGroupName dummyGroupName; |
|
235 DoInternalizeL(aStream,dummyBool,dummyGroupName); |
|
236 } |
|
237 |
|
238 void TApaAppCapability::DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName) |
185 void TApaAppCapability::DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName) |
239 /** Internalises the application capabilities from a read stream. |
|
240 |
|
241 @param aStream The read stream. */ |
|
242 { |
186 { |
243 TInt version = aStream.ReadInt32L(); |
187 TInt version = aStream.ReadInt32L(); |
244 iEmbeddability = TEmbeddability(aStream.ReadInt32L()); |
188 iEmbeddability = TEmbeddability(aStream.ReadInt32L()); |
245 iSupportsNewFile = aStream.ReadInt32L(); |
189 iSupportsNewFile = aStream.ReadInt32L(); |
246 iAppIsHidden = aStream.ReadInt32L(); |
190 iAppIsHidden = aStream.ReadInt32L(); |
266 return; |
210 return; |
267 |
211 |
268 Panic(EDPanicInvalidVersionNumber); |
212 Panic(EDPanicInvalidVersionNumber); |
269 } |
213 } |
270 |
214 |
|
215 /** Externalises the application capabilities to a write stream. |
|
216 |
|
217 @param aStream The write stream. |
|
218 */ |
271 EXPORT_C void TApaAppCapability::ExternalizeL(RWriteStream& aStream) const |
219 EXPORT_C void TApaAppCapability::ExternalizeL(RWriteStream& aStream) const |
272 /** Externalises the application capabilities to a write stream. |
|
273 |
|
274 @param aStream The write stream. */ |
|
275 { |
220 { |
276 aStream.WriteInt32L(EVersion); |
221 aStream.WriteInt32L(EVersion); |
277 aStream.WriteInt32L(iEmbeddability); |
222 aStream.WriteInt32L(iEmbeddability); |
278 aStream.WriteInt32L(iSupportsNewFile); |
223 aStream.WriteInt32L(iSupportsNewFile); |
279 aStream.WriteInt32L(iAppIsHidden); |
224 aStream.WriteInt32L(iAppIsHidden); |
280 aStream.WriteInt32L(iLaunchInBackground); |
225 aStream.WriteInt32L(iLaunchInBackground); |
281 aStream << iGroupName; |
226 aStream << iGroupName; |
282 aStream.WriteUint32L(iAttributes); |
227 aStream.WriteUint32L(iAttributes); |
283 } |
228 } |
284 |
229 |
285 const TInt KOldVersion=1; |
|
286 |
|
287 EXPORT_C void TApaAppCapability::Externalize7_0L(RWriteStream& aStream) const |
|
288 /** Externalises the application capabilities to a write stream. |
|
289 |
|
290 @param aStream The write stream. |
|
291 @deprecated*/ |
|
292 { |
|
293 aStream.WriteInt32L(KOldVersion); |
|
294 aStream.WriteInt32L(iEmbeddability); |
|
295 aStream.WriteInt32L(iSupportsNewFile); |
|
296 aStream.WriteInt32L(iAppIsHidden); |
|
297 } |
|
298 |
|
299 EXPORT_C void TApaAppCapability::CopyCapability(TDes8& aDest,const TDesC8& aSource) |
|
300 /** A utility function that can copy capability information from one descriptor |
230 /** A utility function that can copy capability information from one descriptor |
301 to another. |
231 to another. |
302 |
232 |
303 @param aDest Target descriptor. |
233 @param aDest Target descriptor. |
304 @param aSource Source descriptor. */ |
234 @param aSource Source descriptor. |
|
235 */ |
|
236 EXPORT_C void TApaAppCapability::CopyCapability(TDes8& aDest,const TDesC8& aSource) |
305 { |
237 { |
306 TInt maxLen=aDest.MaxLength(); |
238 TInt maxLen=aDest.MaxLength(); |
307 aDest.FillZ(maxLen); // zero fill in case aSource is shorter |
239 aDest.FillZ(maxLen); // zero fill in case aSource is shorter |
308 aDest.Copy(aSource.Left(Min(aSource.Length(),maxLen))); |
240 aDest.Copy(aSource.Left(Min(aSource.Length(),maxLen))); |
309 aDest.SetLength(maxLen); |
241 aDest.SetLength(maxLen); |
310 } |
242 } |
311 |
243 |
312 |
244 |
313 /////////////////////////////////////// |
245 // |
314 // class TApaEmbeddabilityFilter |
246 // class TApaEmbeddabilityFilter |
315 /////////////////////////////////////// |
247 // |
|
248 |
|
249 /** Constructs an empty embeddability filter. */ |
316 EXPORT_C TApaEmbeddabilityFilter::TApaEmbeddabilityFilter() |
250 EXPORT_C TApaEmbeddabilityFilter::TApaEmbeddabilityFilter() |
317 : iEmbeddabilityFlags(0) |
251 : iEmbeddabilityFlags(0) |
318 /** Constructs an empty embeddability filter. */ |
252 { |
319 { |
253 } |
320 } |
254 |
321 |
255 /** Adds aEmbeddability to the filter. |
|
256 |
|
257 @param aEmbeddability TEmbeddability value to add to the filter. */ |
322 EXPORT_C void TApaEmbeddabilityFilter::AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) |
258 EXPORT_C void TApaEmbeddabilityFilter::AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) |
323 /** Adds aEmbeddability to the filter. |
|
324 |
|
325 @param aEmbeddability TEmbeddability value to add to the filter. */ |
|
326 { |
259 { |
327 __ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange)); |
260 __ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange)); |
328 iEmbeddabilityFlags |= (1 << aEmbeddability); |
261 iEmbeddabilityFlags |= (1 << aEmbeddability); |
329 } |
262 } |
330 |
263 |
331 EXPORT_C TBool TApaEmbeddabilityFilter::MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const |
|
332 /** Compares aEmbeddability with the filter. |
264 /** Compares aEmbeddability with the filter. |
333 |
265 |
334 @param aEmbeddability TEmbeddability value to compare. |
266 @param aEmbeddability TEmbeddability value to compare. |
335 @return True, if aEmbeddability is included in the filter; false, otherwise. */ |
267 @return True, if aEmbeddability is included in the filter; false, otherwise. */ |
|
268 EXPORT_C TBool TApaEmbeddabilityFilter::MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const |
336 { |
269 { |
337 __ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange)); |
270 __ASSERT_ALWAYS(aEmbeddability >= 0 && static_cast<TUint>(aEmbeddability) < (sizeof(TUint)*8), Panic(EPanicEmbeddabilityOutOfRange)); |
338 TUint embeddabilityFlag = (1 << aEmbeddability); |
271 TUint embeddabilityFlag = (1 << aEmbeddability); |
339 if (embeddabilityFlag & iEmbeddabilityFlags) |
272 return (embeddabilityFlag & iEmbeddabilityFlags); |
|
273 } |
|
274 |
|
275 |
|
276 // |
|
277 // class TApaAppServiceInfo |
|
278 // |
|
279 |
|
280 EXPORT_C TApaAppServiceInfo::TApaAppServiceInfo() |
|
281 : iUid(KNullUid), |
|
282 iDataTypes(0), |
|
283 iOpaqueData(NULL) |
|
284 { |
|
285 } |
|
286 |
|
287 EXPORT_C TApaAppServiceInfo::TApaAppServiceInfo(TUid aUid, |
|
288 CArrayFixFlat<TDataTypeWithPriority>* aDataTypes, HBufC8* aOpaqueData) |
|
289 : iUid(aUid), |
|
290 iDataTypes(aDataTypes), |
|
291 iOpaqueData(aOpaqueData) |
|
292 { |
|
293 __ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer)); |
|
294 __ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer)); |
|
295 } |
|
296 |
|
297 EXPORT_C void TApaAppServiceInfo::ExternalizeL(RWriteStream& aStream) const |
|
298 { |
|
299 __ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer)); |
|
300 __ASSERT_DEBUG(iOpaqueData, Panic(EPanicNullPointer)); |
|
301 aStream << iUid; |
|
302 aStream << *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above |
|
303 aStream << *iOpaqueData;//lint !e613 Possible use of null pointer - Asserted above |
|
304 } |
|
305 |
|
306 EXPORT_C void TApaAppServiceInfo::InternalizeL(RReadStream& aStream) |
|
307 { |
|
308 aStream >> iUid; |
|
309 iDataTypes = new(ELeave) CArrayFixFlat<TDataTypeWithPriority>(1); |
|
310 aStream >> *iDataTypes; |
|
311 iOpaqueData = HBufC8::NewL(aStream, KMaxOpaqueDataLength); |
|
312 } |
|
313 |
|
314 EXPORT_C void TApaAppServiceInfo::Release() |
|
315 { |
|
316 if (iDataTypes) |
340 { |
317 { |
341 return ETrue; |
318 iDataTypes->Reset(); |
|
319 delete iDataTypes; |
342 } |
320 } |
343 return EFalse; |
321 if (iOpaqueData) |
344 } |
322 { |
345 |
323 delete iOpaqueData; |
346 // |
324 iOpaqueData = NULL; |
347 // CApaAppFinder |
325 } |
348 // |
326 } |
349 |
327 |
350 /** Constructor for CApaAppFinder */ |
328 EXPORT_C CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes() |
351 EXPORT_C CApaAppFinder::CApaAppFinder() |
329 { |
352 { |
330 __ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer)); |
353 } |
331 return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above |
354 |
332 } |
355 /* Reserved for future use */ |
333 |
356 EXPORT_C void CApaAppFinder::CApaAppFinder_Reserved1() |
334 /** Returns the service UID. |
357 { |
335 |
358 } |
336 Note that some APIs may store a UID other than a service UID |
359 |
337 in a TApaAppServiceInfo object. Such APIs clearly state what |
360 /* Reserved for future use */ |
338 the UID represents. |
361 EXPORT_C void CApaAppFinder::CApaAppFinder_Reserved2() |
339 |
362 { |
340 @return the service UID. |
363 } |
341 */ |
364 |
342 EXPORT_C TUid TApaAppServiceInfo::Uid() const |
365 // |
343 { |
366 // CApaAppServiceInfoArray |
344 return iUid; |
|
345 } |
|
346 |
|
347 EXPORT_C const CArrayFixFlat<TDataTypeWithPriority>& TApaAppServiceInfo::DataTypes() const |
|
348 { |
|
349 __ASSERT_DEBUG(iDataTypes, Panic(EPanicNullPointer)); |
|
350 return *iDataTypes; //lint !e613 Possible use of null pointer - Asserted above |
|
351 } |
|
352 |
|
353 /** Returns the service implementation's opaque data. |
|
354 |
|
355 For each service UID registered by an application, the associated |
|
356 opaque data indicates how the service is implemented by that application. |
|
357 |
|
358 The meaning of the opaque data is not known to the framework, it will vary |
|
359 according to the service. |
|
360 |
|
361 For some services the opaque data may be a name intended for user display, |
|
362 for others it may be structured data that the service's client-side code can interpret. |
|
363 |
|
364 @return the service implementation's opaque data. |
|
365 */ |
|
366 EXPORT_C const TDesC8& TApaAppServiceInfo::OpaqueData() const |
|
367 { |
|
368 if (iOpaqueData) |
|
369 return *iOpaqueData; |
|
370 |
|
371 return KNullDesC8; |
|
372 } |
|
373 |
|
374 |
|
375 // |
|
376 // class CApaAppServiceInfoArray |
367 // |
377 // |
368 |
378 |
369 EXPORT_C CApaAppServiceInfoArray::CApaAppServiceInfoArray() |
379 EXPORT_C CApaAppServiceInfoArray::CApaAppServiceInfoArray() |
370 { |
380 { |
371 } |
381 } |