engine/inc/PodcastModel.h
changeset 60 4d230e702aa3
parent 32 26a3f2dfba08
child 65 bcd88ba95046
equal deleted inserted replaced
59:9569ea080d5a 60:4d230e702aa3
    27 #include <cmmanager.h>
    27 #include <cmmanager.h>
    28 
    28 
    29 #include "FeedInfo.h"
    29 #include "FeedInfo.h"
    30 #include "ShowInfo.h"
    30 #include "ShowInfo.h"
    31 #include "debug.h"
    31 #include "debug.h"
    32 #include "sqlite3.h"
    32 #include <sqlite3.h>
    33 #include "ImageHandler.h"
    33 #include "ImageHandler.h"
    34 
    34 
    35 // SQLite leaks memory when sorting, so to test our own memory leaks we need to disable this
    35 // SQLite leaks memory when sorting, so to test our own memory leaks we need to disable this
    36 //#define DONT_SORT_SQL
    36 //#define DONT_SORT_SQL
    37 class RCmManager;
    37 class RCmManager;
    38 class CFeedEngine;
    38 class CFeedEngine;
    39 class CSoundEngine;
       
    40 class CShowEngine;
    39 class CShowEngine;
    41 class CSettingsEngine;
    40 class CSettingsEngine;
    42 class CCommsDatabase;
    41 class CCommsDatabase;
    43 class CConnectionEngine;
    42 class CConnectionEngine;
    44 
    43 
    58 public:
    57 public:
    59 	IMPORT_C static CPodcastModel* NewL();
    58 	IMPORT_C static CPodcastModel* NewL();
    60 	IMPORT_C ~CPodcastModel();
    59 	IMPORT_C ~CPodcastModel();
    61 	IMPORT_C CFeedEngine& FeedEngine();
    60 	IMPORT_C CFeedEngine& FeedEngine();
    62 	IMPORT_C CShowEngine& ShowEngine();
    61 	IMPORT_C CShowEngine& ShowEngine();
    63 	IMPORT_C CSoundEngine& SoundEngine();
       
    64 	IMPORT_C CSettingsEngine& SettingsEngine();
    62 	IMPORT_C CSettingsEngine& SettingsEngine();
    65 	IMPORT_C CConnectionEngine& ConnectionEngine();
    63 	IMPORT_C CConnectionEngine& ConnectionEngine();
    66 	IMPORT_C CShowInfo* PlayingPodcast();
    64 	IMPORT_C CShowInfo* PlayingPodcast();
    67 	IMPORT_C void SetPlayingPodcast(CShowInfo* aPodcast);
    65 	IMPORT_C void SetPlayingPodcast(CShowInfo* aPodcast);
    68 	IMPORT_C void PlayPausePodcastL(CShowInfo * aPodcast, TBool aPlayOnInit = EFalse);
    66 	IMPORT_C void PlayPausePodcastL(CShowInfo * aPodcast, TBool aPlayOnInit = EFalse);
    85 	void SetProxyUsageIfNeededL(RHTTPSession& aSession);
    83 	void SetProxyUsageIfNeededL(RHTTPSession& aSession);
    86 	void GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aServerName, TUint32& aPort);
    84 	void GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aServerName, TUint32& aPort);
    87 	TInt GetIapId();
    85 	TInt GetIapId();
    88 	
    86 	
    89 	sqlite3* DB();
    87 	sqlite3* DB();
       
    88 	IMPORT_C void DropDB();
    90 	
    89 	
    91 	IMPORT_C void GetAllShowsL();
       
    92 	IMPORT_C void GetNewShowsL();
       
    93 	IMPORT_C void GetShowsDownloadedL();
       
    94 	IMPORT_C void GetShowsDownloadingL();
    90 	IMPORT_C void GetShowsDownloadingL();
    95 	IMPORT_C void GetShowsByFeedL(TUint aFeedUid);
    91 	IMPORT_C void GetShowsByFeedL(TUint aFeedUid);
    96 	IMPORT_C void MarkSelectionPlayed();
    92 	IMPORT_C void MarkSelectionPlayedL();
    97 	
    93 	
    98 	TInt FindActiveShowByUid(TUint aUid);
    94 	TInt FindActiveShowByUid(TUint aUid);
    99 	IMPORT_C TBool IsFirstStartup();
    95 	IMPORT_C TBool IsFirstStartup();
   100 	IMPORT_C CImageHandler& ImageHandler();
    96 	IMPORT_C CImageHandler& ImageHandler();
   101 protected:
    97 protected:
   102 	CPodcastModel();
    98 	CPodcastModel();
   103 	void ConstructL();
    99 	void ConstructL();
       
   100 	void ResetDB();
       
   101 	void OpenDBL();
   104 	// From ImageHandler
   102 	// From ImageHandler
   105 	void ImageOperationCompleteL(TInt aError, TUint aHandle);
   103 	void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel);
   106 private:	
   104 private:	
   107    CShowInfo* iPlayingPodcast;
   105    CShowInfo* iPlayingPodcast;
   108    
   106    
   109    CFeedEngine* iFeedEngine;
   107    CFeedEngine* iFeedEngine;
   110    CShowEngine* iShowEngine;
   108    CShowEngine* iShowEngine;
   111    CSoundEngine* iSoundEngine;
       
   112    CSettingsEngine *iSettingsEngine;
   109    CSettingsEngine *iSettingsEngine;
   113    CConnectionEngine* iConnectionEngine;
   110    CConnectionEngine* iConnectionEngine;
   114    RShowInfoArray iActiveShowList;
   111    RShowInfoArray iActiveShowList;
   115    CFeedInfo *iActiveFeed;   
   112    CFeedInfo *iActiveFeed;   
   116    
   113