equal
deleted
inserted
replaced
26 #include "Podcatcher.pan" |
26 #include "Podcatcher.pan" |
27 |
27 |
28 #include <cmdestination.h> |
28 #include <cmdestination.h> |
29 #include <cmmanager.h> |
29 #include <cmmanager.h> |
30 #include <bautils.h> |
30 #include <bautils.h> |
|
31 #include <aknserverapp.h> // MAknServerAppExitObserver |
|
32 #include <DocumentHandler.h> |
31 |
33 |
32 const TInt KDefaultGranu = 5; |
34 const TInt KDefaultGranu = 5; |
33 _LIT(KDBFileName, "podcatcher.sqlite"); |
35 _LIT(KDBFileName, "podcatcher.sqlite"); |
34 _LIT(KDBTemplateFileName, "podcatcher.sqlite.template"); |
36 _LIT(KDBTemplateFileName, "podcatcher.sqlite.template"); |
35 |
37 |
60 iActiveShowList.ResetAndDestroy(); |
62 iActiveShowList.ResetAndDestroy(); |
61 iActiveShowList.Close(); |
63 iActiveShowList.Close(); |
62 delete iConnectionEngine; |
64 delete iConnectionEngine; |
63 iCmManager.Close(); |
65 iCmManager.Close(); |
64 delete iImageHandler; |
66 delete iImageHandler; |
|
67 delete iDocHandler; |
65 } |
68 } |
66 |
69 |
67 CPodcastModel::CPodcastModel() |
70 CPodcastModel::CPodcastModel() |
68 { |
71 { |
69 } |
72 } |
77 //iCommDB ->ShowHiddenRecords(); // magic |
80 //iCommDB ->ShowHiddenRecords(); // magic |
78 iIapNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
81 iIapNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
79 iSNAPNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
82 iSNAPNameArray = new (ELeave) CDesCArrayFlat(KDefaultGranu); |
80 iCmManager.OpenL(); |
83 iCmManager.OpenL(); |
81 iImageHandler = CImageHandler::NewL(FsSession(), *this); |
84 iImageHandler = CImageHandler::NewL(FsSession(), *this); |
82 |
85 iDocHandler = CDocumentHandler::NewL(CEikonEnv::Static()->Process()); |
83 UpdateIAPListL(); |
86 UpdateIAPListL(); |
84 UpdateSNAPListL(); |
87 UpdateSNAPListL(); |
85 |
88 |
86 iSettingsEngine = CSettingsEngine::NewL(*this); |
89 iSettingsEngine = CSettingsEngine::NewL(*this); |
87 iConnectionEngine = CConnectionEngine::NewL(*this); |
90 iConnectionEngine = CConnectionEngine::NewL(*this); |
223 return *iConnectionEngine; |
226 return *iConnectionEngine; |
224 } |
227 } |
225 |
228 |
226 EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool aPlayOnInit) |
229 EXPORT_C void CPodcastModel::PlayPausePodcastL(CShowInfo* aPodcast, TBool aPlayOnInit) |
227 { |
230 { |
228 // TODO: interact with MPX |
231 TRAPD(err, LaunchFileEmbeddedL(aPodcast->FileName())); |
|
232 |
|
233 if (err == KErrNone) |
|
234 { |
|
235 aPodcast->SetPlayState(EPlayed); |
|
236 iShowEngine->UpdateShowL(*aPodcast); |
|
237 } |
|
238 |
229 } |
239 } |
230 |
240 |
231 EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo() |
241 EXPORT_C CFeedInfo* CPodcastModel::ActiveFeedInfo() |
232 { |
242 { |
233 return iActiveFeed; |
243 return iActiveFeed; |
474 |
484 |
475 EXPORT_C CImageHandler& CPodcastModel::ImageHandler() |
485 EXPORT_C CImageHandler& CPodcastModel::ImageHandler() |
476 { |
486 { |
477 return *iImageHandler; |
487 return *iImageHandler; |
478 } |
488 } |
|
489 |
|
490 void CPodcastModel::LaunchFileEmbeddedL(const TDesC& aFilename) |
|
491 { |
|
492 //Set the exit observer so HandleServerAppExit will be called |
|
493 iDocHandler->SetExitObserver(this); |
|
494 |
|
495 TDataType emptyDataType = TDataType(); |
|
496 //Open a file embedded |
|
497 iDocHandler->OpenFileEmbeddedL(aFilename, emptyDataType); |
|
498 } |
|
499 |
|
500 void CPodcastModel::HandleServerAppExit(TInt aReason) |
|
501 { |
|
502 //Handle closing the handler application |
|
503 MAknServerAppExitObserver::HandleServerAppExit(aReason); |
|
504 } |