|
1 /* |
|
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CIPTVEPGMANAGERIMPL_H |
|
22 #define CIPTVEPGMANAGERIMPL_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include "CIptvUtil.h" |
|
27 #include "MIptvServiceManagerObserver.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 class CIptvEpgDatabase; |
|
32 class CIptvServer; |
|
33 class CIptvEpgSession; |
|
34 class CIptvSmEvent; |
|
35 class CIptvEpgVodMsqQueue; |
|
36 class CIptvEpgDb; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 class CIptvEpgManagerImpl : public CBase, public MIptvServiceManagerObserver |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param |
|
46 */ |
|
47 static CIptvEpgManagerImpl* NewL(CIptvServer& aServer); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CIptvEpgManagerImpl(); |
|
53 |
|
54 /** |
|
55 * Creates EPG session. |
|
56 * |
|
57 * @param aServiceId Service id. |
|
58 * @param aMsgQueue Pointer to Vod Message Queue for the session. |
|
59 * @param aError Reference to variable where possible error is stored. |
|
60 * @param aPluginCanRun Defines is plugin (related to session) is allowed to run. |
|
61 * @return Pointer to new session. |
|
62 */ |
|
63 CIptvEpgSession* CreateSessionL(TUint32 aServiceId, CIptvEpgVodMsqQueue* aMsgQueue, TInt& aError, TBool aPluginCanRun = ETrue); |
|
64 |
|
65 /** |
|
66 * Close session. |
|
67 * @param aServiceId Service id. |
|
68 */ |
|
69 void CloseSession(TUint32 aServiceId); |
|
70 |
|
71 public: // From MIptvServiceManagerObserver |
|
72 |
|
73 /** |
|
74 * CIptvServiceManager calls this every time a service is |
|
75 * modified in the database. |
|
76 * @param aServiceId |
|
77 */ |
|
78 void HandleSmEvent(CIptvSmEvent& aEvent); |
|
79 |
|
80 private: // New functions |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 */ |
|
85 CIptvEpgManagerImpl(CIptvServer& aServer); |
|
86 |
|
87 /** |
|
88 * By default Symbian 2nd phase constructor is private. |
|
89 * @param |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 private: |
|
94 |
|
95 class CDbHolder : public CBase |
|
96 { |
|
97 public: |
|
98 CDbHolder() {} |
|
99 virtual ~CDbHolder(); |
|
100 |
|
101 TUint32 iServiceId; |
|
102 CIptvEpgDb* iEpgDb; |
|
103 CIptvEpgDatabase* iLiveTvDb; |
|
104 TInt iReferenceCount; |
|
105 }; |
|
106 |
|
107 /** |
|
108 * Return the database holder for the service id, create if not found already. |
|
109 * |
|
110 * @param aServiceId The service id. |
|
111 * @param aEpgDb Create epg (ETrue) or live tv (EFalse) database. |
|
112 * @return The databse holder from the list. |
|
113 */ |
|
114 CDbHolder* GetDatabaseHolderL( TUint32 aServiceId, TBool aEpgDb ); |
|
115 |
|
116 private: // Data members |
|
117 CIptvServer& iServer; |
|
118 RPointerArray<CDbHolder> iEpgDbArray; |
|
119 RFs iFs; |
|
120 }; |
|
121 |
|
122 #endif // CIPTVEPGMANAGERIMPL_H |
|
123 |
|
124 // End of File |