author | teknolog |
Sun, 04 Apr 2010 16:23:10 +0100 | |
changeset 77 | 403412eb5292 |
parent 76 | 223f270fa7ff |
child 80 | 50345a6ad0c3 |
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 GetAllShowsL(); |
92 |
IMPORT_C void GetNewShowsL(); |
|
93 |
IMPORT_C void GetShowsDownloadedL(); |
|
94 |
IMPORT_C void GetShowsDownloadingL(); |
|
95 |
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
|
96 |
IMPORT_C void MarkSelectionPlayedL(); |
2 | 97 |
|
98 |
TInt FindActiveShowByUid(TUint aUid); |
|
99 |
IMPORT_C TBool IsFirstStartup(); |
|
100 |
IMPORT_C CImageHandler& ImageHandler(); |
|
101 |
protected: |
|
102 |
CPodcastModel(); |
|
103 |
void ConstructL(); |
|
76 | 104 |
|
105 |
void OpenDBL(); |
|
2 | 106 |
// 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
|
107 |
void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel); |
2 | 108 |
private: |
109 |
CShowInfo* iPlayingPodcast; |
|
110 |
||
111 |
CFeedEngine* iFeedEngine; |
|
112 |
CShowEngine* iShowEngine; |
|
113 |
CSettingsEngine *iSettingsEngine; |
|
114 |
CConnectionEngine* iConnectionEngine; |
|
115 |
RShowInfoArray iActiveShowList; |
|
116 |
CFeedInfo *iActiveFeed; |
|
117 |
||
118 |
RFs iFsSession; |
|
119 |
RArray<TPodcastIAPItem> iIapIdArray; |
|
120 |
CDesCArrayFlat* iIapNameArray; |
|
121 |
||
122 |
RArray<TPodcastIAPItem> iSNAPIdArray; |
|
123 |
CDesCArrayFlat* iSNAPNameArray; |
|
124 |
CCommsDatabase* iCommDB; |
|
125 |
||
126 |
sqlite3* iDB; |
|
127 |
RCmManager iCmManager; |
|
128 |
TBool iIsFirstStartup; |
|
129 |
CImageHandler* iImageHandler; |
|
130 |
}; |
|
131 |
||
132 |
#endif // PODCASTMODEL_H |