author | Sebastian Brannstrom <sebastianb@symbian.org> |
Thu, 28 Oct 2010 22:27:12 +0100 | |
branch | RCL_3 |
changeset 299 | 56d23cf60795 |
parent 133 | 5f9e7e14eb11 |
child 367 | 4b75876aa85a |
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> |
|
299
56d23cf60795
Fixes for issues using #define with raptor
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
133
diff
changeset
|
28 |
#include "defines.h" |
2 | 29 |
#include "FeedInfo.h" |
30 |
#include "ShowInfo.h" |
|
31 |
#include "debug.h" |
|
116 | 32 |
#include <sqlite3.h> |
2 | 33 |
#include "ImageHandler.h" |
133
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
34 |
#include <aknserverapp.h> // MAknServerAppExitObserver |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
35 |
#include <DocumentHandler.h> |
2 | 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 |
*/ |
|
133
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
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(); |
|
116 | 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:
8
diff
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(); |
|
116 | 102 |
void ResetDB(); |
109 | 103 |
void OpenDBL(); |
2 | 104 |
// From ImageHandler |
133
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
105 |
void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel); |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
106 |
|
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
107 |
private: // Functions from base classes |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
108 |
|
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
109 |
/** |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
110 |
* From MAknServerAppExitObserver. |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
111 |
* Handles the exit of a connected server application. |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
112 |
*/ |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
113 |
void HandleServerAppExit(TInt aReason); |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
114 |
|
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
115 |
private: // Private functions |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
116 |
void LaunchFileEmbeddedL(const TDesC& aFilename); |
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
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; |
|
133
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
116
diff
changeset
|
140 |
CDocumentHandler* iDocHandler; |
2 | 141 |
}; |
142 |
||
143 |
#endif // PODCASTMODEL_H |