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 // apgcli.cpp |
14 // |
15 // |
15 |
16 |
16 #include "../apserv/APSCLSV.H" |
17 #include "../apserv/APSCLSV.H" |
|
18 #include "../apserv/apsserv.h" |
|
19 |
|
20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
21 #if !defined(__APA_INTERNAL_H__) |
|
22 #include "apainternal.h" |
|
23 #endif |
|
24 #if !defined(__APGICNFL_PARTNER_H__) |
|
25 #include "apgicnflpartner.h" |
|
26 #endif |
|
27 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
17 #include "APGCLI.H" |
28 #include "APGCLI.H" |
18 #include "APACMDLN.H" |
|
19 #include "APGSTD.H" |
29 #include "APGSTD.H" |
20 #include "APGICNFL.H" |
30 #include "APGICNFL.H" |
21 #include <apsserv.h> |
|
22 #include <apmrec.h> |
|
23 #include <s32mem.h> |
|
24 #include "APGPRIV.H" |
31 #include "APGPRIV.H" |
25 #include <apadef.h> |
|
26 #include "apprivate.h" |
32 #include "apprivate.h" |
27 |
33 |
28 #if defined(USE_IH_RAISE_EVENT) |
34 const TUint KInitialIconBufSize = sizeof(TSize)*6 + sizeof(TInt); |
29 #include <SystemMonitor/RaiseEvent.h> |
35 const TUint KInitialViewDataBufSize = sizeof(TApaAppViewInfo)*6 + sizeof(TInt); |
30 #include <test/testinstrumentation.h> |
36 const TUint KInitialOwnedFilesBufSize = sizeof(TFileName)*6 + sizeof(TInt); |
31 #endif |
|
32 |
|
33 class CApaLsSessionExtension; |
|
34 |
|
35 const TUint KInitialIconBufSize=sizeof(TSize)*6+sizeof(TInt); |
|
36 const TUint KInitialViewDataBufSize=sizeof(TApaAppViewInfo)*6+sizeof(TInt); |
|
37 const TUint KInitialOwnedFilesBufSize=sizeof(TFileName)*6+sizeof(TInt); |
|
38 const TUint KDefaultBufSize = 0x400; |
37 const TUint KDefaultBufSize = 0x400; |
39 const TUint KAsyncMessageSlots=4; //one slot each for, RApaLsSession::SetNotify, RApaLsSession:: |
38 const TUint KAsyncMessageSlots = 4; // One slot each for, RApaLsSession::SetNotify, RApaLsSession:: |
40 //RegisterListPopulationCompleteObserver and RApaLsSession::NotifyOnDataMappingChange |
39 // RegisterListPopulationCompleteObserver and RApaLsSession::NotifyOnDataMappingChange |
41 //CAsyncFileRecognition::Start makes an asynch request of apparc server. |
40 // CAsyncFileRecognition::Start makes an asynch request of apparc server. |
42 |
41 |
43 _LIT8(KAllDataTypes,"*"); |
42 extern void CleanupAppServiceArray(TAny* aServiceArray); |
44 |
|
45 extern void CleanupServiceArray(TAny* aServiceArray); |
|
46 |
43 |
47 IMPORT_C extern const TInt KMinApplicationStackSize; |
44 IMPORT_C extern const TInt KMinApplicationStackSize; |
48 |
45 |
|
46 /** |
|
47 @internalComponent |
|
48 */ |
49 class MArrayFiller |
49 class MArrayFiller |
50 { |
50 { |
51 public: |
51 public: |
52 virtual void AppendItemL(RReadStream& aReadStream)=0; |
52 virtual void AppendItemFromStreamL(RReadStream& aReadStream) = 0; |
53 }; |
53 }; |
54 |
54 |
55 class TSizeArrayFiller : public MArrayFiller |
55 /** |
|
56 @internalComponent |
|
57 */ |
|
58 NONSHARABLE_CLASS(TSizeArrayFiller) : public MArrayFiller |
56 { |
59 { |
57 public: |
60 public: |
58 inline TSizeArrayFiller(CArrayFixFlat<TSize>& aArray) :iArray(aArray) {} |
61 inline TSizeArrayFiller(CArrayFixFlat<TSize>& aArray) : iArray(aArray) {} |
59 virtual void AppendItemL(RReadStream& aReadStream); |
62 public: // from MArrayFiller |
|
63 void AppendItemFromStreamL(RReadStream& aReadStream); |
60 private: |
64 private: |
61 CArrayFixFlat<TSize>& iArray; |
65 CArrayFixFlat<TSize>& iArray; |
62 }; |
66 }; |
63 |
67 |
64 class TViewDataArrayFiller : public MArrayFiller |
68 /** |
|
69 @internalComponent |
|
70 */ |
|
71 NONSHARABLE_CLASS(TViewDataArrayFiller) : public MArrayFiller |
65 { |
72 { |
66 public: |
73 public: |
67 inline TViewDataArrayFiller(CApaAppViewArray& aArray) :iArray(aArray) {} |
74 inline TViewDataArrayFiller(CApaAppViewArray& aArray) : iArray(aArray) {} |
68 virtual void AppendItemL(RReadStream& aReadStream); |
75 public: // from MArrayFiller |
|
76 void AppendItemFromStreamL(RReadStream& aReadStream); |
69 private: |
77 private: |
70 CApaAppViewArray& iArray; |
78 CApaAppViewArray& iArray; |
71 }; |
79 }; |
72 |
80 |
73 class TDesCArrayFiller : public MArrayFiller |
81 /** |
|
82 @internalComponent |
|
83 */ |
|
84 NONSHARABLE_CLASS(TDesCArrayFiller) : public MArrayFiller |
74 { |
85 { |
75 public: |
86 public: |
76 inline TDesCArrayFiller(CDesCArray& aArray) :iArray(aArray) {} |
87 inline TDesCArrayFiller(CDesCArray& aArray) : iArray(aArray) {} |
77 virtual void AppendItemL(RReadStream& aReadStream); |
88 public: // from MArrayFiller |
|
89 void AppendItemFromStreamL(RReadStream& aReadStream); |
78 private: |
90 private: |
79 CDesCArray& iArray; |
91 CDesCArray& iArray; |
80 }; |
92 }; |
81 |
93 |
82 /** |
94 // TSizeArrayFiller |
83 This class is used to simplify the usage of the asynchronous RApaLsSession::RecognizeFilesL() function. |
95 |
|
96 void TSizeArrayFiller::AppendItemFromStreamL(RReadStream& aReadStream) |
|
97 { |
|
98 TSize size; |
|
99 size.iWidth = aReadStream.ReadUint32L(); |
|
100 size.iHeight= aReadStream.ReadUint32L(); |
|
101 iArray.AppendL(size); |
|
102 } |
|
103 |
|
104 // TViewDataArrayFiller |
|
105 |
|
106 void TViewDataArrayFiller::AppendItemFromStreamL(RReadStream& aReadStream) |
|
107 { |
|
108 TApaAppViewInfo info; |
|
109 aReadStream >> info; |
|
110 iArray.AppendL(info); |
|
111 } |
|
112 |
|
113 // TDesCArrayFiller |
|
114 |
|
115 void TDesCArrayFiller::AppendItemFromStreamL(RReadStream& aReadStream) |
|
116 { |
|
117 TFileName info; |
|
118 aReadStream >> info; |
|
119 iArray.AppendL(info); |
|
120 } |
|
121 |
|
122 /** |
84 @internalComponent |
123 @internalComponent |
85 */ |
124 */ |
86 class CAsyncFileRecognition : public CActive |
125 EXPORT_C TUint MinApplicationStackSize() |
87 { |
126 { |
88 public: |
127 return KMinApplicationStackSize; |
89 CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession); |
128 } |
90 ~CAsyncFileRecognition(); |
129 |
91 void Start(const TDesC& aPath, const TDesC8& aDataType); |
130 |
92 private: |
131 // |
93 void RunL(); |
132 // class RApaLsSession |
94 void DoCancel(); |
133 // |
95 private: // data |
134 |
96 TPckgBuf<TUint> iRequiredBufferSizePckg; |
135 EXPORT_C RApaLsSession::RApaLsSession() |
97 CDataRecognitionResultArray& iResult; |
136 : iExtension(NULL) |
98 TRequestStatus& iUsersRequestStatus; |
137 {} |
99 CApaLsSessionExtension& iSession; |
138 |
100 const TDesC* iPath; |
139 |
101 const TDesC8* iDataType; |
140 |
102 }; |
141 /** Connects a client to the application architecture server, creating a session |
103 |
142 with it. |
104 /** |
143 |
105 This class is an extension class for RApaLsSession. It was added to reduce the need |
144 @return KErrNone if successful; otherwise, one of the system-wide error codes. |
106 of BC breaks in later releases. |
145 */ |
107 @internalComponent |
146 EXPORT_C TInt RApaLsSession::Connect() |
108 */ |
147 { |
109 class CApaLsSessionExtension : public CBase |
148 TInt r=CreateSession(KAppListServerName,Version(),KAsyncMessageSlots); |
110 { |
149 return(r); |
111 public: |
150 } |
112 CApaLsSessionExtension(RApaLsSession& aSession); |
151 |
113 ~CApaLsSessionExtension(); |
152 EXPORT_C void RApaLsSession::Close() |
114 |
153 /** |
115 void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const; |
154 Closes the session. Needs to be called to avoid memory leaks. |
116 TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const; |
|
117 |
|
118 // file recognition functions |
|
119 void RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus); |
|
120 void CancelRecognizeFiles(); |
|
121 void FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode); |
|
122 TBool RecognitionActive() const; |
|
123 private: |
|
124 RApaLsSession& iSession; // we are a friend of this class! |
|
125 CAsyncFileRecognition* iAsyncFileRecognition; |
|
126 }; |
|
127 |
|
128 /** |
|
129 An entry of a CDataRecognitionResultArray object. Stores TDataRecognitionResult and the file name |
|
130 in a compact format. |
|
131 @internalComponent |
|
132 */ |
|
133 class CDataRecognitionResultArrayEntry : public CBase |
|
134 { |
|
135 public: |
|
136 CDataRecognitionResultArrayEntry(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence); |
|
137 ~CDataRecognitionResultArrayEntry(); |
|
138 void GetDataRecognitionResult(TDataRecognitionResult& aResult) const; |
|
139 const TDesC& FileName() const; |
|
140 private: |
|
141 HBufC* iFileName; |
|
142 HBufC8* iDataType; |
|
143 TUid iUid; |
|
144 TInt iConfidence; |
|
145 }; |
|
146 |
|
147 ////////////////////////////// |
|
148 // CAsyncFileRecognition |
|
149 ////////////////////////////// |
|
150 |
|
151 CAsyncFileRecognition::CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession) |
|
152 : CActive(EPriorityStandard), |
|
153 iResult(aResult), |
|
154 iUsersRequestStatus(aUsersRequestStatus), |
|
155 iSession(aSession) |
|
156 { |
|
157 CActiveScheduler::Add(this); |
|
158 } |
|
159 |
|
160 void CAsyncFileRecognition::Start(const TDesC& aPath, const TDesC8& aDataType) |
|
161 { |
|
162 iPath = &aPath; |
|
163 iDataType = &aDataType; |
|
164 iStatus = KRequestPending; |
|
165 iSession.SendReceive(EAppListServRecognizeFilesAsync,TIpcArgs(&aPath,&iRequiredBufferSizePckg,&aDataType),iStatus); |
|
166 SetActive(); |
|
167 } |
|
168 |
|
169 CAsyncFileRecognition::~CAsyncFileRecognition() |
|
170 { |
|
171 Cancel(); |
|
172 iPath = NULL; |
|
173 iDataType = NULL; |
|
174 } |
|
175 |
|
176 void CAsyncFileRecognition::RunL() |
|
177 { |
|
178 iSession.FilesRecognized(*iPath, iRequiredBufferSizePckg(), iResult, iUsersRequestStatus, iStatus); |
|
179 } |
|
180 |
|
181 void CAsyncFileRecognition::DoCancel() |
|
182 { |
|
183 iSession.SendReceive(ECancelRecognizeFiles,TIpcArgs(TIpcArgs::ENothing)); |
|
184 TRequestStatus* status = &iUsersRequestStatus; |
|
185 User::RequestComplete( status, KErrCancel ); |
|
186 } |
|
187 |
|
188 ////////////////////////////// |
|
189 // CApaLsSessionExtension |
|
190 ////////////////////////////// |
|
191 |
|
192 CApaLsSessionExtension::CApaLsSessionExtension(RApaLsSession& aSession) |
|
193 : iSession(aSession), |
|
194 iAsyncFileRecognition(NULL) |
|
195 { |
|
196 } |
|
197 |
|
198 CApaLsSessionExtension::~CApaLsSessionExtension() |
|
199 { |
|
200 delete iAsyncFileRecognition; |
|
201 } |
|
202 |
|
203 void CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const |
|
204 { |
|
205 iSession.SendReceive(aFunction,aArgs,aStatus); //lint !e1060 Suppress protected member is not accessible to non-member non-friend |
|
206 } |
|
207 |
|
208 TInt CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const |
|
209 { |
|
210 return iSession.SendReceive(aFunction,aArgs); //lint !e1060 Suppress protected member is not accessible to non-member non-friend |
|
211 } |
|
212 |
|
213 /** |
|
214 Asynchronous recognition of a directory. |
|
215 Function uses an internal CAsyncFileRecognition object to hide the |
|
216 second server message (transferring the data to the client) from the user. |
|
217 When the path is not correct or the server is already busy with another |
|
218 recognition request, the function completes the request with an error. |
|
219 @internalComponent |
|
220 */ |
|
221 void CApaLsSessionExtension::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus) |
|
222 { |
|
223 _LIT(KBackslash,"\\"); |
|
224 |
|
225 if(aPath.Right(1) != KBackslash) |
|
226 { |
|
227 TRequestStatus* status = &aStatus; |
|
228 User::RequestComplete(status,KErrPathNotFound); |
|
229 } |
|
230 |
|
231 aResult.SetPath(aPath); |
|
232 aStatus = KRequestPending; |
|
233 |
|
234 if(!iAsyncFileRecognition) |
|
235 { |
|
236 iAsyncFileRecognition = new (ELeave) CAsyncFileRecognition(aResult, aStatus, *this); |
|
237 iAsyncFileRecognition->Start(aPath, aDataType); |
|
238 } |
|
239 else |
|
240 { |
|
241 TRequestStatus* status = &aStatus; |
|
242 User::RequestComplete(status,KErrInUse); |
|
243 } |
|
244 } |
|
245 |
|
246 TBool CApaLsSessionExtension::RecognitionActive() const |
|
247 { |
|
248 return iAsyncFileRecognition ? ETrue : EFalse; |
|
249 } |
|
250 |
|
251 void CApaLsSessionExtension::CancelRecognizeFiles() |
|
252 { |
|
253 if(iAsyncFileRecognition) |
|
254 { |
|
255 iAsyncFileRecognition->Cancel(); |
|
256 delete iAsyncFileRecognition; |
|
257 iAsyncFileRecognition = NULL; |
|
258 } |
|
259 } |
|
260 |
|
261 void CApaLsSessionExtension::FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode) |
|
262 /** |
|
263 Callback function called by an CAsyncFileRecognition object, when an asynchronous |
|
264 recognition has finished. If the recognition was successful, the data is transferred |
|
265 to the client-side. |
|
266 @internalComponent |
|
267 */ |
|
268 { |
|
269 TRequestStatus* status = &aUsersRequestStatus; |
|
270 if(aErrorCode == KErrNone) |
|
271 { |
|
272 // transfer the result |
|
273 TRAPD(error,iSession.TransferAndInternalizeDataL(aPath, aRequiredBufferSize, aResult)); |
|
274 User::RequestComplete(status, error); |
|
275 } |
|
276 else |
|
277 { |
|
278 User::RequestComplete(status, aErrorCode.Int()); |
|
279 } |
|
280 delete iAsyncFileRecognition; |
|
281 iAsyncFileRecognition = 0; |
|
282 } |
|
283 |
|
284 |
|
285 /////////////////////////////////////// |
|
286 // CDataRecognitionResultArrayEntry |
|
287 /////////////////////////////////////// |
|
288 |
|
289 CDataRecognitionResultArrayEntry::CDataRecognitionResultArrayEntry(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence) |
|
290 : iFileName(aFileName), |
|
291 iDataType(aDataType), |
|
292 iUid(aUid), |
|
293 iConfidence(aConfidence) |
|
294 { |
|
295 } |
|
296 |
|
297 CDataRecognitionResultArrayEntry::~CDataRecognitionResultArrayEntry() |
|
298 { |
|
299 delete iFileName; |
|
300 delete iDataType; |
|
301 } |
|
302 |
|
303 void CDataRecognitionResultArrayEntry::GetDataRecognitionResult(TDataRecognitionResult& aResult) const |
|
304 { |
|
305 TDataRecognitionResult result; |
|
306 if(iDataType->Length() != 0) |
|
307 { |
|
308 TDataType dataType(*iDataType); |
|
309 result.iDataType = dataType; |
|
310 } |
|
311 else |
|
312 { |
|
313 TDataType dataType(iUid); |
|
314 result.iDataType = dataType; |
|
315 } |
|
316 result.iConfidence = iConfidence; |
|
317 aResult = result; |
|
318 } |
|
319 |
|
320 const TDesC& CDataRecognitionResultArrayEntry::FileName() const |
|
321 { |
|
322 if (iFileName == NULL) |
|
323 return KNullDesC; |
|
324 else |
|
325 return *iFileName; |
|
326 } |
|
327 |
|
328 |
|
329 /////////////////////////////////// |
|
330 // CDataRecognitionResultArray |
|
331 /////////////////////////////////// |
|
332 |
|
333 /** |
|
334 Constructor |
|
335 @publishedAll |
155 @publishedAll |
336 @released |
156 @released |
337 */ |
157 */ |
338 EXPORT_C CDataRecognitionResultArray::CDataRecognitionResultArray() |
158 { |
339 { |
159 CancelRecognizeFiles(); |
340 } |
160 RHandleBase::Close(); |
341 |
161 } |
342 /** |
|
343 Destructor |
|
344 @publishedAll |
|
345 @released |
|
346 */ |
|
347 EXPORT_C CDataRecognitionResultArray::~CDataRecognitionResultArray() |
|
348 { |
|
349 iEntries.ResetAndDestroy(); |
|
350 } |
|
351 |
|
352 /** |
|
353 Returns the path of the recognition results. |
|
354 @publishedAll |
|
355 @released |
|
356 @return The path of the recognition results |
|
357 */ |
|
358 EXPORT_C const TFileName& CDataRecognitionResultArray::Path() const |
|
359 { |
|
360 return iPath; |
|
361 } |
|
362 |
|
363 /** |
|
364 Returns the number of entries in the CDataRecognitionResultArray. |
|
365 @publishedAll |
|
366 @released |
|
367 @return The number of entries in the CDataRecognitionResultArray. |
|
368 */ |
|
369 EXPORT_C TUint CDataRecognitionResultArray::Count() const |
|
370 { |
|
371 return iEntries.Count(); |
|
372 } |
|
373 |
|
374 /** |
|
375 Returns the recognition result of the given index. |
|
376 @publishedAll |
|
377 @released |
|
378 @param aResult On successful completion, this parameter contains the recognition result at the given index. |
|
379 @param aIndex The index of the recognition result to be returned. An invalid index causes |
|
380 the function to leave with KErrNotFound. |
|
381 @return The requested TDataRecognitionResult object |
|
382 @leave KErrNotFound An invalid index is passed |
|
383 */ |
|
384 EXPORT_C void CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const |
|
385 { |
|
386 if( aIndex >= iEntries.Count() ) |
|
387 { |
|
388 User::Leave(KErrNotFound); |
|
389 } |
|
390 iEntries[aIndex]->GetDataRecognitionResult(aResult); |
|
391 } |
|
392 |
|
393 /** |
|
394 Returns the file name of the object at the given index. |
|
395 @publishedAll |
|
396 @released |
|
397 @param aFileName On successful completion, this parameter contains the file name of the object at the given index. |
|
398 @param aIndex Specifies which file name to be returned. An invalid index causes |
|
399 the function to leave with KErrNotFound. |
|
400 @return The requested file name |
|
401 @leave KErrNotFound An invalid index is passed |
|
402 */ |
|
403 EXPORT_C void CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const |
|
404 { |
|
405 if( aIndex >= iEntries.Count() ) |
|
406 { |
|
407 User::Leave(KErrNotFound); |
|
408 } |
|
409 aFileName.Zero(); |
|
410 aFileName.Copy( (iEntries[aIndex]->FileName()) ); |
|
411 } |
|
412 |
|
413 TUint CDataRecognitionResultArray::InternalizeL(const CBufFlat& aBuffer) |
|
414 { |
|
415 RBufReadStream readStream; |
|
416 |
|
417 readStream.Open(aBuffer); |
|
418 const TInt count=readStream.ReadUint32L(); |
|
419 for (TInt i=0; i<count; ++i) |
|
420 { |
|
421 const TInt fileNameLength = readStream.ReadUint8L(); |
|
422 HBufC* const fileName = HBufC::NewLC(fileNameLength); |
|
423 TPtr fileNamePtr = fileName->Des(); |
|
424 readStream.ReadL(fileNamePtr,fileNameLength); |
|
425 |
|
426 const TInt dataTypeLength = readStream.ReadUint8L(); |
|
427 HBufC8* const dataType = HBufC8::NewLC(dataTypeLength); |
|
428 TPtr8 dataTypePtr = dataType->Des(); |
|
429 readStream.ReadL(dataTypePtr,dataTypeLength); |
|
430 |
|
431 TUid uid; |
|
432 uid.iUid = readStream.ReadInt32L(); |
|
433 |
|
434 TInt const confidence = readStream.ReadInt32L(); |
|
435 |
|
436 CDataRecognitionResultArrayEntry* entry = new (ELeave) CDataRecognitionResultArrayEntry(fileName,dataType,uid,confidence); |
|
437 iEntries.Append(entry); |
|
438 |
|
439 CleanupStack::Pop(dataType); // ownership was transferred to "entry" |
|
440 CleanupStack::Pop(fileName); // ownership was transferred to "entry" |
|
441 } |
|
442 |
|
443 readStream.Close(); |
|
444 |
|
445 return KErrNone; |
|
446 } |
|
447 |
|
448 void CDataRecognitionResultArray::SetPath(const TFileName& aPath) |
|
449 { |
|
450 iPath.Copy(aPath); |
|
451 } |
|
452 |
|
453 //////////////////////////////////// |
|
454 //RApaLsSession |
|
455 //////////////////////////////////// |
|
456 |
|
457 EXPORT_C RApaLsSession::RApaLsSession() |
|
458 : iExtension(0) |
|
459 {} |
|
460 |
|
461 |
|
462 |
|
463 /** Connects a client to the application architecture server, creating a session |
|
464 with it. |
|
465 |
|
466 @return KErrNone if successful; otherwise, one of the system-wide error codes. |
|
467 */ |
|
468 EXPORT_C TInt RApaLsSession::Connect() |
|
469 { |
|
470 TInt r=CreateSession(KAppListServerName,Version(),KAsyncMessageSlots); |
|
471 return(r); |
|
472 } |
|
473 |
|
474 |
162 |
475 |
163 |
476 /** Gets the version of the application architecture server. |
164 /** Gets the version of the application architecture server. |
477 |
165 |
478 @return The version number. |
166 @return The version number. |
479 */ |
167 */ |
480 EXPORT_C TVersion RApaLsSession::Version(void) const |
168 EXPORT_C TVersion RApaLsSession::Version(void) const |
481 { |
169 { |
482 return(TVersion(KAppListServMajorVersionNumber,KAppListServMinorVersionNumber,KAppListServBuildVersionNumber)); |
170 return(TVersion(KAppListServMajorVersionNumber,KAppListServMinorVersionNumber,KAppListServBuildVersionNumber)); |
483 } |
171 } |
484 |
|
485 |
172 |
486 |
173 |
487 /** Gets the total number of applications. |
174 /** Gets the total number of applications. |
488 |
175 |
489 Control panel applications are excluded. |
176 Control panel applications are excluded. |
854 { |
533 { |
855 return SendReceiveWithReconnect(EAppListServGetAppCapability,TIpcArgs(&aCapabilityBuf,aAppUid.iUid)); |
534 return SendReceiveWithReconnect(EAppListServGetAppCapability,TIpcArgs(&aCapabilityBuf,aAppUid.iUid)); |
856 } |
535 } |
857 |
536 |
858 |
537 |
859 |
|
860 /** Starts an application defined by the specified command line information. |
|
861 This is an asynchronous method which doesn't wait for the process creation to complete. |
|
862 To be informed of the process creation success, |
|
863 then appropriate overloaded method taking a TRequestStatus parameter should be used. |
|
864 |
|
865 This is only recommended for non document based applications. |
|
866 |
|
867 View based applications are usually started by activating a specific view |
|
868 using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a |
|
869 view based application will activate the application's default view. |
|
870 |
|
871 @param aCommandLine The command line. |
|
872 @return KErrNone, if successful; KErrNotFound, if the application cannot be |
|
873 found; otherwise one of the other system-wide error codes. |
|
874 @see CCoeAppUi::ActivateViewL() |
|
875 */ |
|
876 EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine) |
|
877 { |
|
878 return DoStartApp(aCommandLine, NULL,NULL); |
|
879 } |
|
880 |
|
881 /** Starts an application defined by the specified command line information. |
|
882 This is an asynchronous method which doesn't wait for the process creation to complete. |
|
883 To be informed of the process creation success, |
|
884 then appropriate overloaded method taking a TRequestStatus parameter should be used. |
|
885 |
|
886 This is only recommended for non document based applications. |
|
887 |
|
888 View based applications are usually started by activating a specific view |
|
889 using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a |
|
890 view based application will activate the application's default view. |
|
891 |
|
892 @param aCommandLine The command line. |
|
893 @param aThreadId On return, the id of the main thread started. |
|
894 @return KErrNone, if successful; KErrNotFound, if the application cannot be |
|
895 found; otherwise one of the other system-wide error codes. |
|
896 @see CCoeAppUi::ActivateViewL() |
|
897 */ |
|
898 EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId) |
|
899 { |
|
900 return DoStartApp(aCommandLine, &aThreadId,NULL); |
|
901 } |
|
902 |
|
903 |
|
904 /** Starts an application defined by the specified command line information. |
|
905 |
|
906 This is only recommended for non document based applications. |
|
907 |
|
908 View based applications are usually started by activating a specific view |
|
909 using CCoeAppUi::ActivateViewL. Alternatively, using StartApp() to start a |
|
910 view based application will activate the application's default view. |
|
911 |
|
912 @param aCommandLine The command line. |
|
913 @param aThreadId On return, the id of the main thread started. |
|
914 @param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() |
|
915 function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on |
|
916 the new application process. If this function does not return KErrNone, RProcess::Rendezvous() will |
|
917 not be called passing aRequestStatusForRendezvous, so in this case the caller must not wait |
|
918 on aRequestStatusForRendezvous. |
|
919 @return KErrNone, if successful; KErrNotFound, if the application cannot be |
|
920 found; otherwise one of the other system-wide error codes. |
|
921 @see CCoeAppUi::ActivateViewL() |
|
922 */ |
|
923 EXPORT_C TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId,TRequestStatus* aRequestStatusForRendezvous ) |
|
924 { |
|
925 return DoStartApp(aCommandLine, &aThreadId,aRequestStatusForRendezvous); |
|
926 } |
|
927 |
|
928 |
|
929 TInt RApaLsSession::DoStartApp(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous) |
|
930 { |
|
931 TRAPD(error, DoStartAppL(aCommandLine, aThreadId, aRequestStatusForRendezvous)); |
|
932 return error; |
|
933 } |
|
934 |
|
935 void RApaLsSession::DoStartAppL(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous) |
|
936 { |
|
937 // This function does not require "this" object to be connected to the Apparc server, |
|
938 // but if not, it works with some limitations (see the following document for a list |
|
939 // of these limitations: |
|
940 // generic/app-framework/Documentation/PREQ967_solution_constraints.doc). |
|
941 |
|
942 #if defined(USE_IH_RAISE_EVENT) |
|
943 const TInt appStartupInstrumentationEventIdBase=aCommandLine.AppStartupInstrumentationEventIdBase(); |
|
944 if (appStartupInstrumentationEventIdBase!=0) |
|
945 { |
|
946 IH_DECLARE( lInstrumentationHandler ); |
|
947 IH_CREATE( lInstrumentationHandler ); |
|
948 IH_RAISE_EVENT( lInstrumentationHandler, appStartupInstrumentationEventIdBase+MTestInstrumentation::TIDOffsetBeginApplicationFirstRedraw ); |
|
949 IH_RAISE_EVENT( lInstrumentationHandler, appStartupInstrumentationEventIdBase+MTestInstrumentation::TIDOffsetBeginApplicationReadyForInput ); |
|
950 IH_DELETE( lInstrumentationHandler ); |
|
951 } |
|
952 #endif |
|
953 |
|
954 // Retrieve the executable name from the CApaCommandLine object passed in. |
|
955 const TPtrC logicalExecutableName(aCommandLine.ExecutableName()); |
|
956 // Rule-based app launching is not allowed unless there is a connected RApaLsSession object. |
|
957 if(Handle() != KNullHandle) |
|
958 { |
|
959 // requesting from rule-based plug-ins if we can run an application |
|
960 // if server fails while requested rule-based plug-ins it returns a negative value - proceed with launching the application in this case |
|
961 TBool okayToRun = SendReceiveWithReconnect(EAppListServRuleBasedLaunching, TIpcArgs(&logicalExecutableName)); |
|
962 if(!okayToRun) |
|
963 { |
|
964 User::Leave(KErrCancel); |
|
965 } |
|
966 } |
|
967 |
|
968 TFileName nativeExecutableNameOfNonNativeApplication; |
|
969 RProcess process; |
|
970 HBufC8* opaqueData=NULL; |
|
971 CleanupStack::PushL(TCleanupItem(DeletePointerToPointerToTAny, &opaqueData)); |
|
972 |
|
973 // if we're connected to the Apparc server, try to get the opaque-data and native-executable name |
|
974 // (the latter is only if it's a non-native application that we're launching) |
|
975 if (Handle()!=KNullHandle) |
|
976 { |
|
977 const TInt lengthOfOpaqueData=User::LeaveIfError(SendReceiveWithReconnect(EAppListServGetNativeExecutableNameIfNonNative, TIpcArgs(&nativeExecutableNameOfNonNativeApplication, &logicalExecutableName))); |
|
978 if (lengthOfOpaqueData>0) |
|
979 { |
|
980 User::LeaveIfError(GetOpaqueData(opaqueData, lengthOfOpaqueData)); |
|
981 } |
|
982 } |
|
983 |
|
984 // try first to create the application process without interacting with the Apparc server at all - |
|
985 // assumes "logicalExecutableName" is itself a native executable |
|
986 TUidType uidType(KNullUid, KNullUid, KNullUid); |
|
987 TInt err = process.CreateWithStackOverride(logicalExecutableName, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess); |
|
988 |
|
989 // If we haven't been able to create the process using the native executable name from the command line |
|
990 // object, instead try to create it using the native executable name of the non-native application. |
|
991 // Can only do this if apparc is connected and thus this name has been retrieved above and |
|
992 // nativeExecutableNameOfNonNativeApplication populated. |
|
993 if ((err != KErrNone) && nativeExecutableNameOfNonNativeApplication.Length()>0) |
|
994 { |
|
995 err = process.CreateWithStackOverride(nativeExecutableNameOfNonNativeApplication, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess); |
|
996 } |
|
997 |
|
998 // if we managed to create the process via either of the two methods attempted above (with the native |
|
999 // name or the native name of the non-native app), finish setting it up and "resume" it |
|
1000 if (err == KErrNone) |
|
1001 { |
|
1002 CleanupStack::PushL(TCleanupItem(CleanupOperation, &process)); |
|
1003 if (opaqueData!=NULL) |
|
1004 { |
|
1005 const_cast<CApaCommandLine&>(aCommandLine).SetOpaqueDataL(*opaqueData); |
|
1006 } |
|
1007 aCommandLine.SetProcessEnvironmentL(process); |
|
1008 if (aThreadId!=NULL) |
|
1009 { |
|
1010 GetThreadIdL(*aThreadId, process); |
|
1011 } |
|
1012 if (aRequestStatusForRendezvous!=NULL) |
|
1013 { |
|
1014 process.Rendezvous(*aRequestStatusForRendezvous); |
|
1015 } |
|
1016 // Note - must not leave between here and the end of this method because we only expect |
|
1017 // the caller to wait on aRequestStatusForRendezvous if this method does not leave. |
|
1018 if(aRequestStatusForRendezvous != NULL && *aRequestStatusForRendezvous != KRequestPending) |
|
1019 { |
|
1020 User::WaitForRequest(*aRequestStatusForRendezvous); |
|
1021 User::Leave(aRequestStatusForRendezvous->Int()); // item on cleanupstack terminates and closes the process |
|
1022 } |
|
1023 else |
|
1024 { |
|
1025 process.Resume(); |
|
1026 } |
|
1027 CleanupStack::Pop(&process); |
|
1028 process.Close(); |
|
1029 } |
|
1030 else // Couldn't create a process |
|
1031 { |
|
1032 if (Handle()==KNullHandle) // not connected to apparc |
|
1033 { |
|
1034 const TPtrC executableName(aCommandLine.ExecutableName()); |
|
1035 |
|
1036 // Java applications have an empty ExecutableName, as they use the CApaCommandLine's |
|
1037 // opaque-data attribute. Not connected to apparc so can't start a non-native app. |
|
1038 // Therefore we should handle this case with KErrNotSupported rather than whatever |
|
1039 // RProcess::Create returns when passed an empty descriptor. |
|
1040 if (executableName.Length() == 0) |
|
1041 { |
|
1042 User::Leave(KErrNotSupported); |
|
1043 } |
|
1044 |
|
1045 // Otherwise return the error code from RProcess::Create. |
|
1046 User::Leave(err); |
|
1047 |
|
1048 } |
|
1049 else // Handle()!=KNullHandle |
|
1050 { |
|
1051 // we can only proceed with the remaining option if we're connected to the Apparc server |
|
1052 // as a last resort, try use the legacy file-recognizer framework to launch the application |
|
1053 TThreadId dummyThreadId; |
|
1054 TPckg<TThreadId> threadId((aThreadId!=NULL)? *aThreadId: dummyThreadId); |
|
1055 const TInt opcode=(aThreadId==NULL)? |
|
1056 EAppListServStartAppWithoutReturningThreadId: |
|
1057 EAppListServStartAppReturningThreadId; |
|
1058 TIpcArgs ipcArgs; |
|
1059 aCommandLine.GetIpcArgsLC(ipcArgs); |
|
1060 if (aThreadId!=NULL) |
|
1061 { |
|
1062 ipcArgs.Set(CApaCommandLine::EIpcFirstFreeSlot, &threadId); |
|
1063 } |
|
1064 User::LeaveIfError(SendReceiveWithReconnect(opcode, ipcArgs)); |
|
1065 if (aRequestStatusForRendezvous!=NULL) |
|
1066 { |
|
1067 User::RequestComplete(aRequestStatusForRendezvous,KErrNone); |
|
1068 } |
|
1069 CleanupStack::PopAndDestroy(); // the TIpcArgs |
|
1070 } |
|
1071 } |
|
1072 CleanupStack::PopAndDestroy(&opaqueData); |
|
1073 } //lint !e1762 Suppress member function could be made const |
|
1074 |
|
1075 void RApaLsSession::CleanupOperation(TAny* aAny) |
|
1076 { |
|
1077 RProcess* activeProcess = reinterpret_cast<RProcess*>(aAny); |
|
1078 activeProcess->Terminate(KErrGeneral); |
|
1079 activeProcess->Close(); |
|
1080 } |
|
1081 |
|
1082 void RApaLsSession::GetThreadIdL(TThreadId& aThreadId, const RProcess& aProcess) |
|
1083 { // static |
|
1084 TFullName fullName(aProcess.Name()); |
|
1085 _LIT(KCCMain,"::Main"); |
|
1086 fullName.Append(KCCMain); |
|
1087 RThread thread; |
|
1088 User::LeaveIfError(thread.Open(fullName,EOwnerThread)); |
|
1089 aThreadId=thread.Id(); |
|
1090 thread.Close(); |
|
1091 } |
|
1092 |
|
1093 void RApaLsSession::DeletePointerToPointerToTAny(TAny* aPointerToPointerToTAny) |
|
1094 { // static |
|
1095 __ASSERT_ALWAYS(aPointerToPointerToTAny, Panic(EPanicNullPointer)); |
|
1096 delete *static_cast<TAny**>(aPointerToPointerToTAny); //lint !e613 Suppress possible use of null pointer |
|
1097 } //lint !e818 Suppress pointer parameter could be declared as pointing to const |
|
1098 |
|
1099 /** |
|
1100 Sets up slots 0 and 1 in aIpcArgs - assumes that slots 2 and 3 have already been set up; |
|
1101 it then invokes aOpcode |
|
1102 */ |
|
1103 TInt RApaLsSession::GetExecutableName(TDes& aNativeExecutableName, TDes& aLogicalExecutableName, HBufC8*& aOpaqueData, TIpcArgs& aIpcArgs, TInt aOpcode) const |
|
1104 { |
|
1105 aNativeExecutableName.SetLength(0); // if this comes out zero-length from EAppListServExecutableNameForXxx below then use the logicalExecutableName in RProcess::Create (in this case it's a native C++ application) |
|
1106 aIpcArgs.Set(0, &aNativeExecutableName); |
|
1107 aIpcArgs.Set(1, &aLogicalExecutableName); |
|
1108 const TInt lengthOfOpaqueData=SendReceiveWithReconnect(aOpcode, aIpcArgs); |
|
1109 if (lengthOfOpaqueData<0) |
|
1110 { |
|
1111 return lengthOfOpaqueData; // it's an error code |
|
1112 } |
|
1113 if (lengthOfOpaqueData>0) |
|
1114 { |
|
1115 return GetOpaqueData(aOpaqueData, lengthOfOpaqueData); |
|
1116 } |
|
1117 aOpaqueData=NULL; |
|
1118 return KErrNone; |
|
1119 } |
|
1120 |
|
1121 TInt RApaLsSession::GetOpaqueData(HBufC8*& aOpaqueData, TInt aLengthOfOpaqueData) const |
|
1122 { |
|
1123 HBufC8* const opaqueData=HBufC8::New(aLengthOfOpaqueData); |
|
1124 if (opaqueData==NULL) |
|
1125 { |
|
1126 return KErrNoMemory; |
|
1127 } |
|
1128 TPtr8 opaqueData_asWritable(opaqueData->Des()); |
|
1129 const TInt error=SendReceiveWithReconnect(EAppListServGetOpaqueData, TIpcArgs(&opaqueData_asWritable)); |
|
1130 if (error!=KErrNone) |
|
1131 { |
|
1132 delete opaqueData; |
|
1133 return error; |
|
1134 } |
|
1135 aOpaqueData=opaqueData; |
|
1136 return error; |
|
1137 } |
|
1138 |
|
1139 TInt RApaLsSession::StartApplicationPassingFileHandle(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous) |
|
1140 { |
|
1141 TFileName documentName; |
|
1142 aFile.FullName(documentName); |
|
1143 CApaCommandLine* commandLine=NULL; |
|
1144 TRAPD(error, commandLine=CApaCommandLine::NewLC(); |
|
1145 commandLine->SetCommandL(EApaCommandOpen); |
|
1146 commandLine->SetExecutableNameL(aLogicalExecutableName); |
|
1147 commandLine->SetFileByHandleL(aFile); |
|
1148 commandLine->SetDocumentNameL(documentName); |
|
1149 if (aOpaqueData!=NULL) |
|
1150 { |
|
1151 commandLine->SetOpaqueDataL(*aOpaqueData); |
|
1152 } |
|
1153 StartApplicationL(aNativeExecutableName, *commandLine, aThreadId, aRequestStatusForRendezvous); |
|
1154 CleanupStack::PopAndDestroy(commandLine)); |
|
1155 return error; |
|
1156 } |
|
1157 |
|
1158 TInt RApaLsSession::StartApplicationPassingDocumentName(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const TDesC& aDocumentName, TThreadId& aThreadId,TApaCommand aCommand, TRequestStatus* aRequestStatusForRendezvous) |
|
1159 { |
|
1160 CApaCommandLine* commandLine=NULL; |
|
1161 TRAPD(error, commandLine=CApaCommandLine::NewLC(); |
|
1162 commandLine->SetCommandL(aCommand); |
|
1163 commandLine->SetExecutableNameL(aLogicalExecutableName); |
|
1164 commandLine->SetDocumentNameL(aDocumentName); |
|
1165 if (aOpaqueData!=NULL) |
|
1166 { |
|
1167 commandLine->SetOpaqueDataL(*aOpaqueData); |
|
1168 } |
|
1169 StartApplicationL(aNativeExecutableName, *commandLine, aThreadId, aRequestStatusForRendezvous); |
|
1170 CleanupStack::PopAndDestroy(commandLine)); |
|
1171 return error; |
|
1172 } |
|
1173 |
|
1174 void RApaLsSession::StartApplicationL(const TDesC& aNativeExecutableName, const CApaCommandLine& aCommandLine, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous) |
|
1175 { |
|
1176 RProcess process; |
|
1177 TPtrC actualNativeExecutableName(aNativeExecutableName); |
|
1178 if (actualNativeExecutableName.Length()==0) |
|
1179 { |
|
1180 actualNativeExecutableName.Set(aCommandLine.ExecutableName()); // it's a native C++ application, rather than a MIDlet, Python script, etc |
|
1181 } |
|
1182 |
|
1183 if(Handle() != KNullHandle) |
|
1184 { |
|
1185 //requesting from rule-based plug-ins if we can run an application |
|
1186 TBool okayToRun = SendReceiveWithReconnect(EAppListServRuleBasedLaunching, TIpcArgs(&actualNativeExecutableName)); |
|
1187 //If server fails while requested rule-based plug-ins it returns a negative value. |
|
1188 //We shall proceed with launching an application in this case. |
|
1189 if(!okayToRun) |
|
1190 { |
|
1191 User::Leave(KErrCancel); |
|
1192 } |
|
1193 } |
|
1194 |
|
1195 TUidType uidType(KNullUid, KNullUid, KNullUid); |
|
1196 User::LeaveIfError(process.CreateWithStackOverride(actualNativeExecutableName, KNullDesC, uidType, MinApplicationStackSize(), EOwnerProcess)); // RProcess::CreateWithStackOveride - TESTED |
|
1197 |
|
1198 CleanupClosePushL(process); |
|
1199 aCommandLine.SetProcessEnvironmentL(process); |
|
1200 GetThreadIdL(aThreadId, process); |
|
1201 if (aRequestStatusForRendezvous!=NULL) |
|
1202 { |
|
1203 process.Rendezvous(*aRequestStatusForRendezvous); |
|
1204 } |
|
1205 process.Resume(); |
|
1206 CleanupStack::PopAndDestroy(&process); |
|
1207 } //lint !e1762 Suppress member function could be made const |
|
1208 |
|
1209 |
|
1210 |
|
1211 /** Gets the data (MIME) type for data taken from a file with a specified name. |
|
1212 |
|
1213 @param aName The full filename, including drive and path, of the file containing the data. |
|
1214 @param aBuffer A buffer containing data taken from the specified file; typically |
|
1215 the data is read from the beginning of the file. |
|
1216 @param aDataType On return, contains the result of the attempt to recognize |
|
1217 data. |
|
1218 @return KErrNone, if successful; otherwise one of the other system-wide error |
|
1219 codes. |
|
1220 */ |
|
1221 EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const |
|
1222 { |
|
1223 TPckg<TDataRecognitionResult> result(aDataType); |
|
1224 return SendReceiveWithReconnect(EAppListServRecognizeData,TIpcArgs(&result, &aName, &aBuffer)); |
|
1225 } //lint !e1764: Suppress reference parameter could be declared const ref |
|
1226 |
|
1227 /** Gets the data (MIME) type for data in a file passed by handle. |
|
1228 |
|
1229 @param aFile The file containing the data. Before this function can be called, |
|
1230 the file server session which owns this file handle must first be marked as shareable by |
|
1231 calling RFs::ShareProtected(). |
|
1232 @param aDataType On return, contains the result of the attempt to recognize |
|
1233 data. |
|
1234 @return KErrNone, if successful; otherwise one of the other system-wide error |
|
1235 codes. */ |
|
1236 EXPORT_C TInt RApaLsSession::RecognizeData(const RFile& aFile, TDataRecognitionResult& aDataType) const |
|
1237 { |
|
1238 TPckg<TDataRecognitionResult> result(aDataType); |
|
1239 TIpcArgs ipcArgs(&result); |
|
1240 const TInt error = aFile.TransferToServer(ipcArgs, 1, 2); |
|
1241 if (error != KErrNone) |
|
1242 { |
|
1243 return error; |
|
1244 } |
|
1245 return SendReceiveWithReconnect(EAppListServRecognizeDataPassedByFileHandle,ipcArgs); |
|
1246 } //lint !e1764 Suppress reference parameter 'aDataType' could be declared const ref |
|
1247 |
|
1248 |
|
1249 |
|
1250 /** Tests whether data taken from a named file has the specified |
|
1251 data (MIME) type. |
|
1252 |
|
1253 @param aName The name of the file containing the data. |
|
1254 @param aBuffer A buffer containing data taken from the specified file; typically |
|
1255 the data is read from the beginning of the file. |
|
1256 @param aDataType The data (MIME) type. |
|
1257 @param aResult On return, contains the result of the test. |
|
1258 @return KErrNone, if successful; otherwise one of the other system-wide error |
|
1259 codes. |
|
1260 */ |
|
1261 EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const |
|
1262 { |
|
1263 const TPckgC<TDataType> dataType(aDataType); |
|
1264 const TInt returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificData,TIpcArgs(&dataType, &aName, &aBuffer)); |
|
1265 if (returnValue<0) |
|
1266 { |
|
1267 return returnValue; |
|
1268 } |
|
1269 aResult=returnValue; |
|
1270 return KErrNone; |
|
1271 } |
|
1272 |
|
1273 EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult) const |
|
1274 /** |
|
1275 Gets the data (MIME) type for files in a specified directory. Because this call may take a long |
|
1276 time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible |
|
1277 to use this synchronous function while an asynchronous request is still active. |
|
1278 @publishedAll |
|
1279 @released |
|
1280 @param aPath A valid path. Note that the path must end with a backslash. |
|
1281 @param aResult If the call was successful, this parameter contains the recognition result. |
|
1282 @return KErrNone, if successful; otherwise one of the other system-wide error codes. |
|
1283 */ |
|
1284 { |
|
1285 return RecognizeFilesL(aPath, KAllDataTypes, aResult); |
|
1286 } |
|
1287 |
|
1288 EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult) const |
|
1289 /** |
|
1290 Gets the data (MIME) type for files in a specified directory. Because this call may take a long |
|
1291 time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible |
|
1292 to use this synchronous function while an asynchronous request is still active. |
|
1293 @publishedAll |
|
1294 @released |
|
1295 @param aPath A valid path. Note that the path must end with a backslash. |
|
1296 @param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also |
|
1297 add "text/plain" data types to the result. |
|
1298 @param aResult If the call was successful, this parameter contains the recognition result. |
|
1299 @return KErrNone, if successful; otherwise one of the other system-wide error codes. |
|
1300 */ |
|
1301 { |
|
1302 if(iExtension && iExtension->RecognitionActive()) |
|
1303 { |
|
1304 return KErrInUse; |
|
1305 } |
|
1306 _LIT(KBackslash,"\\"); |
|
1307 if(aPath.Right(1) != KBackslash) |
|
1308 { |
|
1309 return KErrPathNotFound; |
|
1310 } |
|
1311 |
|
1312 TPckgBuf<TUint> requiredBufferSizePckg; |
|
1313 aResult.SetPath(aPath); |
|
1314 TInt error = SendReceiveWithReconnect(EAppListServRecognizeFiles,TIpcArgs(&aPath,&requiredBufferSizePckg,&aDataType)); |
|
1315 if(KErrNone == error) |
|
1316 { |
|
1317 error=TransferAndInternalizeDataL(aPath, requiredBufferSizePckg(), aResult); |
|
1318 } |
|
1319 return error; |
|
1320 |
|
1321 } |
|
1322 |
|
1323 EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus) |
|
1324 /** |
|
1325 Gets the data (MIME) type for files in a specified directory. |
|
1326 @publishedAll |
|
1327 @released |
|
1328 @param aPath A valid path. Note that the path must end with a backslash. |
|
1329 @param aResult If the call was successful, this parameter contains the recognition result. |
|
1330 @param aStatus A request status object. |
|
1331 */ |
|
1332 { |
|
1333 RecognizeFilesL(aPath,KAllDataTypes,aResult,aStatus); |
|
1334 } |
|
1335 |
|
1336 EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus) |
|
1337 /** |
|
1338 Gets the data (MIME) type for files in a specified directory. |
|
1339 @publishedAll |
|
1340 @released |
|
1341 @param aPath A valid path. Note that the path must end with a backslash. |
|
1342 @param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also |
|
1343 add "text/plain" data types to the result. |
|
1344 @param aResult If the call was successful, this parameter contains the recognition result. |
|
1345 @param aStatus A request status object |
|
1346 */ |
|
1347 { |
|
1348 if(iExtension == NULL) |
|
1349 { |
|
1350 iExtension = new (ELeave) CApaLsSessionExtension(*this); |
|
1351 } |
|
1352 iExtension->RecognizeFilesL(aPath, aDataType, aResult, aStatus); |
|
1353 } |
|
1354 |
|
1355 TInt RApaLsSession::TransferAndInternalizeDataL(const TDesC& aPath, const TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult) const |
|
1356 /** |
|
1357 This function transfers the data to the client-side and "fills" the CDataRecognitionResultArray object. |
|
1358 @internalComponent |
|
1359 */ |
|
1360 { |
|
1361 CBufFlat* const buffer=CBufFlat::NewL(aRequiredBufferSize); |
|
1362 CleanupStack::PushL(buffer); |
|
1363 buffer->ExpandL(0,aRequiredBufferSize); |
|
1364 TPtr8 bufPtr=buffer->Ptr(0); |
|
1365 |
|
1366 // transfer recognition buffer |
|
1367 TInt error = SendReceiveWithReconnect(EAppListServTransferRecognitionResult,TIpcArgs(&aPath,&bufPtr,aRequiredBufferSize)); |
|
1368 if(KErrNone == error) |
|
1369 { |
|
1370 error = aResult.InternalizeL(*buffer); |
|
1371 } |
|
1372 CleanupStack::PopAndDestroy(buffer); |
|
1373 return error; |
|
1374 } |
|
1375 |
|
1376 EXPORT_C void RApaLsSession::CancelRecognizeFiles() |
|
1377 /** |
|
1378 Cancels any outstanding asynchronous recognition requests. |
|
1379 @publishedAll |
|
1380 @released |
|
1381 */ |
|
1382 { |
|
1383 if(iExtension) |
|
1384 { |
|
1385 iExtension->CancelRecognizeFiles(); |
|
1386 } |
|
1387 } |
|
1388 |
|
1389 EXPORT_C void RApaLsSession::Close() |
|
1390 /** |
|
1391 Closes the session. Needs to be called to avoid memory leaks. |
|
1392 @publishedAll |
|
1393 @released |
|
1394 */ |
|
1395 { |
|
1396 CancelRecognizeFiles(); |
|
1397 RHandleBase::Close(); |
|
1398 delete iExtension; |
|
1399 iExtension = NULL; |
|
1400 } |
|
1401 |
|
1402 EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const RFile& aFile, const TDataType& aDataType, TBool& aResult) const |
|
1403 /** Tests whether data taken from a file passed by handle has the specified |
|
1404 data (MIME) type. |
|
1405 |
|
1406 @param aFile The file containing the data. Before this function can be called, |
|
1407 the file server session which owns this file handle must first be marked as shareable by |
|
1408 calling RFs::ShareProtected(). |
|
1409 @param aDataType The data (MIME) type. |
|
1410 @param aResult On return, contains the result of the test. |
|
1411 @return KErrNone, if successful; otherwise one of the other system-wide error |
|
1412 codes. */ |
|
1413 { |
|
1414 const TPckgC<TDataType> dataType(aDataType); |
|
1415 TIpcArgs ipcArgs(&dataType); |
|
1416 TInt returnValue = aFile.TransferToServer(ipcArgs, 1, 2); |
|
1417 if (returnValue == KErrNone) |
|
1418 { |
|
1419 returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificDataPassedByFileHandle,ipcArgs); |
|
1420 } |
|
1421 if (returnValue < KErrNone) |
|
1422 { |
|
1423 return returnValue; |
|
1424 } |
|
1425 aResult=returnValue; |
|
1426 return KErrNone; |
|
1427 } |
|
1428 |
|
1429 |
|
1430 /** Gets the UID of an application that can handle the specified data (MIME) type. |
538 /** Gets the UID of an application that can handle the specified data (MIME) type. |
1431 |
539 |
1432 If no application can be found, the function returns the UID of the preferred |
540 If no application can be found, the function returns the UID of the preferred |
1433 default handler. If none of the default handlers can handle the data type, |
541 default handler. If none of the default handlers can handle the data type, |
1434 then a NULL UID is returned. |
542 then a NULL UID is returned. |
1443 { |
551 { |
1444 const TPckgC<TDataType> dataType(aDataType); |
552 const TPckgC<TDataType> dataType(aDataType); |
1445 TPckg<TUid> uid(aAppUid); |
553 TPckg<TUid> uid(aAppUid); |
1446 return SendReceiveWithReconnect(EAppListServAppForDataType,TIpcArgs(&dataType,&uid)); |
554 return SendReceiveWithReconnect(EAppListServAppForDataType,TIpcArgs(&dataType,&uid)); |
1447 } //lint !e1764 Suppress reference parameter 'aAppUid' could be declared const ref |
555 } //lint !e1764 Suppress reference parameter 'aAppUid' could be declared const ref |
1448 |
|
1449 |
|
1450 /** Finds and launches an application to handle the document contained in the specified |
|
1451 file. |
|
1452 |
|
1453 @param aFileName The document name. |
|
1454 @param aThreadId On return, the id of the main thread started. |
|
1455 @param aLaunchType Not used. Reserved for future use. |
|
1456 @return KErrNone, if successful; EAppListInvalid, if the server's initial population of |
|
1457 the list has not completed; KErrNotFound, if a matching entry could not be found; otherwise |
|
1458 one of the other system-wide error codes. |
|
1459 */ |
|
1460 EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType /*aLaunchType*/) |
|
1461 { |
|
1462 HBufC8* buffer=NULL; |
|
1463 TInt error=GetBufferFromFile(buffer, aFileName); |
|
1464 if (error!=KErrNone) |
|
1465 { |
|
1466 return error; |
|
1467 } |
|
1468 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1469 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1470 HBufC8* opaqueData=NULL; |
|
1471 TIpcArgs ipcArgs; |
|
1472 ipcArgs.Set(2, &aFileName); |
|
1473 ipcArgs.Set(3, buffer); |
|
1474 error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDocument); |
|
1475 if (error!=KErrNone) |
|
1476 { |
|
1477 delete buffer; |
|
1478 return error; |
|
1479 } |
|
1480 error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId, EApaCommandOpen, NULL); |
|
1481 delete opaqueData; |
|
1482 if(error!=KErrNone && error!=KErrCancel) |
|
1483 { |
|
1484 TPckg<TThreadId> threadId(aThreadId); |
|
1485 error = SendReceiveWithReconnect(EAppListServStartDocument,TIpcArgs(&threadId, &aFileName, buffer)); |
|
1486 } |
|
1487 delete buffer; |
|
1488 return error; |
|
1489 } |
|
1490 |
|
1491 EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/) |
|
1492 /** Finds and launches an application to handle the document contained in the specified file |
|
1493 |
|
1494 @param aFile The file handle. Before this function can be called, |
|
1495 the file server session which owns this file handle must first be marked as shareable by |
|
1496 calling RFs::ShareProtected(). |
|
1497 @param aThreadId On return, the id of the main thread started. |
|
1498 @param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() |
|
1499 function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on |
|
1500 the new application process. |
|
1501 @return KErrNone, if successful; KErrNotFound, if no suitable application can |
|
1502 be found; otherwise one of the other system-wide error codes. */ |
|
1503 { |
|
1504 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1505 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1506 HBufC8* opaqueData=NULL; |
|
1507 TIpcArgs ipcArgs; |
|
1508 TInt error=aFile.TransferToServer(ipcArgs, 2, 3); |
|
1509 if (error == KErrNone) |
|
1510 { |
|
1511 error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDocumentPassedByFileHandle); |
|
1512 } |
|
1513 if (error!=KErrNone) |
|
1514 { |
|
1515 return error; |
|
1516 } |
|
1517 error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous); |
|
1518 delete opaqueData; |
|
1519 return error; |
|
1520 } //lint !e1764 Suppress reference parameter could be declared const ref |
|
1521 |
|
1522 |
|
1523 /** Launches an application that can handle the specified data (MIME) type. |
|
1524 |
|
1525 The application handles the document contained in the specified file. |
|
1526 |
|
1527 @param aFileName The document name. |
|
1528 @param aDataType The data (MIME) type. |
|
1529 @param aThreadId On return, the id of the main thread started. |
|
1530 @param aLaunchType Not used. Reserved for future use. |
|
1531 @return KErrNone, if successful; EAppListInvalid if the server's initial population of |
|
1532 the list has not completed; KErrNotFound, if no suitable application can |
|
1533 be found; otherwise one of the other system-wide error codes. |
|
1534 */ |
|
1535 EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType /*aLaunchType*/) |
|
1536 { |
|
1537 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1538 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1539 HBufC8* opaqueData=NULL; |
|
1540 const TPckgC<TDataType> dataType(aDataType); |
|
1541 TIpcArgs ipcArgs; |
|
1542 ipcArgs.Set(2, &dataType); |
|
1543 TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDataType); |
|
1544 if (error!=KErrNone) |
|
1545 { |
|
1546 return error; |
|
1547 } |
|
1548 error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandOpen,NULL); |
|
1549 delete opaqueData; |
|
1550 if(error!=KErrNone && error!=KErrCancel) |
|
1551 { |
|
1552 TPckg<TThreadId> threadId(aThreadId); |
|
1553 error = SendReceiveWithReconnect(EAppListServStartDocumentByDataType,TIpcArgs(&threadId, &aFileName, &dataType)); |
|
1554 } |
|
1555 return error; |
|
1556 } |
|
1557 |
|
1558 EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, const TDataType& aDataType, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/) |
|
1559 /** Finds and launches an application to handle the document contained in the specified file |
|
1560 |
|
1561 @param aFile The file handle. |
|
1562 @param aDataType The data (MIME) type. |
|
1563 @param aThreadId On return, the id of the main thread started. |
|
1564 @param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() |
|
1565 function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on |
|
1566 the new application process. |
|
1567 @return KErrNone, if successful; KErrNotFound, if no suitable application can |
|
1568 be found; otherwise one of the other system-wide error codes. */ |
|
1569 { |
|
1570 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1571 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1572 HBufC8* opaqueData=NULL; |
|
1573 const TPckgC<TDataType> dataType(aDataType); |
|
1574 TIpcArgs ipcArgs; |
|
1575 ipcArgs.Set(2, &dataType); |
|
1576 TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenDataType); |
|
1577 if (error!=KErrNone) |
|
1578 { |
|
1579 return error; |
|
1580 } |
|
1581 error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous); |
|
1582 delete opaqueData; |
|
1583 return error; |
|
1584 } //lint !e1764 Suppress reference parameter could be declared const ref |
|
1585 |
|
1586 EXPORT_C TInt RApaLsSession::StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType) |
|
1587 /** Launches the application identified by the specified UID. |
|
1588 |
|
1589 The application handles the document contained in the specified file. |
|
1590 |
|
1591 @param aFileName The document name. |
|
1592 @param aAppUid The application specific UID. |
|
1593 @param aThreadId On return, the id of the main thread started. |
|
1594 @param aLaunchType Not used. Reserved for future use. |
|
1595 @return KErrNone, if successful; EAppListInvalid if the server's initial population of |
|
1596 the list has not completed; KErrNotFound, if no suitable application can |
|
1597 be found; otherwise one of the other system-wide error codes. */ |
|
1598 { |
|
1599 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1600 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1601 HBufC8* opaqueData=NULL; |
|
1602 TIpcArgs ipcArgs; |
|
1603 ipcArgs.Set(2, aAppUid.iUid); |
|
1604 TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid); |
|
1605 if (error!=KErrNone) |
|
1606 { |
|
1607 return error; |
|
1608 } |
|
1609 error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandOpen,NULL); |
|
1610 delete opaqueData; |
|
1611 if(error!=KErrNone && error!=KErrCancel) |
|
1612 { |
|
1613 error = StartAndCreate(EAppListServStartDocumentByUid,aFileName,aAppUid,aThreadId,aLaunchType); |
|
1614 } |
|
1615 return error; |
|
1616 } |
|
1617 |
|
1618 EXPORT_C TInt RApaLsSession::StartDocument(RFile& aFile, TUid aAppUid, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous/*=NULL*/) |
|
1619 /** Finds and launches an application to handle the document contained in the specified file |
|
1620 |
|
1621 @param aFile The file handle. |
|
1622 @param aAppUid The application specific UID. |
|
1623 @param aThreadId On return, the id of the main thread started. |
|
1624 @param aRequestStatusForRendezvous If not NULL, the asynchronous RProcess::Rendezvous() |
|
1625 function is called (being passed this TRequestStatus object) before RProcess::Resume() is called on |
|
1626 the new application process. |
|
1627 @return KErrNone, if successful; KErrNotFound, if no suitable application can |
|
1628 be found; otherwise one of the other system-wide error codes. */ |
|
1629 { |
|
1630 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1631 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1632 HBufC8* opaqueData=NULL; |
|
1633 TIpcArgs ipcArgs; |
|
1634 ipcArgs.Set(2, aAppUid.iUid); |
|
1635 TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid); |
|
1636 if (error!=KErrNone) |
|
1637 { |
|
1638 return error; |
|
1639 } |
|
1640 error=StartApplicationPassingFileHandle(nativeExecutableName, logicalExecutableName, opaqueData, aFile, aThreadId, aRequestStatusForRendezvous); |
|
1641 delete opaqueData; |
|
1642 return error; |
|
1643 } //lint !e1764 Suppress reference parameter could be declared const ref |
|
1644 |
|
1645 |
|
1646 /** Launches the application identified by the specified UID and creates a new document. |
|
1647 |
|
1648 To create a document file with the passed document name, the application needs to override the 3-parameter |
|
1649 overload of ProcessCommandParametersL() to call the 2-parameter overload. |
|
1650 |
|
1651 Otherwise, a document will be created with the default document name present in the application resource file. |
|
1652 If default document name is empty or not provided, no document is created. |
|
1653 |
|
1654 If the application resource file is not present, a document with application caption name is created. |
|
1655 |
|
1656 @param aFileName The document name. |
|
1657 @param aAppUid The application specific UID. |
|
1658 @param aThreadId On return, the id of the main thread started. |
|
1659 @param aLaunchType Not used. Reserved for future use. |
|
1660 @return KErrNone, if successful; EAppListInvalid if the server's initial population of |
|
1661 the list has not completed; KErrNotFound, if no suitable application can |
|
1662 be found; otherwise one of the other system-wide error codes. |
|
1663 @see CEikAppUi::ProcessCommandParametersL(). |
|
1664 */ |
|
1665 EXPORT_C TInt RApaLsSession::CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType) |
|
1666 { |
|
1667 TFileName nativeExecutableName; // the name of the EXE that we pass to RProcess::Create |
|
1668 TFileName logicalExecutableName; // the name of the MIDlet, Python script, etc |
|
1669 HBufC8* opaqueData=NULL; |
|
1670 TIpcArgs ipcArgs; |
|
1671 ipcArgs.Set(2, aAppUid.iUid); |
|
1672 TInt error=GetExecutableName(nativeExecutableName, logicalExecutableName, opaqueData, ipcArgs, EAppListServGetExecutableNameGivenAppUid); |
|
1673 if (error!=KErrNone) |
|
1674 { |
|
1675 return error; |
|
1676 } |
|
1677 error = StartApplicationPassingDocumentName(nativeExecutableName, logicalExecutableName, opaqueData, aFileName, aThreadId,EApaCommandCreate,NULL); |
|
1678 delete opaqueData; |
|
1679 if(error!=KErrNone && error!=KErrCancel) |
|
1680 { |
|
1681 error = StartAndCreate(EAppListServCreateDocumentByUid,aFileName,aAppUid,aThreadId,aLaunchType); |
|
1682 } |
|
1683 return error; |
|
1684 } |
|
1685 |
|
1686 TInt RApaLsSession::StartAndCreate(TInt aRqst,const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType /*aLaunchType*/) |
|
1687 { |
|
1688 TPckg<TThreadId> threadId(aThreadId); |
|
1689 return SendReceiveWithReconnect(aRqst,TIpcArgs(&threadId, &aFileName, aAppUid.iUid)); |
|
1690 } //lint !e1762 !e1764 |
|
1691 //Suppress reference parameter 'aThreadId' could be declared const ref |
|
1692 //Suppress member function could be made const |
|
1693 |
|
1694 |
|
1695 |
556 |
1696 |
557 |
1697 /** Gets the available icon sizes for the application with the specified UID. |
558 /** Gets the available icon sizes for the application with the specified UID. |
1698 |
559 |
1699 @param aAppUid The application specific UID. |
560 @param aAppUid The application specific UID. |
1703 be found; KErrNotSupported, if the application provides icons in non-MBM format; |
564 be found; KErrNotSupported, if the application provides icons in non-MBM format; |
1704 otherwise one of the other system wide error codes. |
565 otherwise one of the other system wide error codes. |
1705 */ |
566 */ |
1706 EXPORT_C TInt RApaLsSession::GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const |
567 EXPORT_C TInt RApaLsSession::GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const |
1707 { |
568 { |
1708 TRAPD(error,DoGetAppIconSizesL(aAppUid,aArrayToFill)); |
569 TRAPD(error, DoGetAppIconSizesL(aAppUid,aArrayToFill)); |
1709 return error; |
570 return error; |
1710 } |
|
1711 |
|
1712 void RApaLsSession::FetchArrayL(MArrayFiller& aArrayFiller,TUid aAppUid, TInt aOpcode, TInt aInitialBufSize) const |
|
1713 { |
|
1714 CBufFlat* buffer=CBufFlat::NewL(aInitialBufSize); |
|
1715 CleanupStack::PushL(buffer); |
|
1716 buffer->ExpandL(0,aInitialBufSize); |
|
1717 TPtr8 bufPtr=buffer->Ptr(0); |
|
1718 const TInt sizeRequired=User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aAppUid.iUid,buffer->Size(),&bufPtr))); |
|
1719 if (sizeRequired>0) |
|
1720 { |
|
1721 __ASSERT_DEBUG(sizeRequired>buffer->Size(),User::Invariant()); |
|
1722 CleanupStack::PopAndDestroy(buffer); |
|
1723 buffer=CBufFlat::NewL(sizeRequired); |
|
1724 CleanupStack::PushL(buffer); |
|
1725 buffer->ExpandL(0,sizeRequired); |
|
1726 bufPtr.Set(buffer->Ptr(0)); |
|
1727 #if defined(_DEBUG) |
|
1728 const TInt check= |
|
1729 #endif |
|
1730 User::LeaveIfError(SendReceiveWithReconnect(aOpcode,TIpcArgs(aAppUid.iUid,buffer->Size(),&bufPtr))); |
|
1731 __ASSERT_DEBUG(check==0,User::Invariant()); |
|
1732 } |
|
1733 RBufReadStream readStream; |
|
1734 readStream.Open(*buffer); |
|
1735 const TInt count=readStream.ReadUint32L(); |
|
1736 for (TInt i=0; i<count; ++i) |
|
1737 { |
|
1738 aArrayFiller.AppendItemL(readStream); |
|
1739 } |
|
1740 CleanupStack::PopAndDestroy(buffer); |
|
1741 } |
571 } |
1742 |
572 |
1743 void RApaLsSession::DoGetAppIconSizesL(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const |
573 void RApaLsSession::DoGetAppIconSizesL(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const |
1744 { |
574 { |
1745 TSizeArrayFiller arrayFiller(aArrayToFill); |
575 TSizeArrayFiller arrayFiller(aArrayToFill); |
1746 FetchArrayL(arrayFiller, aAppUid, EAppListServGetAppIconSizes, KInitialIconBufSize); |
576 FetchArrayL(arrayFiller, aAppUid, EAppListServGetAppIconSizes, KInitialIconBufSize); |
1747 } |
577 } |
1748 |
578 |
|
579 /** |
|
580 This method implementes a generic mechanism for retrieving data items from the AppArc server. |
|
581 The data items can be either TSize, TApaAppViewInfo, or TDesC (see MArrayFiller). |
|
582 @internalTechnology |
|
583 */ |
|
584 void RApaLsSession::FetchArrayL(MArrayFiller& aArray, TUid aAppUid, TInt aOpcode, TInt aInitialBufSize) const |
|
585 { |
|
586 // Create a buffer to recieve the data in |
|
587 CBufFlat* buffer = CBufFlat::NewL(aInitialBufSize); |
|
588 CleanupStack::PushL(buffer); |
|
589 |
|
590 // Set its size and create a pointer for writing to it |
|
591 buffer->ExpandL(0,aInitialBufSize); |
|
592 TPtr8 bufPtr = buffer->Ptr(0); |
|
593 |
|
594 // Get the data from the AppArc server |
|
595 |
|
596 const TInt sizeRequired = SendReceiveWithReconnect(aOpcode,TIpcArgs(aAppUid.iUid,buffer->Size(),&bufPtr)); |
|
597 User::LeaveIfError(sizeRequired); // Negative values are error codes |
|
598 if (sizeRequired > 0) // If the initial buffer was too small... |
|
599 { |
|
600 // (This should really never happen - the code below is a backup for release builds only |
|
601 ASSERT(0); // so panic any debug builds) |
|
602 |
|
603 // ...create a bigger one and try again |
|
604 CleanupStack::PopAndDestroy(buffer); |
|
605 buffer = CBufFlat::NewL(sizeRequired); |
|
606 CleanupStack::PushL(buffer); |
|
607 buffer->ExpandL(0, sizeRequired); |
|
608 bufPtr.Set(buffer->Ptr(0)); |
|
609 User::LeaveIfError(SendReceiveWithReconnect(aOpcode, TIpcArgs(aAppUid.iUid, buffer->Size(), &bufPtr))); |
|
610 } |
|
611 |
|
612 // Create a read stream for reading from the buffer |
|
613 RBufReadStream readStream; |
|
614 CleanupClosePushL(readStream); |
|
615 readStream.Open(*buffer); |
|
616 |
|
617 // Get the item count from the stream and popoulate the array |
|
618 const TInt count = readStream.ReadUint32L(); |
|
619 for (TInt i = 0; i < count; ++i) |
|
620 aArray.AppendItemFromStreamL(readStream); |
|
621 |
|
622 CleanupStack::PopAndDestroy(&readStream); |
|
623 CleanupStack::PopAndDestroy(buffer); |
|
624 } |
1749 |
625 |
1750 |
626 |
1751 /** Gets the nearest matching application icon for the application with the specified |
627 /** Gets the nearest matching application icon for the application with the specified |
1752 UID. |
628 UID. |
1753 |
629 |
2627 return DoAppForDocumentOptionallySpecifyingService(aFile, aServiceUid, aAppUid, aDataType, EAppListServAppForDocumentAndServicePassedByFileHandle); |
1424 return DoAppForDocumentOptionallySpecifyingService(aFile, aServiceUid, aAppUid, aDataType, EAppListServAppForDocumentAndServicePassedByFileHandle); |
2628 } |
1425 } |
2629 |
1426 |
2630 TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const |
1427 TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const |
2631 { |
1428 { |
2632 if (aFileName.Length()==0) |
1429 if (!aFileName.Length()) |
2633 { |
1430 { |
2634 aAppUid = KNullUid; |
1431 aAppUid = KNullUid; |
2635 return KErrNone; |
1432 return KErrNone; |
2636 } |
1433 } |
2637 HBufC8* buffer=NULL; |
1434 |
2638 TInt error=GetBufferFromFile(buffer, aFileName); |
1435 HBufC8* buffer = NULL; |
2639 if (error!=KErrNone) |
1436 TInt error = GetNewBufferFromFile(buffer, aFileName); |
2640 { |
1437 if (error) |
2641 return error; |
1438 return error; |
2642 } |
1439 |
2643 SReturnData_AppForDocument returnData; |
1440 SReturnData_AppForDocument returnData; |
2644 TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData); |
1441 TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData); |
2645 error=SendReceiveWithReconnect(aOpcode,TIpcArgs(&returnData_asDescriptor, aServiceUid.iUid, &aFileName, buffer)); |
1442 error = SendReceiveWithReconnect(aOpcode, TIpcArgs(&returnData_asDescriptor, aServiceUid.iUid, &aFileName, buffer)); |
2646 delete buffer; |
1443 delete buffer; |
2647 buffer=NULL; |
1444 buffer = NULL; |
2648 if (error==KErrNone) |
1445 |
|
1446 if (!error) |
2649 { |
1447 { |
2650 aAppUid=returnData.iUid; |
1448 aAppUid = returnData.iUid; |
2651 aDataType=returnData.iDataType; |
1449 aDataType = returnData.iDataType; |
2652 } |
1450 } |
|
1451 |
2653 return error; |
1452 return error; |
2654 } |
1453 } |
2655 |
1454 |
|
1455 /** |
|
1456 */ |
2656 TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const |
1457 TInt RApaLsSession::DoAppForDocumentOptionallySpecifyingService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const |
2657 { |
1458 { |
2658 SReturnData_AppForDocument returnData; |
1459 SReturnData_AppForDocument returnData; |
2659 TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData); |
1460 TPckg<SReturnData_AppForDocument> returnData_asDescriptor(returnData); |
2660 TIpcArgs ipcArgs(&returnData_asDescriptor, aServiceUid.iUid); |
1461 TIpcArgs ipcArgs(&returnData_asDescriptor, aServiceUid.iUid); |
2661 TInt error=aFile.TransferToServer(ipcArgs, 2, 3); |
1462 TInt error = aFile.TransferToServer(ipcArgs, 2, 3); |
2662 if (error == KErrNone) |
1463 if (!error) |
|
1464 error = SendReceiveWithReconnect(aOpcode, ipcArgs); |
|
1465 |
|
1466 if (!error) |
2663 { |
1467 { |
2664 error=SendReceiveWithReconnect(aOpcode, ipcArgs); |
1468 aAppUid = returnData.iUid; |
|
1469 aDataType = returnData.iDataType; |
2665 } |
1470 } |
2666 if (error==KErrNone) |
1471 |
|
1472 return error; |
|
1473 } |
|
1474 |
|
1475 /** |
|
1476 */ |
|
1477 TInt RApaLsSession::GetNewBufferFromFile(HBufC8*& aBuffer, const TDesC& aFileName) const |
|
1478 { |
|
1479 aBuffer = NULL; |
|
1480 TInt preferredBufSize = 0; |
|
1481 const TInt error = GetPreferredBufSize(preferredBufSize); |
|
1482 if (error < KErrNone) |
|
1483 return error; |
|
1484 |
|
1485 HBufC8* const buffer = HBufC8::New(Max(8, preferredBufSize)); // 8 is a sensible minimum |
|
1486 if (!buffer) |
|
1487 return KErrNoMemory; |
|
1488 |
|
1489 const RFs* fsSession = FsSession(); |
|
1490 RFs tempFsSession; |
|
1491 if (!fsSession) |
2667 { |
1492 { |
2668 aAppUid=returnData.iUid; |
1493 const TInt error = tempFsSession.Connect(); |
2669 aDataType=returnData.iDataType; |
1494 if (error) |
2670 } |
|
2671 return error; |
|
2672 } |
|
2673 |
|
2674 TInt RApaLsSession::GetBufferFromFile(HBufC8*& aBuffer, const TDesC& aFileName) const |
|
2675 { |
|
2676 TInt preferredBufSize=0; |
|
2677 const TInt error=GetPreferredBufSize(preferredBufSize); |
|
2678 if (error<KErrNone) |
|
2679 { |
|
2680 return error; |
|
2681 } |
|
2682 HBufC8* const buffer=HBufC8::New(Max(8, preferredBufSize)); // 8 is a sensible minimum |
|
2683 if (buffer==NULL) |
|
2684 { |
|
2685 return KErrNoMemory; |
|
2686 } |
|
2687 const RFs* fsSession=FsSession(); |
|
2688 RFs tempFsSession; |
|
2689 if (fsSession==NULL) |
|
2690 { |
|
2691 const TInt error=tempFsSession.Connect(); |
|
2692 if (error!=KErrNone) |
|
2693 { |
1495 { |
2694 delete buffer; |
1496 delete buffer; |
2695 return error; |
1497 return error; |
2696 } |
1498 } |
2697 fsSession=&tempFsSession; |
1499 |
|
1500 fsSession = &tempFsSession; |
2698 } |
1501 } |
|
1502 |
2699 if (fsSession->IsValidName(aFileName)) |
1503 if (fsSession->IsValidName(aFileName)) |
2700 { |
1504 { |
2701 TPtr8 buffer_asWritable(buffer->Des()); |
1505 TPtr8 buffer_asWritable(buffer->Des()); |
2702 const TInt error=fsSession->ReadFileSection(aFileName, 0, buffer_asWritable, preferredBufSize); |
1506 const TInt error = fsSession->ReadFileSection(aFileName, 0, buffer_asWritable, preferredBufSize); |
2703 if (error!=KErrNone) |
1507 if (error) |
2704 { |
1508 { |
2705 delete buffer; |
1509 delete buffer; |
2706 tempFsSession.Close(); |
1510 tempFsSession.Close(); |
2707 return error; |
1511 return error; |
2708 } |
1512 } |
2709 } |
1513 } |
2710 if (fsSession==&tempFsSession) |
1514 |
2711 { |
1515 if (fsSession == &tempFsSession) |
2712 tempFsSession.Close(); |
1516 tempFsSession.Close(); |
2713 } |
1517 |
2714 aBuffer=buffer; |
1518 aBuffer = buffer; |
2715 return KErrNone; |
1519 return KErrNone; |
2716 } |
1520 } |
2717 |
1521 |
2718 EXPORT_C void RApaLsSession::SetFsSessionL(RFs& aFsSession) |
1522 |
2719 /** |
1523 /** |
2720 @internalTechnology |
1524 @internalTechnology |
2721 */ |
1525 */ |
|
1526 EXPORT_C void RApaLsSession::SetFsSessionL(RFs& aFsSession) |
2722 { // static |
1527 { // static |
2723 User::LeaveIfError(Dll::SetTls(&aFsSession)); |
1528 User::LeaveIfError(Dll::SetTls(&aFsSession)); |
2724 } |
1529 } |
2725 |
1530 |
2726 EXPORT_C void RApaLsSession::ClearFsSession() |
|
2727 /** |
1531 /** |
2728 @internalTechnology |
1532 @internalTechnology |
2729 */ |
1533 */ |
|
1534 EXPORT_C void RApaLsSession::ClearFsSession() |
2730 { // static |
1535 { // static |
2731 Dll::FreeTls(); |
1536 Dll::FreeTls(); |
2732 } |
1537 } |
2733 |
1538 |
|
1539 /** |
|
1540 @internalTechnology |
|
1541 */ |
2734 EXPORT_C RFs* RApaLsSession::FsSession() |
1542 EXPORT_C RFs* RApaLsSession::FsSession() |
2735 /** |
|
2736 @internalComponent |
|
2737 */ |
|
2738 { // static |
1543 { // static |
2739 return static_cast<RFs*>(Dll::Tls()); |
1544 return static_cast<RFs*>(Dll::Tls()); |
2740 } |
1545 } |
2741 |
1546 |
2742 /** @publishedPartner */ |
1547 /** @publishedPartner */ |
2952 { |
1763 { |
2953 TDesCArrayFiller arrayFiller(aArrayToFill); |
1764 TDesCArrayFiller arrayFiller(aArrayToFill); |
2954 FetchArrayL(arrayFiller, aAppUid, EAppListServGetFileOwnershipInfo, KInitialOwnedFilesBufSize); |
1765 FetchArrayL(arrayFiller, aAppUid, EAppListServGetFileOwnershipInfo, KInitialOwnedFilesBufSize); |
2955 } |
1766 } |
2956 |
1767 |
2957 EXPORT_C void RApaLsSession::RegisterListPopulationCompleteObserver(TRequestStatus& aStatus) const |
1768 |
2958 /** Registers an observer with apparc server to notify when the initial population of applist is completed |
1769 /** Registers an observer with apparc server to notify when the initial population of applist is completed |
2959 |
1770 |
2960 @param aStatus Request status object. On successful completion contains KErrNone, otherwise one of the |
1771 @param aStatus Request status object. On successful completion contains KErrNone, otherwise one of the |
2961 system-wide error codes. |
1772 system-wide error codes. |
2962 @see CancelListPopulationCompleteObserver() |
1773 @see CancelListPopulationCompleteObserver() |
2963 */ |
1774 */ |
|
1775 EXPORT_C void RApaLsSession::RegisterListPopulationCompleteObserver(TRequestStatus& aStatus) const |
2964 { |
1776 { |
2965 SendReceive(ERegisterListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing),aStatus); |
1777 SendReceive(ERegisterListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing),aStatus); |
2966 } |
1778 } |
2967 |
1779 |
2968 EXPORT_C TInt RApaLsSession::CancelListPopulationCompleteObserver() const |
1780 |
2969 /** Cancels the observer registered with apparc server to notify when the initial population of applist is completed |
1781 /** Cancels the observer registered with apparc server to notify when the initial population of applist is completed |
2970 |
1782 |
2971 @return KErrNone, if successful; otherwise one of the system-wide error codes. |
1783 @return KErrNone, if successful; otherwise one of the system-wide error codes. |
2972 */ |
1784 */ |
|
1785 EXPORT_C TInt RApaLsSession::CancelListPopulationCompleteObserver() const |
2973 { |
1786 { |
2974 return SendReceiveWithReconnect(ECancelListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing)); |
1787 return SendReceiveWithReconnect(ECancelListPopulationCompleteObserver,TIpcArgs(TIpcArgs::ENothing)); |
2975 } |
1788 } |
2976 |
1789 |
2977 EXPORT_C TInt RApaLsSession::MatchesSecurityPolicy(TBool& aMatches, TUid aAppUid, const TSecurityPolicy& aSecurityPolicy) const |
1790 |
2978 /** Tests whether the given TSecurityPolicy matches with the application TSecurityPolicy. |
1791 /** Tests whether the given TSecurityPolicy matches with the application TSecurityPolicy. |
2979 |
1792 |
2980 @param aMatches On return, contains the result. ETrue if the application TSecurityPolicy matches the given TSecurityPolicy or else EFalse |
1793 @param aMatches On return, contains the result. ETrue if the application TSecurityPolicy matches the given TSecurityPolicy or else EFalse |
2981 @param aAppUid Uid of the application for which the security policy has to be matched |
1794 @param aAppUid Uid of the application for which the security policy has to be matched |
2982 @param aSecurityPolicy TSecurityPolicy to test whether the application with given uid matches with its TSecurityPolicy or not. |
1795 @param aSecurityPolicy TSecurityPolicy to test whether the application with given uid matches with its TSecurityPolicy or not. |
2983 @return KErrNone, if successful; otherwise one of the other system-wide error codes. |
1796 @return KErrNone, if successful; otherwise one of the other system-wide error codes. |
2984 @see TSecurityPolicy |
1797 @see TSecurityPolicy |
2985 */ |
1798 */ |
|
1799 EXPORT_C TInt RApaLsSession::MatchesSecurityPolicy(TBool& aMatches, TUid aAppUid, const TSecurityPolicy& aSecurityPolicy) const |
2986 { |
1800 { |
2987 const TPckgC<TSecurityPolicy> securityPolicy(aSecurityPolicy); |
1801 const TPckgC<TSecurityPolicy> securityPolicy(aSecurityPolicy); |
2988 const TInt result = SendReceiveWithReconnect(EMatchesSecurityPolicy,TIpcArgs(aAppUid.iUid, &securityPolicy)); |
1802 const TInt result = SendReceiveWithReconnect(EMatchesSecurityPolicy,TIpcArgs(aAppUid.iUid, &securityPolicy)); |
2989 |
1803 |
2990 if (result>=0) |
1804 if (result>=0) |
2991 { |
|
2992 aMatches = result; |
1805 aMatches = result; |
2993 } |
1806 |
2994 return result; |
1807 return result; |
2995 } |
1808 } |
2996 |
1809 |
|
1810 |
2997 EXPORT_C void RApaLsSession::RApaLsSession_Reserved1() |
1811 EXPORT_C void RApaLsSession::RApaLsSession_Reserved1() |
2998 { |
1812 { |
2999 } |
1813 } |
3000 |
1814 |
3001 EXPORT_C void RApaLsSession::RApaLsSession_Reserved2() |
1815 EXPORT_C void RApaLsSession::RApaLsSession_Reserved2() |
3002 { |
1816 { |
3003 } |
1817 } |
3004 |
1818 |
3005 EXPORT_C void RApaLsSession::NotifyOnDataMappingChange(TRequestStatus& aRequestStatus) |
1819 |
3006 /** Notification of changes in data-type mapping |
1820 /** Notification of changes in data-type mapping |
3007 |
1821 |
3008 This asynchronous function (whose corresponding "cancel" operation is CancelNotifyOnDataTypeMappingChange) completes when any data-type / application-UID association changes, i.e. when the default application handling a particular MIME-type changes. |
1822 This asynchronous function (whose corresponding "cancel" operation is CancelNotifyOnDataTypeMappingChange) completes when any data-type / application-UID association changes, i.e. when the default application handling a particular MIME-type changes. |
3009 |
1823 |
3010 @param aRequestStatus As is normal for an asynchronous operation, this object is set to something other than KRequestPending when the asynchronous operation that has been triggered by this function completes. |
1824 @param aRequestStatus As is normal for an asynchronous operation, this object is set to something other than KRequestPending when the asynchronous operation that has been triggered by this function completes. |
3011 @see CancelNotifyOnDataTypeMappingChange |
1825 @see CancelNotifyOnDataTypeMappingChange |
3012 */ |
1826 */ |
|
1827 EXPORT_C void RApaLsSession::NotifyOnDataMappingChange(TRequestStatus& aRequestStatus) |
3013 { |
1828 { |
3014 SendReceive(ENotifyOnDataMappingChange,TIpcArgs(), aRequestStatus); |
1829 SendReceive(ENotifyOnDataMappingChange,TIpcArgs(), aRequestStatus); |
3015 } //lint !e1762 Suppress member function could be made const |
1830 } //lint !e1762 Suppress member function could be made const |
|
1831 |
3016 |
1832 |
3017 EXPORT_C void RApaLsSession::CancelNotifyOnDataMappingChange() |
|
3018 /** Cancellation of notification of changes in data-type mapping |
1833 /** Cancellation of notification of changes in data-type mapping |
3019 |
1834 |
3020 This cancels the outstanding the NotifyOnDataTypeMappingChange issued by this client, if there is one outstanding. Otherwise it does nothing. |
1835 This cancels the outstanding the NotifyOnDataTypeMappingChange issued by this client, if there is one outstanding. Otherwise it does nothing. |
3021 @see NotifyOnDataTypeMappingChange |
1836 @see NotifyOnDataTypeMappingChange |
3022 */ |
1837 */ |
|
1838 EXPORT_C void RApaLsSession::CancelNotifyOnDataMappingChange() |
3023 { |
1839 { |
3024 SendReceive(ECancelNotifyOnDataMappingChange,TIpcArgs()); |
1840 SendReceive(ECancelNotifyOnDataMappingChange,TIpcArgs()); |
3025 } //lint !e1762 Suppress member function could be made const |
1841 } //lint !e1762 Suppress member function could be made const |
|
1842 |
3026 |
1843 |
3027 CBufFlat* RApaLsSession::CreateRegFilesBufferL(const RPointerArray<TDesC>& aRegFiles) |
1844 CBufFlat* RApaLsSession::CreateRegFilesBufferL(const RPointerArray<TDesC>& aRegFiles) |
3028 { |
1845 { |
3029 // Serialize the array |
1846 // Serialize the array |
3030 // Format of the buffer is : |
1847 // Format of the buffer is : |