author | teknolog |
Sun, 04 Apr 2010 18:38:49 +0100 | |
changeset 80 | 50345a6ad0c3 |
parent 77 | 403412eb5292 |
child 83 | a2e43aa1ad11 |
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> |
|
28 |
||
29 |
#include "FeedInfo.h" |
|
30 |
#include "ShowInfo.h" |
|
31 |
#include "debug.h" |
|
32 |
#include "sqlite3.h" |
|
33 |
#include "ImageHandler.h" |
|
34 |
||
35 |
// SQLite leaks memory when sorting, so to test our own memory leaks we need to disable this |
|
36 |
//#define DONT_SORT_SQL |
|
37 |
class RCmManager; |
|
38 |
class CFeedEngine; |
|
39 |
class CShowEngine; |
|
40 |
class CSettingsEngine; |
|
41 |
class CCommsDatabase; |
|
42 |
class CConnectionEngine; |
|
43 |
||
44 |
class TPodcastIAPItem |
|
45 |
{ |
|
46 |
public: |
|
47 |
TUint32 iIapId; |
|
48 |
TBuf<KCommsDbSvrMaxFieldLength> iServiceType; |
|
49 |
TBuf<KCommsDbSvrMaxFieldLength> iBearerType; |
|
50 |
}; |
|
51 |
||
52 |
/** |
|
53 |
* This class handles application storage needs and ownership of audioplayer, resource lists etc. |
|
54 |
*/ |
|
55 |
class CPodcastModel : public CBase, public MImageHandlerCallback |
|
56 |
{ |
|
57 |
public: |
|
58 |
IMPORT_C static CPodcastModel* NewL(); |
|
59 |
IMPORT_C ~CPodcastModel(); |
|
60 |
IMPORT_C CFeedEngine& FeedEngine(); |
|
61 |
IMPORT_C CShowEngine& ShowEngine(); |
|
62 |
IMPORT_C CSettingsEngine& SettingsEngine(); |
|
63 |
IMPORT_C CConnectionEngine& ConnectionEngine(); |
|
64 |
IMPORT_C CShowInfo* PlayingPodcast(); |
|
65 |
IMPORT_C void SetPlayingPodcast(CShowInfo* aPodcast); |
|
66 |
IMPORT_C void PlayPausePodcastL(CShowInfo * aPodcast, TBool aPlayOnInit = EFalse); |
|
67 |
IMPORT_C CFeedInfo* ActiveFeedInfo(); |
|
68 |
IMPORT_C void SetActiveFeedInfo(CFeedInfo* aFeedInfo); |
|
69 |
||
70 |
RFs& FsSession(); |
|
71 |
||
72 |
IMPORT_C RShowInfoArray& ActiveShowList(); |
|
73 |
||
74 |
void SetActiveShowList(RShowInfoArray& aShowArray); |
|
75 |
||
76 |
IMPORT_C void UpdateIAPListL(); |
|
77 |
IMPORT_C void UpdateSNAPListL(); |
|
78 |
IMPORT_C CDesCArrayFlat* IAPNames(); |
|
79 |
IMPORT_C RArray<TPodcastIAPItem>& IAPIds(); |
|
80 |
IMPORT_C CDesCArrayFlat* SNAPNames(); |
|
81 |
IMPORT_C RArray<TPodcastIAPItem>& SNAPIds(); |
|
82 |
||
83 |
void SetProxyUsageIfNeededL(RHTTPSession& aSession); |
|
84 |
void GetProxyInformationForConnectionL(TBool& aIsUsed, HBufC*& aServerName, TUint32& aPort); |
|
85 |
TInt GetIapId(); |
|
86 |
||
87 |
sqlite3* DB(); |
|
77
403412eb5292
Added "Reset database" option in settings. Further robustness fixes for Feeds.
teknolog
parents:
76
diff
changeset
|
88 |
void DropDB(); |
76 | 89 |
void ResetDB(); |
2 | 90 |
|
8 | 91 |
IMPORT_C void GetShowsDownloadingL(); |
92 |
IMPORT_C void GetShowsByFeedL(TUint aFeedUid); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
8
diff
changeset
|
93 |
IMPORT_C void MarkSelectionPlayedL(); |
2 | 94 |
|
95 |
TInt FindActiveShowByUid(TUint aUid); |
|
96 |
IMPORT_C TBool IsFirstStartup(); |
|
97 |
IMPORT_C CImageHandler& ImageHandler(); |
|
98 |
protected: |
|
99 |
CPodcastModel(); |
|
100 |
void ConstructL(); |
|
76 | 101 |
|
102 |
void OpenDBL(); |
|
2 | 103 |
// From ImageHandler |
60
bbf5c5204844
We always build the static version of sqlite for now. Further improvements for signaling when icons has been generated so these can be used in the feedview
Lars Persson <lars.persson@embeddev.se>
parents:
32
diff
changeset
|
104 |
void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel); |
2 | 105 |
private: |
106 |
CShowInfo* iPlayingPodcast; |
|
107 |
||
108 |
CFeedEngine* iFeedEngine; |
|
109 |
CShowEngine* iShowEngine; |
|
110 |
CSettingsEngine *iSettingsEngine; |
|
111 |
CConnectionEngine* iConnectionEngine; |
|
112 |
RShowInfoArray iActiveShowList; |
|
113 |
CFeedInfo *iActiveFeed; |
|
114 |
||
115 |
RFs iFsSession; |
|
116 |
RArray<TPodcastIAPItem> iIapIdArray; |
|
117 |
CDesCArrayFlat* iIapNameArray; |
|
118 |
||
119 |
RArray<TPodcastIAPItem> iSNAPIdArray; |
|
120 |
CDesCArrayFlat* iSNAPNameArray; |
|
121 |
CCommsDatabase* iCommDB; |
|
122 |
||
123 |
sqlite3* iDB; |
|
124 |
RCmManager iCmManager; |
|
125 |
TBool iIsFirstStartup; |
|
126 |
CImageHandler* iImageHandler; |
|
127 |
}; |
|
128 |
||
129 |
#endif // PODCASTMODEL_H |