author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 22 | fc9cf246af83 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: This Class provides the core functionality to Media Management |
|
15 |
* SAPI Interafce |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
21 |
#include <MCLFItemListModel.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
22 |
#include <MCLFContentListingEngine.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
23 |
#include <ContentListingFactory.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
24 |
#include <MCLFSortingStyle.h> |
19 | 25 |
|
26 |
||
27 |
#include "mgservice.h" |
|
28 |
#include "mgpostfilter.h" |
|
29 |
#include "mgoperationobserver.h" |
|
30 |
#include "mgclfoperationobserver.h" |
|
31 |
#include "mgconsts.h" |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
32 |
#include"asynchrequestmanager.h" |
19 | 33 |
|
34 |
// Inclusion for thumbnail generation |
|
35 |
||
36 |
#include"mgthumbnailgeneration.h" |
|
37 |
#include"mgthumbobserver.h" |
|
38 |
||
39 |
//Media types. |
|
40 |
_LIT8( KMgMusic ,"Music" ); |
|
41 |
_LIT8( KMgSound ,"Sound" ); |
|
42 |
_LIT8( KMgImage ,"Image" ); |
|
43 |
_LIT8( KMgVideo ,"Video" ); |
|
44 |
_LIT8( KMgStreamingURL ,"StreamingURL" ); |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
45 |
_LIT8(KAudio,"Audio"); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
46 |
_LIT8(KAll,"All"); |
19 | 47 |
|
48 |
//SortingOrder |
|
49 |
_LIT8( KMgDescending, "Descending" ); |
|
50 |
//_LIT8( KMgAscending, "Ascending" ); |
|
51 |
||
52 |
||
53 |
||
54 |
// ----------------------------------------------------------------------------- |
|
55 |
// CMgService::NewLC |
|
56 |
// Returns the instance of CMgService class. |
|
57 |
// ----------------------------------------------------------------------------- |
|
58 |
EXPORT_C CMgService* CMgService::NewL() |
|
59 |
{ |
|
60 |
CMgService* self = new ( ELeave )CMgService(); |
|
61 |
CleanupStack::PushL( self ); |
|
62 |
self->ConstructL(); |
|
63 |
CleanupStack::Pop( self ); |
|
64 |
return self; |
|
65 |
} |
|
66 |
// ----------------------------------------------------------------------------- |
|
67 |
// CMgService::~CMgService |
|
68 |
// Destructor |
|
69 |
// ----------------------------------------------------------------------------- |
|
70 |
||
71 |
CMgService::~CMgService() |
|
72 |
{ |
|
73 |
||
74 |
//release filter class |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
75 |
/* if(iFilter) |
19 | 76 |
{ |
77 |
delete iFilter; |
|
78 |
} |
|
79 |
||
80 |
// release sorting style |
|
81 |
if(iSortingStyle) |
|
82 |
{ |
|
83 |
delete iSortingStyle; |
|
84 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
85 |
*/ |
19 | 86 |
// release clf observer class |
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
87 |
/* if(iClfObserver) |
19 | 88 |
{ |
89 |
delete iClfObserver; |
|
90 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
91 |
*/ |
19 | 92 |
//release iEngine; |
93 |
if(iEngine) |
|
94 |
{ |
|
95 |
delete iEngine; |
|
96 |
} |
|
97 |
||
98 |
// releasing iTumbnailGeneration |
|
99 |
if(iTumbnailGeneration) |
|
100 |
{ |
|
101 |
delete iTumbnailGeneration; |
|
102 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
103 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
104 |
// deleting the instance of iAsyncRequestManager |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
105 |
if(iAsyncRequestManager) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
106 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
107 |
delete iAsyncRequestManager; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
108 |
} |
19 | 109 |
|
110 |
} |
|
111 |
||
112 |
||
113 |
||
114 |
||
115 |
// ----------------------------------------------------------------------------- |
|
116 |
// CMgService::GetFiles |
|
117 |
// This function extracts all media item that match the given arguments |
|
118 |
// ----------------------------------------------------------------------------- |
|
119 |
||
120 |
EXPORT_C void CMgService::GetListL(const TMgServiceRequest& aInParameters, |
|
121 |
MMgOperationObserver* aServiceObserver) |
|
122 |
{ |
|
123 |
||
124 |
//Check if the class is busy or waiting for asynchronous request |
|
125 |
//This has already been verified by SAPI interface class ,still this condition |
|
126 |
//is checked keeping in mind that this class may be called directly by a |
|
127 |
//Series60 application in future |
|
128 |
if( NULL != aServiceObserver )//Asynchronous request |
|
129 |
{ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
130 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
131 |
//create the instance of clf observer |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
132 |
CClfOperationObserver* clfObserver = CClfOperationObserver::NewL(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
133 |
CleanupStack::PushL(clfObserver); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
134 |
|
19 | 135 |
// create the instance of CLF list Model for the current request |
136 |
MCLFItemListModel* listModel = iEngine-> |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
137 |
CreateListModelLC( *clfObserver ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
138 |
// CleanupStack::Pop(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
139 |
// CleanupStack::PushL(listModel); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
140 |
// adding observer to asynrequestmanager |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
141 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
142 |
//iAsyncRequestManager->AddObserverL(clfObserver,aInParameters.iTransactionID); |
19 | 143 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
144 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
145 |
// We need to make post filter and sorting style each for each call |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
146 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
147 |
// create the instance of CPostFilter and store it in member data |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
148 |
CPostFilter* filter = CPostFilter::NewL(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
149 |
CleanupStack::PushL(filter); |
19 | 150 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
151 |
// Get the sorting style from CLF |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
152 |
MCLFSortingStyle* sortingStyle = ContentListingFactory::NewSortingStyleLC(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
153 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
154 |
|
19 | 155 |
|
156 |
SendRequestToClfL( aInParameters.iFileType, |
|
157 |
aInParameters.iFilterField, |
|
158 |
aInParameters.iStartVal, |
|
159 |
aInParameters.iEndVal, |
|
160 |
aInParameters.iSortField, |
|
161 |
aInParameters.iOrder, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
162 |
listModel,filter,sortingStyle ); |
19 | 163 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
164 |
CleanupStack::Pop();//sortingStyle |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
165 |
CleanupStack::Pop(filter); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
166 |
CleanupStack::Pop(); //listModel |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
167 |
CleanupStack::Pop(clfObserver); //clfObserver |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
168 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
169 |
iAsyncRequestManager->AddObserverL(clfObserver,aInParameters.iTransactionID); |
19 | 170 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
171 |
// Adding aServiceObserver, listmodel instance , filter and sorting instance to observer |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
172 |
clfObserver->SetMemberVar( aInParameters.iTransactionID, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
173 |
aServiceObserver, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
174 |
listModel, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
175 |
this ,iAsyncRequestManager, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
176 |
filter,sortingStyle ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
177 |
|
19 | 178 |
|
179 |
} |
|
180 |
else |
|
181 |
{ |
|
182 |
//Synchronous request handling is currently not supported |
|
183 |
User::Leave( KErrNotSupported ); |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
184 |
} |
19 | 185 |
} |
186 |
||
187 |
||
188 |
// ----------------------------------------------------------------------------- |
|
189 |
// CMgService::Cancel |
|
190 |
// Cancel the pending asynchronous request |
|
191 |
// ----------------------------------------------------------------------------- |
|
192 |
EXPORT_C TInt CMgService::CancelL( TUint aTransactionID) |
|
193 |
{ |
|
194 |
// call cancel of CLF |
|
195 |
// Right now we are not supporting aTransactionID |
|
196 |
// but in future we have to find the iClfObserver |
|
197 |
// coresponding to this Transaction ID and Call cancel |
|
198 |
// on that observer |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
199 |
/* if( EMgBusy == iState ) |
19 | 200 |
{ |
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
201 |
// Need to change the implementation of cancel here LOK |
19 | 202 |
if( aTransactionID == iTransactionID ) |
203 |
{ |
|
204 |
iClfObserver->CancelL( ); |
|
205 |
Clear(); |
|
206 |
return KErrNone; |
|
207 |
} |
|
208 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
209 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
210 |
TInt ret = KErrNone; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
211 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
212 |
ret = iAsyncRequestManager->Cancel(aTransactionID); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
213 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
214 |
if(KErrNotFound == ret ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
215 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
216 |
// Cancel request if for thumbnail |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
217 |
ret = CancelThumbnailReq(aTransactionID); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
218 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
219 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
220 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
221 |
return ret ; |
19 | 222 |
// Calling cancel of thumbnail |
223 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
224 |
/*if(aTransactionID != iTransactionID) // Need to check this condion LOK |
19 | 225 |
{ |
226 |
return CancelThumbnailReq(aTransactionID); |
|
227 |
} |
|
228 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
229 |
return KErrArgument;*/ |
19 | 230 |
|
231 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
232 |
|
19 | 233 |
// ----------------------------------------------------------------------------- |
234 |
// CMgService::CancelThumbnailReq |
|
235 |
// Cancel the pending asynchronous request for thumbnail generation |
|
236 |
// ----------------------------------------------------------------------------- |
|
237 |
TInt CMgService::CancelThumbnailReq( TUint aTransactionID ) |
|
238 |
{ |
|
239 |
return iTumbnailGeneration->Cancel(aTransactionID); |
|
240 |
} |
|
241 |
// ----------------------------------------------------------------------------- |
|
242 |
// CMgService::Clear |
|
243 |
// It will clear the set filter metadata field ,registered callback |
|
244 |
// function and sorting fields |
|
245 |
// ----------------------------------------------------------------------------- |
|
246 |
||
247 |
void CMgService::Clear() |
|
248 |
{ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
249 |
//iFilter->Clear(); |
19 | 250 |
iState = EMgFree; |
251 |
iTransactionID = 0; |
|
252 |
} |
|
253 |
||
254 |
||
255 |
||
256 |
||
257 |
// ----------------------------------------------------------------------------- |
|
258 |
// CMgService::State |
|
259 |
// It will return the state of service class. |
|
260 |
// return EMgFree if it is free and ready to accept |
|
261 |
// the another request else EMgBusy |
|
262 |
// ----------------------------------------------------------------------------- |
|
263 |
EXPORT_C const TMgState& CMgService::State() const |
|
264 |
{ |
|
265 |
return iState; |
|
266 |
} |
|
267 |
||
268 |
||
269 |
||
270 |
||
271 |
// ----------------------------------------------------------------------------- |
|
272 |
// CMgService::SetSortingField |
|
273 |
// It will set the metadata field on which the result |
|
274 |
// should be sorted. |
|
275 |
// Leave with KErrArgument if aSortField is not valid. |
|
276 |
// ----------------------------------------------------------------------------- |
|
277 |
||
278 |
void CMgService::SetSortingFieldL(const TDesC8& aSortField , |
|
279 |
const TDesC8& aOrder , |
|
280 |
const RArray<TInt>& aMediaTypes, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
281 |
MCLFItemListModel* alistModel, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
282 |
MCLFSortingStyle* aSortingStyle ) |
19 | 283 |
{ |
284 |
||
285 |
// Default sorting as per file name |
|
286 |
TCLFDefaultFieldId metaDataId = ECLFFieldIdFileName; |
|
287 |
TCLFItemDataType metaDataType = ECLFItemDataTypeDesC; |
|
288 |
||
289 |
//Check If the aSortField is not NULL Descriptor i.e. |
|
290 |
// sorting metadata is specified |
|
291 |
||
292 |
if( 0 != aSortField.CompareF( KNullDesC8 ) ) |
|
293 |
{ |
|
294 |
||
295 |
GetMetaDataIdAndType( aSortField, |
|
296 |
metaDataId, |
|
297 |
metaDataType, |
|
298 |
aMediaTypes ); |
|
299 |
||
300 |
if( ECLFFieldIdNull == metaDataId ) // check the return type |
|
301 |
{ |
|
302 |
// The given Sort Field is not supported by Media Management SAPI |
|
303 |
User::Leave( KErrArgument ); |
|
304 |
} |
|
305 |
} |
|
306 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
307 |
aSortingStyle->ResetL(); |
19 | 308 |
|
309 |
||
310 |
//Set the field on which sorting has to perform |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
311 |
aSortingStyle->AddFieldL( metaDataId ); |
19 | 312 |
|
313 |
// Set the sorting field data type |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
314 |
aSortingStyle->SetSortingDataType( metaDataType ); |
19 | 315 |
|
316 |
if( 0 == aOrder.CompareF( KMgDescending ) ) |
|
317 |
{ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
318 |
aSortingStyle->SetOrdering( ECLFOrderingDescending ); |
19 | 319 |
} |
320 |
else if( 0 == aOrder.CompareF( KMgAscending) ) |
|
321 |
{ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
322 |
aSortingStyle->SetOrdering( ECLFOrderingAscending ); |
19 | 323 |
} |
324 |
else |
|
325 |
{ |
|
326 |
User::Leave( KErrArgument ); |
|
327 |
} |
|
328 |
||
329 |
//Items with undefined fields are placed after items with defined fields |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
330 |
aSortingStyle->SetUndefinedItemPosition( ECLFSortingStyleUndefinedEnd ); |
19 | 331 |
|
332 |
// set sorting style in CLF. |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
333 |
alistModel->SetSortingStyle( aSortingStyle ); |
19 | 334 |
|
335 |
||
336 |
} |
|
337 |
||
338 |
||
339 |
// ----------------------------------------------------------------------------- |
|
340 |
// CPostFilter::SetFilterMetaData |
|
341 |
// Method to set the filter metadata |
|
342 |
// ----------------------------------------------------------------------------- |
|
343 |
void CMgService::SetFilterMetaDataL( const TDesC8& aFilterField, |
|
344 |
const TDesC& aStartVal, |
|
345 |
const TDesC& aEndVal, |
|
346 |
const RArray<TInt>& aMediaTypes, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
347 |
MCLFItemListModel* alistModel, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
348 |
CPostFilter* aFilter) |
19 | 349 |
{ |
350 |
TCLFDefaultFieldId metaDataId; |
|
351 |
TCLFItemDataType metaDataType; |
|
352 |
||
353 |
||
354 |
||
355 |
//Check If the Filter Meta Data is NULL Descriptor, if so |
|
356 |
// no filtration will be performed |
|
357 |
if( 0 == aFilterField.CompareF( KNullDesC8 ) ) |
|
358 |
{ |
|
359 |
metaDataId = ECLFFieldIdNull; |
|
360 |
metaDataType = ECLFItemDataTypeDesC; // Blank Descriptor |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
361 |
aFilter->SetFilterMetaData( metaDataId, metaDataType ); |
19 | 362 |
} |
363 |
else |
|
364 |
{ |
|
365 |
GetMetaDataIdAndType( aFilterField, |
|
366 |
metaDataId, |
|
367 |
metaDataType, |
|
368 |
aMediaTypes); |
|
369 |
||
370 |
if( ECLFFieldIdNull == metaDataId ) |
|
371 |
{ |
|
372 |
// The given metaData is not supported by Media Management SAPI |
|
373 |
User::Leave( KErrArgument ); |
|
374 |
} |
|
375 |
||
376 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
377 |
aFilter->SetFilterMetaData( metaDataId, metaDataType ); |
19 | 378 |
|
379 |
// set filter value of CLF |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
380 |
aFilter->SetFilterValueL( aStartVal,aEndVal ); |
19 | 381 |
|
382 |
// Set Post Filter in CLF |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
383 |
alistModel->SetPostFilter( aFilter ); |
19 | 384 |
|
385 |
} |
|
386 |
||
387 |
} |
|
388 |
||
389 |
||
390 |
// ----------------------------------------------------------------------------- |
|
391 |
// CMgService::ConstuctL |
|
392 |
// It will intialize the underlying CLF(Content Listing Framework) |
|
393 |
// framework classes and CPostFilter class. |
|
394 |
// ----------------------------------------------------------------------------- |
|
395 |
void CMgService::ConstructL() |
|
396 |
{ |
|
397 |
// create the instance of CLF engine and store it in member data. |
|
398 |
iEngine = ContentListingFactory::NewContentListingEngineLC(); |
|
399 |
CleanupStack::Pop(); |
|
400 |
||
401 |
||
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
402 |
// creates instance for thumbnailgeneration calss |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
403 |
iTumbnailGeneration = CThumbnailGeneration::NewL(); |
19 | 404 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
405 |
//creates the instance of async request manager for getlist |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
406 |
iAsyncRequestManager = CAsynchRequestManager::NewL(); |
19 | 407 |
|
408 |
} |
|
409 |
||
410 |
||
411 |
||
412 |
||
413 |
// ----------------------------------------------------------------------------- |
|
414 |
// CMgService::CMgService |
|
415 |
// Constructor |
|
416 |
// ----------------------------------------------------------------------------- |
|
417 |
CMgService::CMgService() |
|
418 |
: iState( EMgFree ), |
|
419 |
iEngine( NULL ), |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
420 |
iTransactionID( 0 ), |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
421 |
iTumbnailGeneration(NULL), |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
422 |
iAsyncRequestManager(NULL) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
423 |
{ |
19 | 424 |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
425 |
} |
19 | 426 |
|
427 |
||
428 |
// ----------------------------------------------------------------------------- |
|
429 |
// CMgService::SetMediaTypeL |
|
430 |
// It will convert the aFiletype string into |
|
431 |
// equivalent Mediatype ID and Fill the Media Type Array |
|
432 |
// if it is not valid then return KErrNotSupported |
|
433 |
// ----------------------------------------------------------------------------- |
|
434 |
void CMgService::SetMediaTypeL (const TDesC8& aFileType, |
|
435 |
RArray<TInt>& aMediaType) |
|
436 |
{ |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
437 |
if(0 == aFileType.CompareF( KAll )) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
438 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
439 |
aMediaType.AppendL( ECLFMediaTypeMusic ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
440 |
aMediaType.AppendL( ECLFMediaTypeSound ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
441 |
aMediaType.AppendL( ECLFMediaTypeImage ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
442 |
aMediaType.AppendL( ECLFMediaTypeVideo ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
443 |
//aMediaType.AppendL( ECLFMediaTypeStreamingURL ); Not supported by MDS till now |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
444 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
445 |
else if( 0 == aFileType.CompareF( KMgMusic ) ) |
19 | 446 |
{ |
447 |
aMediaType.AppendL( ECLFMediaTypeMusic ); |
|
448 |
} |
|
449 |
else if( 0 == aFileType.CompareF( KMgSound ) ) |
|
450 |
{ |
|
451 |
aMediaType.AppendL( ECLFMediaTypeSound ); |
|
452 |
} |
|
453 |
||
454 |
else if( 0 == aFileType.CompareF( KMgImage ) ) |
|
455 |
{ |
|
456 |
aMediaType.AppendL( ECLFMediaTypeImage ); |
|
457 |
} |
|
458 |
||
459 |
else if( 0 == aFileType.CompareF( KMgVideo ) ) |
|
460 |
{ |
|
461 |
aMediaType.AppendL( ECLFMediaTypeVideo ); |
|
462 |
} |
|
463 |
||
464 |
else if( 0 == aFileType.CompareF( KMgStreamingURL ) ) |
|
465 |
{ |
|
466 |
aMediaType.AppendL( ECLFMediaTypeStreamingURL ); |
|
467 |
} |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
468 |
else if(0 == aFileType.CompareF( KAudio )) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
469 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
470 |
aMediaType.AppendL( ECLFMediaTypeMusic ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
471 |
aMediaType.AppendL( ECLFMediaTypeSound ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
472 |
} |
19 | 473 |
else |
474 |
{ |
|
475 |
User::Leave ( KErrArgument ); // Media Type Not suuported |
|
476 |
} |
|
477 |
||
478 |
} |
|
479 |
||
480 |
||
481 |
||
482 |
||
483 |
||
484 |
// ----------------------------------------------------------------------------- |
|
485 |
// CMgService::SendRequestToCLF |
|
486 |
// This Function will pass the request to CLF frame work for required media type. |
|
487 |
// return KErrArgument if the FilterMetaData is not Supported |
|
488 |
// return KErrArgument if the Start Value is not Supported |
|
489 |
// return KErrArgument if the End Value is mot supported |
|
490 |
// return KErrNone if sucessful |
|
491 |
// ----------------------------------------------------------------------------- |
|
492 |
||
493 |
void CMgService::SendRequestToClfL( const TDesC8& aFileType, |
|
494 |
const TDesC8& aFilterField, |
|
495 |
const TDesC& aStartVal, |
|
496 |
const TDesC& aEndVal, |
|
497 |
const TDesC8& aSortField, |
|
498 |
const TDesC8& aOrder, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
499 |
MCLFItemListModel* alistModel , |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
500 |
CPostFilter* aFilter, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
501 |
MCLFSortingStyle* aSortingStyle) |
19 | 502 |
{ |
503 |
||
504 |
||
505 |
||
506 |
RArray<TInt> mediaTypes; |
|
507 |
CleanupClosePushL( mediaTypes ); |
|
508 |
||
509 |
//check if it is a valid file type or not |
|
510 |
SetMediaTypeL( aFileType,mediaTypes ); |
|
511 |
||
512 |
||
513 |
//set wanted media type in CLF |
|
514 |
alistModel->SetWantedMediaTypesL( mediaTypes.Array() ); |
|
515 |
||
516 |
||
517 |
// Set Filter Meta Data and Value |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
518 |
SetFilterMetaDataL( aFilterField,aStartVal,aEndVal,mediaTypes,alistModel,aFilter); |
19 | 519 |
|
520 |
||
521 |
||
522 |
// call set sorting field of CLF |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
523 |
SetSortingFieldL( aSortField,aOrder,mediaTypes,alistModel ,aSortingStyle); |
19 | 524 |
|
525 |
// set the state = Busy |
|
526 |
// till this request is complete |
|
527 |
//which indicates no further request will be taken |
|
528 |
iState = EMgBusy; |
|
529 |
||
530 |
//asynchronous call to CLF ECLFRefreshAll |
|
531 |
alistModel->RefreshL(); |
|
532 |
||
533 |
||
534 |
CleanupStack::PopAndDestroy( &mediaTypes ); |
|
535 |
||
536 |
||
537 |
} |
|
538 |
||
539 |
||
540 |
||
541 |
// ----------------------------------------------------------------------------- |
|
542 |
// CMgService::GetMetaDataIdAndType |
|
543 |
// It will convert the aFilterData string into equivalent Metadata ID and Type |
|
544 |
// which is recognized by underlying framework.(i.e CLF) |
|
545 |
// ----------------------------------------------------------------------------- |
|
546 |
void CMgService::GetMetaDataIdAndType(const TDesC8& aMetaData, |
|
547 |
TCLFDefaultFieldId& aMetaDataId, |
|
548 |
TCLFItemDataType& aMetaDataType, |
|
549 |
const RArray<TInt> &aMediaTypes) |
|
550 |
{ |
|
551 |
//File name field |
|
552 |
if( 0 == aMetaData.CompareF( KMgFileName )) |
|
553 |
{ |
|
554 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
555 |
aMetaDataId = ECLFFieldIdFileName; |
|
556 |
} |
|
557 |
||
558 |
||
559 |
||
560 |
// File Extension |
|
561 |
else if( 0 == aMetaData.CompareF( KMgFileExtension )) |
|
562 |
{ |
|
563 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
564 |
aMetaDataId = ECLFFieldIdFileExtension; |
|
565 |
} |
|
566 |
||
567 |
||
568 |
// File path field |
|
569 |
else if( 0 == aMetaData.CompareF( KMgPath )) |
|
570 |
{ |
|
571 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
572 |
aMetaDataId = ECLFFieldIdPath; |
|
573 |
} |
|
574 |
||
575 |
||
576 |
// File drive field |
|
577 |
else if( 0 == aMetaData.CompareF( KMgDrive )) |
|
578 |
{ |
|
579 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
580 |
aMetaDataId = ECLFFieldIdDrive; |
|
581 |
} |
|
582 |
||
583 |
||
584 |
// File size field |
|
585 |
else if( 0 == aMetaData.CompareF( KMgFileSize )) |
|
586 |
{ |
|
587 |
aMetaDataType = ECLFItemDataTypeTInt32; |
|
588 |
aMetaDataId = ECLFFieldIdFileSize; |
|
589 |
} |
|
590 |
||
591 |
||
592 |
||
593 |
// File date field |
|
594 |
else if( 0 == aMetaData.CompareF( KMgFileDate )) |
|
595 |
{ |
|
596 |
aMetaDataType = ECLFItemDataTypeTTime; |
|
597 |
aMetaDataId = ECLFFieldIdFileDate; |
|
598 |
} |
|
599 |
||
600 |
||
601 |
||
602 |
// Mime type field |
|
603 |
else if( 0 == aMetaData.CompareF( KMgMimeType )) |
|
604 |
{ |
|
605 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
606 |
aMetaDataId = ECLFFieldIdMimeType; |
|
607 |
} |
|
608 |
||
609 |
||
610 |
// Full name and path of the file |
|
611 |
else if( 0 == aMetaData.CompareF( KMgFileNameAndPath )) |
|
612 |
{ |
|
613 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
614 |
aMetaDataId = ECLFFieldIdFileNameAndPath; |
|
615 |
} |
|
616 |
||
617 |
// Music file song name: and also check If the File type is Music File |
|
618 |
else if( (0 == aMetaData.CompareF( KMgSongName )) &&( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeMusic )) ) |
|
619 |
{ |
|
620 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
621 |
aMetaDataId = ECLFFieldIdSongName; |
|
622 |
||
623 |
} |
|
624 |
// Music file artist |
|
625 |
else if( (0 == aMetaData.CompareF( KMgArtist )) &&( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeMusic )) ) |
|
626 |
||
627 |
{ |
|
628 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
629 |
aMetaDataId = ECLFFieldIdArtist; |
|
630 |
} |
|
631 |
||
632 |
||
633 |
// Music file album |
|
634 |
else if((0 == aMetaData.CompareF( KMgAlbum )) && |
|
635 |
( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeMusic ) ) ) |
|
636 |
{ |
|
637 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
638 |
aMetaDataId = ECLFFieldIdAlbum; |
|
639 |
} |
|
640 |
||
641 |
||
642 |
||
643 |
// Music file genre |
|
644 |
else if((0==aMetaData.CompareF( KMgGenre))&& |
|
645 |
( KErrNotFound != aMediaTypes.Find(ECLFMediaTypeMusic) ) ) |
|
646 |
{ |
|
647 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
648 |
aMetaDataId = ECLFFieldIdGenre; |
|
649 |
} |
|
650 |
||
651 |
||
652 |
||
653 |
// Music file track number |
|
654 |
else if((0 == aMetaData.CompareF( KMgTrackNumber ))&& |
|
655 |
( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeMusic ) ) ) |
|
656 |
{ |
|
657 |
aMetaDataType = ECLFItemDataTypeTInt32; |
|
658 |
aMetaDataId = ECLFFieldIdTrackNumber; |
|
659 |
} |
|
660 |
||
661 |
||
662 |
||
663 |
// Music file composer |
|
664 |
else if( (0 == aMetaData.CompareF( KMgComposer )) && |
|
665 |
( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeMusic ) ) ) |
|
666 |
{ |
|
667 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
668 |
aMetaDataId = ECLFFieldIdComposer; |
|
669 |
} |
|
670 |
||
671 |
// Ram link first URL |
|
672 |
else if( (0 == aMetaData.CompareF( KMgLinkFirstURL )) && |
|
673 |
( KErrNotFound != aMediaTypes.Find( ECLFMediaTypeStreamingURL ) ) ) |
|
674 |
{ |
|
675 |
aMetaDataType = ECLFItemDataTypeDesC; |
|
676 |
aMetaDataId = ECLFFieldIdRamLinkFirstURL; |
|
677 |
} |
|
678 |
||
679 |
else |
|
680 |
{ |
|
681 |
aMetaDataType = ECLFItemDataTypeTInt32; |
|
682 |
aMetaDataId = ECLFFieldIdNull; |
|
683 |
} |
|
684 |
||
685 |
||
686 |
} |
|
687 |
// ----------------------------------------------------------------------------- |
|
688 |
// CMgService::GetThumbnailL |
|
689 |
// It generates the thumbnail for media type (image and video ) |
|
690 |
// ----------------------------------------------------------------------------- |
|
691 |
||
692 |
EXPORT_C void CMgService::GetThumbnailL(MThumbnailObserver* aThumbnailObserver, TDesC & aUrl, TInt32 aTransactionID, |
|
693 |
TInt aHeight, TInt aWidth) |
|
694 |
{ |
|
695 |
// Calling getThumbnail Api |
|
696 |
iTumbnailGeneration->GetThumbnailL(aThumbnailObserver,aTransactionID,aUrl,aHeight,aWidth ); |
|
697 |
||
698 |
} |