author | teknolog |
Wed, 26 May 2010 17:46:55 +0100 | |
branch | symbian1 |
changeset 136 | cee38af14bcf |
parent 90 | d0c0c3e6f7a1 |
child 148 | e3f9b65d6910 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include <commdb.h> |
|
20 |
#include "PodcastModel.h" |
|
21 |
#include "FeedEngine.h" |
|
22 |
#include "SettingsEngine.h" |
|
23 |
#include "ShowEngine.h" |
|
24 |
#include "connectionengine.h" |
|
60 | 25 |
#include "podcastutils.h" |
26 |
#include "Podcatcher.pan" |
|
2 | 27 |
|
28 |
#include <cmdestination.h> |
|
29 |
#include <cmmanager.h> |
|
30 |
#include <bautils.h> |
|
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
31 |
#include <aknserverapp.h> // MAknServerAppExitObserver |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
32 |
#include <DocumentHandler.h> |
2 | 33 |
|
34 |
const TInt KDefaultGranu = 5; |
|
35 |
_LIT(KDBFileName, "podcatcher.sqlite"); |
|
36 |
_LIT(KDBTemplateFileName, "podcatcher.sqlite.template"); |
|
37 |
||
38 |
EXPORT_C CPodcastModel* CPodcastModel::NewL() |
|
39 |
{ |
|
40 |
CPodcastModel* self = new (ELeave) CPodcastModel; |
|
41 |
CleanupStack::PushL(self); |
|
42 |
self->ConstructL(); |
|
43 |
CleanupStack::Pop(self); |
|
44 |
return self; |
|
45 |
} |
|
46 |
||
47 |
CPodcastModel::~CPodcastModel() |
|
48 |
{ |
|
49 |
||
50 |
delete iFeedEngine; |
|
51 |
delete iSettingsEngine; |
|
52 |
delete iShowEngine; |
|
53 |
||
54 |
delete iIapNameArray; |
|
55 |
iIapIdArray.Close(); |
|
56 |
||
57 |
delete iSNAPNameArray; |
|
58 |
iSNAPIdArray.Close(); |
|
59 |
delete iCommDB; |
|
60 |
sqlite3_close(iDB); |
|
61 |
iFsSession.Close(); |
|
62 |
iActiveShowList.ResetAndDestroy(); |
|
63 |
iActiveShowList.Close(); |
|
64 |
delete iConnectionEngine; |
|
65 |
iCmManager.Close(); |
|
66 |
delete iImageHandler; |
|
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
67 |
delete iDocHandler; |
2 | 68 |
} |
69 |
||
70 |
CPodcastModel::CPodcastModel() |
|
71 |
{ |
|
72 |
} |
|
73 |
||
74 |
void CPodcastModel::ConstructL() |
|
75 |
{ |
|
76 |
DP("CPodcastModel::ConstructL BEGIN"); |
|
77 |
User::LeaveIfError(iFsSession.Connect()); |
|
78 |
||
79 |
iCommDB = CCommsDatabase::NewL (EDatabaseTypeUnspecified); |
|
80 |
//iCommDB ->ShowHiddenRecords(); // magic |
|
81 |
iIapNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
|
82 |
iSNAPNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
|
83 |
iCmManager.OpenL(); |
|
60 | 84 |
iImageHandler = CImageHandler::NewL(FsSession(), *this); |
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
85 |
iDocHandler = CDocumentHandler::NewL(CEikonEnv::Static()->Process()); |
2 | 86 |
UpdateIAPListL(); |
87 |
UpdateSNAPListL(); |
|
88 |
||
89 |
iSettingsEngine = CSettingsEngine::NewL(*this); |
|
90 |
iConnectionEngine = CConnectionEngine::NewL(*this); |
|
91 |
||
60 | 92 |
TRAPD(err, OpenDBL()); |
93 |
||
94 |
if (err != KErrNone) |
|
95 |
{ |
|
96 |
ResetDB(); |
|
97 |
||
98 |
TRAP(err, OpenDBL()); |
|
99 |
||
100 |
if (err != KErrNone) |
|
101 |
{ |
|
102 |
Panic(EPodcatcherPanicDB); |
|
103 |
} |
|
104 |
||
105 |
} |
|
106 |
||
2 | 107 |
iFeedEngine = CFeedEngine::NewL(*this); |
108 |
iShowEngine = CShowEngine::NewL(*this); |
|
109 |
||
110 |
DP("CPodcastModel::ConstructL END"); |
|
111 |
} |
|
112 |
||
113 |
||
114 |
||
115 |
EXPORT_C void CPodcastModel::UpdateIAPListL() |
|
116 |
{ |
|
117 |
iIapNameArray->Reset(); |
|
118 |
iIapIdArray.Reset(); |
|
119 |
||
120 |
CCommsDbTableView* table = iCommDB->OpenTableLC (TPtrC (IAP)); |
|
121 |
TInt ret = table->GotoFirstRecord (); |
|
122 |
TPodcastIAPItem IAPItem; |
|
123 |
TBuf <KCommsDbSvrMaxFieldLength> bufName; |
|
124 |
while (ret == KErrNone) // There was a first record |
|
125 |
{ |
|
126 |
table->ReadUintL(TPtrC(COMMDB_ID), IAPItem.iIapId); |
|
127 |
table->ReadTextL (TPtrC(COMMDB_NAME), bufName); |
|
128 |
table->ReadTextL (TPtrC(IAP_BEARER_TYPE), IAPItem.iBearerType); |
|
129 |
table->ReadTextL (TPtrC(IAP_SERVICE_TYPE), IAPItem.iServiceType); |
|
130 |
||
131 |
iIapIdArray.Append(IAPItem); |
|
132 |
iIapNameArray->AppendL(bufName); |
|
133 |
ret = table->GotoNextRecord(); |
|
134 |
} |
|
135 |
CleanupStack::PopAndDestroy(); // Close table |
|
136 |
} |
|
137 |
||
138 |
EXPORT_C void CPodcastModel::UpdateSNAPListL() |
|
139 |
{ |
|
140 |
DP("CPodcastModel::UpdateSNAPListL BEGIN"); |
|
141 |
iSNAPNameArray->Reset(); |
|
142 |
iSNAPIdArray.Reset(); |
|
143 |
||
144 |
RCmDestination destination; |
|
145 |
TPodcastIAPItem IAPItem; |
|
146 |
||
147 |
RArray<TUint32> destArray; |
|
148 |
CleanupClosePushL(destArray); |
|
149 |
iCmManager.AllDestinationsL(destArray); |
|
150 |
||
151 |
TInt cnt = destArray.Count(); |
|
152 |
DP1("destArray.Count==%d", cnt); |
|
153 |
for(TInt loop = 0;loop<cnt;loop++) |
|
154 |
{ |
|
155 |
destination = iCmManager.DestinationL (destArray[loop]); |
|
156 |
CleanupClosePushL(destination); |
|
157 |
if(!destination.IsHidden()) |
|
158 |
{ |
|
159 |
IAPItem.iIapId = destArray[loop]; |
|
160 |
HBufC* name = destination.NameLC(); |
|
161 |
DP1(" destination.NameLC==%S", name); |
|
162 |
iSNAPNameArray->AppendL(*name); |
|
163 |
CleanupStack::PopAndDestroy(name); |
|
164 |
iSNAPIdArray.Append(IAPItem); |
|
165 |
} |
|
166 |
CleanupStack::PopAndDestroy();//close destination |
|
167 |
} |
|
168 |
CleanupStack::PopAndDestroy();// close destArray |
|
169 |
||
170 |
DP("CPodcastModel::UpdateSNAPListL END"); |
|
171 |
} |
|
172 |
||
173 |
EXPORT_C CDesCArrayFlat* CPodcastModel::IAPNames() |
|
174 |
{ |
|
175 |
return iIapNameArray; |
|
176 |
} |
|
177 |
||
178 |
EXPORT_C RArray<TPodcastIAPItem>& CPodcastModel::IAPIds() |
|
179 |
{ |
|
180 |
return iIapIdArray; |
|
181 |
} |
|
182 |
||
183 |
EXPORT_C CDesCArrayFlat* CPodcastModel::SNAPNames() |
|
184 |
{ |
|
185 |
return iSNAPNameArray; |
|
186 |
} |
|
187 |
||
188 |
EXPORT_C RArray<TPodcastIAPItem>& CPodcastModel::SNAPIds() |
|
189 |
{ |
|
190 |
return iSNAPIdArray; |
|
191 |
} |
|
192 |
||
193 |
||
194 |
RFs& CPodcastModel::FsSession() |
|
195 |
{ |
|
196 |
return iFsSession; |
|
197 |
} |
|
198 |
||
199 |
EXPORT_C void CPodcastModel::SetPlayingPodcast(CShowInfo* aPodcast) |
|
200 |
{ |
|
201 |
iPlayingPodcast = aPodcast; |
|
202 |
} |
|
203 |
||
204 |
EXPORT_C CShowInfo* CPodcastModel::PlayingPodcast() |
|
205 |
{ |
|
206 |
return iPlayingPodcast; |
|
207 |
} |
|
208 |
||
209 |
EXPORT_C CFeedEngine& CPodcastModel::FeedEngine() |
|
210 |
{ |
|
211 |
return *iFeedEngine; |
|
212 |
} |
|
213 |
||
214 |
EXPORT_C CShowEngine& CPodcastModel::ShowEngine() |
|
215 |
{ |
|
216 |
return *iShowEngine; |
|
217 |
} |
|
218 |
||
219 |
EXPORT_C CSettingsEngine& CPodcastModel::SettingsEngine() |
|
220 |
{ |
|
221 |
return *iSettingsEngine; |
|
222 |
} |
|
223 |
||
224 |
EXPORT_C CConnectionEngine& CPodcastModel::ConnectionEngine() |
|
225 |
{ |
|
226 |
return *iConnectionEngine; |
|
227 |
} |
|
228 |
||
229 |
EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool aPlayOnInit) |
|
230 |
{ |
|
136
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
231 |
DP("CPodcastModel::PlayPausePodcastL BEGIN"); |
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
232 |
TRAPD(err, LaunchFileEmbeddedL(aPodcast->FileName())); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
233 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
234 |
if (err == KErrNone) |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
235 |
{ |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
236 |
aPodcast->SetPlayState(EPlayed); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
237 |
iShowEngine->UpdateShowL(*aPodcast); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
238 |
} |
136
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
239 |
else |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
240 |
{ |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
241 |
User::Leave(err); |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
242 |
} |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
90
diff
changeset
|
243 |
DP("CPodcastModel::PlayPausePodcastL END"); |
2 | 244 |
} |
245 |
||
246 |
EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo() |
|
247 |
{ |
|
248 |
return iActiveFeed; |
|
249 |
} |
|
250 |
||
251 |
EXPORT_C void CPodcastModel::SetActiveFeedInfo(CFeedInfo* aFeedInfo) |
|
252 |
{ |
|
253 |
iActiveFeed = aFeedInfo; |
|
254 |
} |
|
255 |
||
256 |
EXPORT_C RShowInfoArray& CPodcastModel::ActiveShowList() |
|
257 |
{ |
|
258 |
return iActiveShowList; |
|
259 |
} |
|
260 |
||
261 |
void CPodcastModel::SetActiveShowList(RShowInfoArray& aShowArray) |
|
262 |
{ |
|
263 |
iActiveShowList.ResetAndDestroy(); |
|
264 |
TInt cnt = aShowArray.Count(); |
|
265 |
||
266 |
for(TInt loop = 0;loop < cnt; loop++) |
|
267 |
{ |
|
268 |
iActiveShowList.Append(aShowArray[loop]); |
|
269 |
} |
|
270 |
} |
|
271 |
||
60 | 272 |
EXPORT_C void CPodcastModel::DropDB() |
273 |
{ |
|
274 |
if (iDB != NULL) |
|
275 |
{ |
|
276 |
sqlite3_close(iDB); |
|
277 |
iDB = NULL; |
|
278 |
} |
|
279 |
||
280 |
TFileName dbFileName; |
|
281 |
dbFileName.Copy(iSettingsEngine->PrivatePath()); |
|
282 |
dbFileName.Append(KDBFileName); |
|
283 |
||
284 |
// remove the old DB file |
|
285 |
if (BaflUtils::FileExists(iFsSession, dbFileName)) |
|
286 |
{ |
|
287 |
BaflUtils::DeleteFile(iFsSession, dbFileName); |
|
288 |
} |
|
289 |
} |
|
290 |
||
291 |
void CPodcastModel::ResetDB() |
|
292 |
{ |
|
293 |
DP("CPodcastModel::ResetDB BEGIN"); |
|
294 |
||
295 |
DropDB(); |
|
296 |
||
297 |
TFileName dbFileName; |
|
298 |
dbFileName.Copy(iSettingsEngine->PrivatePath()); |
|
299 |
dbFileName.Append(KDBFileName); |
|
300 |
||
301 |
// remove the old DB file |
|
302 |
if (BaflUtils::FileExists(iFsSession, dbFileName)) |
|
303 |
{ |
|
304 |
BaflUtils::DeleteFile(iFsSession, dbFileName); |
|
305 |
} |
|
306 |
||
307 |
// copy template to new DB |
|
308 |
TFileName dbTemplate; |
|
309 |
dbTemplate.Copy(iSettingsEngine->PrivatePath()); |
|
310 |
dbTemplate.Append(KDBTemplateFileName); |
|
311 |
||
312 |
BaflUtils::CopyFile(iFsSession, dbTemplate,dbFileName); |
|
313 |
iIsFirstStartup = ETrue; |
|
314 |
DP("CPodcastModel::ResetDB END"); |
|
315 |
} |
|
316 |
||
317 |
||
318 |
void CPodcastModel::OpenDBL() |
|
319 |
{ |
|
320 |
DP("CPodcastModel::OpenDBL BEGIN"); |
|
321 |
||
322 |
if (iDB != NULL) |
|
323 |
{ |
|
324 |
sqlite3_close(iDB); |
|
325 |
iDB = NULL; |
|
326 |
} |
|
327 |
||
328 |
TFileName dbFileName; |
|
329 |
dbFileName.Copy(iSettingsEngine->PrivatePath()); |
|
330 |
dbFileName.Append(KDBFileName); |
|
331 |
||
332 |
if (!BaflUtils::FileExists(iFsSession, dbFileName)) |
|
333 |
{ |
|
334 |
User::Leave(KErrNotFound); |
|
335 |
} |
|
336 |
||
337 |
if (iDB == NULL) { |
|
338 |
// open DB |
|
339 |
TBuf8<KMaxFileName> filename8; |
|
340 |
filename8.Copy(dbFileName); |
|
341 |
int rc = sqlite3_open((const char*) filename8.PtrZ(), &iDB); |
|
342 |
if(rc != SQLITE_OK){ |
|
343 |
User::Leave(KErrCorrupt); |
|
344 |
} |
|
345 |
||
346 |
// do a test query |
|
347 |
sqlite3_stmt *st; |
|
348 |
rc = sqlite3_prepare_v2(iDB,"select count(*) from feeds" , -1, &st, (const char**) NULL); |
|
349 |
if( rc==SQLITE_OK ) |
|
350 |
{ |
|
351 |
Cleanup_sqlite3_finalize_PushL(st); |
|
352 |
rc = sqlite3_step(st); |
|
353 |
||
354 |
if (rc != SQLITE_ROW) |
|
355 |
{ |
|
356 |
User::Leave(KErrCorrupt); |
|
357 |
} |
|
358 |
CleanupStack::PopAndDestroy(); // st |
|
359 |
} |
|
360 |
else |
|
361 |
{ |
|
362 |
User::Leave(KErrCorrupt); |
|
363 |
} |
|
364 |
} |
|
365 |
||
366 |
DP("CPodcastModel::OpenDBL END"); |
|
367 |
} |
|
368 |
||
2 | 369 |
sqlite3* CPodcastModel::DB() |
370 |
{ |
|
371 |
return iDB; |
|
372 |
} |
|
373 |
||
374 |
void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession) |
|
375 |
{ |
|
376 |
TBool useProxy = EFalse; |
|
377 |
HBufC* serverName = NULL; |
|
378 |
TUint32 port = 0; |
|
379 |
||
380 |
TRAPD(err,GetProxyInformationForConnectionL(useProxy, serverName, port)); |
|
381 |
if (err == KErrNone && useProxy) |
|
382 |
{ |
|
383 |
CleanupStack::PushL(serverName); |
|
384 |
TBuf8<128> proxyAddr; |
|
385 |
proxyAddr.Append(*serverName); |
|
386 |
proxyAddr.Append(':'); |
|
387 |
proxyAddr.AppendNum(port); |
|
388 |
||
389 |
RStringF prxAddr = aSession.StringPool().OpenFStringL(proxyAddr); |
|
390 |
CleanupClosePushL(prxAddr); |
|
391 |
THTTPHdrVal prxUsage(aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable())); |
|
392 |
||
393 |
aSession.ConnectionInfo().SetPropertyL( |
|
394 |
aSession.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), |
|
395 |
aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable())); |
|
396 |
||
397 |
aSession.ConnectionInfo().SetPropertyL(aSession.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), prxAddr); |
|
398 |
||
399 |
CleanupStack::PopAndDestroy(&prxAddr); |
|
400 |
CleanupStack::PopAndDestroy(serverName); |
|
401 |
} |
|
402 |
} |
|
403 |
||
404 |
||
405 |
void CPodcastModel::GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aProxyServerName, TUint32& aPort) |
|
406 |
{ |
|
407 |
TInt iapId = GetIapId(); |
|
408 |
CCommsDbTableView* table = iCommDB->OpenViewMatchingUintLC(TPtrC(IAP), TPtrC(COMMDB_ID), iapId); |
|
409 |
||
410 |
TUint32 iapService; |
|
411 |
HBufC* iapServiceType; |
|
412 |
table->ReadUintL(TPtrC(IAP_SERVICE), iapService); |
|
413 |
iapServiceType = table->ReadLongTextLC(TPtrC(IAP_SERVICE_TYPE)); |
|
414 |
||
415 |
CCommsDbTableView* proxyTableView = iCommDB->OpenViewOnProxyRecordLC(iapService, *iapServiceType); |
|
416 |
TInt err = proxyTableView->GotoFirstRecord(); |
|
417 |
if( err != KErrNone) |
|
418 |
{ |
|
419 |
User::Leave(KErrNotFound); |
|
420 |
} |
|
421 |
||
422 |
proxyTableView->ReadBoolL(TPtrC(PROXY_USE_PROXY_SERVER), aIsUsed); |
|
423 |
if(aIsUsed) |
|
424 |
{ |
|
425 |
HBufC* serverName = proxyTableView->ReadLongTextLC(TPtrC(PROXY_SERVER_NAME)); |
|
426 |
proxyTableView->ReadUintL(TPtrC(PROXY_PORT_NUMBER), aPort); |
|
427 |
aProxyServerName = serverName->AllocL(); |
|
428 |
CleanupStack::PopAndDestroy(serverName); |
|
429 |
} |
|
430 |
||
431 |
CleanupStack::PopAndDestroy(proxyTableView); |
|
432 |
CleanupStack::PopAndDestroy(iapServiceType); |
|
433 |
CleanupStack::PopAndDestroy(table); |
|
434 |
} |
|
435 |
||
436 |
TInt CPodcastModel::GetIapId() |
|
437 |
{ |
|
438 |
_LIT(KSetting, "IAP\\Id"); |
|
439 |
TUint32 iapId = 0; |
|
440 |
iConnectionEngine->Connection().GetIntSetting(KSetting, iapId); |
|
441 |
return iapId; |
|
442 |
} |
|
443 |
||
8 | 444 |
EXPORT_C void CPodcastModel::GetShowsDownloadingL() |
2 | 445 |
{ |
446 |
iActiveShowList.ResetAndDestroy(); |
|
8 | 447 |
iShowEngine->GetShowsDownloadingL(iActiveShowList); |
2 | 448 |
} |
449 |
||
8 | 450 |
EXPORT_C void CPodcastModel::GetShowsByFeedL(TUint aFeedUid) |
2 | 451 |
{ |
452 |
iActiveShowList.ResetAndDestroy(); |
|
88
f4b512d870e8
Moved call to DeleteOldShowsByFeedL to when a feed is listed. This prevents a race condition which likely caused
teknolog
parents:
67
diff
changeset
|
453 |
iShowEngine->DeleteOldShowsByFeedL(aFeedUid); |
60 | 454 |
iShowEngine->CheckForDeletedShows(aFeedUid); |
8 | 455 |
iShowEngine->GetShowsByFeedL(iActiveShowList, aFeedUid); |
2 | 456 |
} |
457 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
8
diff
changeset
|
458 |
EXPORT_C void CPodcastModel::MarkSelectionPlayedL() |
2 | 459 |
{ |
460 |
for (int i=0;i<iActiveShowList.Count();i++) { |
|
461 |
if(iActiveShowList[i]->PlayState() != EPlayed) { |
|
462 |
iActiveShowList[i]->SetPlayState(EPlayed); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
8
diff
changeset
|
463 |
iShowEngine->UpdateShowL(*iActiveShowList[i]); |
2 | 464 |
} |
465 |
} |
|
466 |
} |
|
467 |
||
468 |
TInt CPodcastModel::FindActiveShowByUid(TUint aUid) |
|
469 |
{ |
|
470 |
for (int i=0;i<iActiveShowList.Count();i++) { |
|
471 |
if (iActiveShowList[i]->Uid() == aUid) { |
|
472 |
return i; |
|
473 |
} |
|
474 |
} |
|
475 |
||
476 |
return KErrNotFound; |
|
477 |
} |
|
478 |
||
479 |
EXPORT_C TBool CPodcastModel::IsFirstStartup() |
|
480 |
{ |
|
481 |
return iIsFirstStartup; |
|
482 |
} |
|
483 |
||
484 |
||
60 | 485 |
void CPodcastModel::ImageOperationCompleteL(TInt /*aError*/, TUint /*aHandle*/, CPodcastModel& /*aPodcastModel*/) |
2 | 486 |
{ |
487 |
||
488 |
} |
|
489 |
||
490 |
EXPORT_C CImageHandler& CPodcastModel::ImageHandler() |
|
491 |
{ |
|
492 |
return *iImageHandler; |
|
493 |
} |
|
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
494 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
495 |
void CPodcastModel::LaunchFileEmbeddedL(const TDesC& aFilename) |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
496 |
{ |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
497 |
//Set the exit observer so HandleServerAppExit will be called |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
498 |
iDocHandler->SetExitObserver(this); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
499 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
500 |
TDataType emptyDataType = TDataType(); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
501 |
//Open a file embedded |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
502 |
iDocHandler->OpenFileEmbeddedL(aFilename, emptyDataType); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
503 |
} |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
504 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
505 |
void CPodcastModel::HandleServerAppExit(TInt aReason) |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
506 |
{ |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
507 |
//Handle closing the handler application |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
508 |
MAknServerAppExitObserver::HandleServerAppExit(aReason); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
88
diff
changeset
|
509 |
} |