author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 13 Nov 2010 22:05:25 +0000 | |
branch | newlist |
changeset 347 | b8d687bb7ca1 |
parent 90 | d0c0c3e6f7a1 |
child 364 | 998e9d114bd5 |
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:
65
diff
changeset
|
28 |
#include <aknserverapp.h> // MAknServerAppExitObserver |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
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:
65
diff
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); |
|
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
90
diff
changeset
|
94 |
IMPORT_C void GetNewShowsL(); |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
8
diff
changeset
|
95 |
IMPORT_C void MarkSelectionPlayedL(); |
2 | 96 |
|
97 |
TInt FindActiveShowByUid(TUint aUid); |
|
98 |
IMPORT_C TBool IsFirstStartup(); |
|
99 |
IMPORT_C CImageHandler& ImageHandler(); |
|
100 |
protected: |
|
101 |
CPodcastModel(); |
|
102 |
void ConstructL(); |
|
60 | 103 |
void ResetDB(); |
104 |
void OpenDBL(); |
|
2 | 105 |
// From ImageHandler |
60 | 106 |
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:
65
diff
changeset
|
107 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
108 |
private: // Functions from base classes |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
109 |
/** |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
110 |
* From MAknServerAppExitObserver. |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
111 |
* 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:
65
diff
changeset
|
112 |
*/ |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
113 |
void HandleServerAppExit(TInt aReason); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
114 |
|
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
115 |
private: // Private functions |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
116 |
void LaunchFileEmbeddedL(const TDesC& aFilename); |
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
117 |
|
2 | 118 |
private: |
119 |
CShowInfo* iPlayingPodcast; |
|
120 |
||
121 |
CFeedEngine* iFeedEngine; |
|
122 |
CShowEngine* iShowEngine; |
|
123 |
CSettingsEngine *iSettingsEngine; |
|
124 |
CConnectionEngine* iConnectionEngine; |
|
125 |
RShowInfoArray iActiveShowList; |
|
126 |
CFeedInfo *iActiveFeed; |
|
127 |
||
128 |
RFs iFsSession; |
|
129 |
RArray<TPodcastIAPItem> iIapIdArray; |
|
130 |
CDesCArrayFlat* iIapNameArray; |
|
131 |
||
132 |
RArray<TPodcastIAPItem> iSNAPIdArray; |
|
133 |
CDesCArrayFlat* iSNAPNameArray; |
|
134 |
CCommsDatabase* iCommDB; |
|
135 |
||
136 |
sqlite3* iDB; |
|
137 |
RCmManager iCmManager; |
|
138 |
TBool iIsFirstStartup; |
|
139 |
CImageHandler* iImageHandler; |
|
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
65
diff
changeset
|
140 |
CDocumentHandler* iDocHandler; |
2 | 141 |
}; |
142 |
||
143 |
#endif // PODCASTMODEL_H |