| author | teknolog | 
| Sat, 15 May 2010 11:13:19 +0100 | |
| branch | symbian1 | 
| changeset 90 | d0c0c3e6f7a1 | 
| parent 65 | bcd88ba95046 | 
| child 176 | 1c8b56cb6409 | 
| child 347 | b8d687bb7ca1 | 
| 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 | #ifndef PODCASTMODEL_H | |
| 20 | #define PODCASTMODEL_H | |
| 21 | #include <e32base.h> | |
| 22 | #include <eikenv.h> | |
| 23 | #include <commdb.h> | |
| 24 | #include <CommDbConnPref.h> | |
| 25 | #include <es_sock.h> | |
| 26 | #include <http/rhttpsession.h> | |
| 27 | #include <cmmanager.h> | |
| 90 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 28 | #include <aknserverapp.h> // MAknServerAppExitObserver | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 29 | #include <DocumentHandler.h> | 
| 2 | 30 | |
| 31 | #include "FeedInfo.h" | |
| 32 | #include "ShowInfo.h" | |
| 33 | #include "debug.h" | |
| 60 | 34 | #include <sqlite3.h> | 
| 2 | 35 | #include "ImageHandler.h" | 
| 36 | ||
| 37 | // SQLite leaks memory when sorting, so to test our own memory leaks we need to disable this | |
| 38 | //#define DONT_SORT_SQL | |
| 39 | class RCmManager; | |
| 40 | class CFeedEngine; | |
| 41 | class CShowEngine; | |
| 42 | class CSettingsEngine; | |
| 43 | class CCommsDatabase; | |
| 44 | class CConnectionEngine; | |
| 45 | ||
| 46 | class TPodcastIAPItem | |
| 47 | {
 | |
| 48 | public: | |
| 49 | TUint32 iIapId; | |
| 50 | TBuf<KCommsDbSvrMaxFieldLength> iServiceType; | |
| 51 | TBuf<KCommsDbSvrMaxFieldLength> iBearerType; | |
| 52 | }; | |
| 53 | ||
| 54 | /** | |
| 55 | * This class handles application storage needs and ownership of audioplayer, resource lists etc. | |
| 56 | */ | |
| 90 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 57 | class CPodcastModel : public CBase, public MImageHandlerCallback, public MAknServerAppExitObserver | 
| 2 | 58 | {
 | 
| 59 | public: | |
| 60 | IMPORT_C static CPodcastModel* NewL(); | |
| 61 | IMPORT_C ~CPodcastModel(); | |
| 62 | IMPORT_C CFeedEngine& FeedEngine(); | |
| 63 | IMPORT_C CShowEngine& ShowEngine(); | |
| 64 | IMPORT_C CSettingsEngine& SettingsEngine(); | |
| 65 | IMPORT_C CConnectionEngine& ConnectionEngine(); | |
| 66 | IMPORT_C CShowInfo* PlayingPodcast(); | |
| 67 | IMPORT_C void SetPlayingPodcast(CShowInfo* aPodcast); | |
| 68 | IMPORT_C void PlayPausePodcastL(CShowInfo * aPodcast, TBool aPlayOnInit = EFalse); | |
| 69 | IMPORT_C CFeedInfo* ActiveFeedInfo(); | |
| 70 | IMPORT_C void SetActiveFeedInfo(CFeedInfo* aFeedInfo); | |
| 71 | ||
| 72 | RFs& FsSession(); | |
| 73 | ||
| 74 | IMPORT_C RShowInfoArray& ActiveShowList(); | |
| 75 | ||
| 76 | void SetActiveShowList(RShowInfoArray& aShowArray); | |
| 77 | ||
| 78 | IMPORT_C void UpdateIAPListL(); | |
| 79 | IMPORT_C void UpdateSNAPListL(); | |
| 80 | IMPORT_C CDesCArrayFlat* IAPNames(); | |
| 81 | IMPORT_C RArray<TPodcastIAPItem>& IAPIds(); | |
| 82 | IMPORT_C CDesCArrayFlat* SNAPNames(); | |
| 83 | IMPORT_C RArray<TPodcastIAPItem>& SNAPIds(); | |
| 84 | ||
| 85 | void SetProxyUsageIfNeededL(RHTTPSession& aSession); | |
| 86 | void GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aServerName, TUint32& aPort); | |
| 87 | TInt GetIapId(); | |
| 88 | ||
| 89 | sqlite3* DB(); | |
| 60 | 90 | IMPORT_C void DropDB(); | 
| 2 | 91 | |
| 8 | 92 | IMPORT_C void GetShowsDownloadingL(); | 
| 93 | IMPORT_C void GetShowsByFeedL(TUint aFeedUid); | |
| 35 
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
 Brendan Donegan <brendand@symbian.org> parents: 
8diff
changeset | 94 | IMPORT_C void MarkSelectionPlayedL(); | 
| 2 | 95 | |
| 96 | TInt FindActiveShowByUid(TUint aUid); | |
| 97 | IMPORT_C TBool IsFirstStartup(); | |
| 98 | IMPORT_C CImageHandler& ImageHandler(); | |
| 99 | protected: | |
| 100 | CPodcastModel(); | |
| 101 | void ConstructL(); | |
| 60 | 102 | void ResetDB(); | 
| 103 | void OpenDBL(); | |
| 2 | 104 | // From ImageHandler | 
| 60 | 105 | void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel); | 
| 90 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 106 | |
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 107 | private: // Functions from base classes | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 108 | /** | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 109 | * From MAknServerAppExitObserver. | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 110 | * Handles the exit of a connected server application. | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 111 | */ | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 112 | void HandleServerAppExit(TInt aReason); | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 113 | |
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 114 | private: // Private functions | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 115 | void LaunchFileEmbeddedL(const TDesC& aFilename); | 
| 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 116 | |
| 2 | 117 | private: | 
| 118 | CShowInfo* iPlayingPodcast; | |
| 119 | ||
| 120 | CFeedEngine* iFeedEngine; | |
| 121 | CShowEngine* iShowEngine; | |
| 122 | CSettingsEngine *iSettingsEngine; | |
| 123 | CConnectionEngine* iConnectionEngine; | |
| 124 | RShowInfoArray iActiveShowList; | |
| 125 | CFeedInfo *iActiveFeed; | |
| 126 | ||
| 127 | RFs iFsSession; | |
| 128 | RArray<TPodcastIAPItem> iIapIdArray; | |
| 129 | CDesCArrayFlat* iIapNameArray; | |
| 130 | ||
| 131 | RArray<TPodcastIAPItem> iSNAPIdArray; | |
| 132 | CDesCArrayFlat* iSNAPNameArray; | |
| 133 | CCommsDatabase* iCommDB; | |
| 134 | ||
| 135 | sqlite3* iDB; | |
| 136 | RCmManager iCmManager; | |
| 137 | TBool iIsFirstStartup; | |
| 138 | CImageHandler* iImageHandler; | |
| 90 
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
 teknolog parents: 
65diff
changeset | 139 | CDocumentHandler* iDocHandler; | 
| 2 | 140 | }; | 
| 141 | ||
| 142 | #endif // PODCASTMODEL_H |