|
1 /* |
|
2 * Copyright (c) 2009 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 VCXNSCONTENTCLIENTHANDLER_H_ |
|
22 #define VCXNSCONTENTCLIENTHANDLER_H_ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 #include "MIptvVodContentClientObserver.h" |
|
28 #include <ipvideo/vcxconnutilengineobserver.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CIptvVodContentClient; |
|
32 class CVcxNsUiEngine; |
|
33 class CVcxConnectionUtility; |
|
34 |
|
35 // TYPEDEFS |
|
36 typedef TUint32 TIptvServiceId; |
|
37 |
|
38 /** |
|
39 * Class CVcxNsContentClientHandler handles content client interactions. |
|
40 * |
|
41 * @lib vcxnsuiengine.lib |
|
42 */ |
|
43 class CVcxNsContentClientHandler : public CBase, |
|
44 public MIptvVodContentClientObserver, |
|
45 public MConnUtilEngineObserver |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Constructor. |
|
52 * |
|
53 * @param aUiEngine Ui engine |
|
54 * @param aConnUtil Connection util |
|
55 */ |
|
56 static CVcxNsContentClientHandler* CVcxNsContentClientHandler::NewL( |
|
57 CVcxNsUiEngine& aUiEngine, CVcxConnectionUtility& aConnUtil ); |
|
58 |
|
59 virtual ~CVcxNsContentClientHandler(); |
|
60 |
|
61 /** |
|
62 * Returns content management client. |
|
63 * @return Pointer to CIptvVodContentClient object. |
|
64 */ |
|
65 CIptvVodContentClient* GetVodContentClientL( TUint32 aServiceId ); |
|
66 |
|
67 /** |
|
68 * Updates the given service's ecg. |
|
69 * This causes the iap to be reasked if necessary. |
|
70 * |
|
71 * @param aServiceId Service id |
|
72 * @return Error code |
|
73 */ |
|
74 TInt UpdateEcgL( TUint32 aServiceId ); |
|
75 |
|
76 /** |
|
77 * Stores mpx media id to content database. |
|
78 * @param aServiceId Service id |
|
79 * @param aContentId Content id |
|
80 * @param aCaIndex Content access index |
|
81 * @param aMpxId Mpx id. |
|
82 */ |
|
83 void StoreMpxIdToEcgDbL( TUint32 aServiceId, |
|
84 TUint32 aContentId, |
|
85 TUint32 aCaIndex, |
|
86 TUint32 aMpxId ); |
|
87 |
|
88 |
|
89 /** |
|
90 * Stores Last Playing Position to content database. |
|
91 * @param aServiceId Service id |
|
92 * @param aContentId Content id |
|
93 * @param aCaIndex Content access index |
|
94 * @param aPos Last play pos. |
|
95 */ |
|
96 void StoreLastPlayPosL( TUint32 aServiceId, |
|
97 TUint32 aContentId, |
|
98 TUint32 aCaIndex, |
|
99 TReal32 aPos ); |
|
100 |
|
101 // From MIptvVodContentClientObserver |
|
102 |
|
103 /** |
|
104 * Messages from EPG manager are handled here. Messages are defined in CIptvUtil.h |
|
105 * @since Engine 1.1 |
|
106 * @param aMsg Message |
|
107 * @param aInfo Info |
|
108 * @param aServiceId Service id. |
|
109 */ |
|
110 void HandleEpgManagerMsgL( TInt aMsg, TInt aInfo, TIptvServiceId aServiceId ); |
|
111 |
|
112 // from MConnUtilEngineObserver |
|
113 |
|
114 /** |
|
115 * This method is called by the vcxconnectionutility when |
|
116 * it has received a notification about the availibility of |
|
117 * "better" iap in the network. This might happen |
|
118 * when WLAN defined in the corresponding destination becomes |
|
119 * available or when WLAN carrier is lost and there is defined |
|
120 * 3G/gprs iap (or another available WLAN) in the destination |
|
121 * being used. |
|
122 * |
|
123 * Client don't have to accept the changing of the iap. If client |
|
124 * returns EFalse notifying it does not want to roam, then the |
|
125 * iap will not be changed. |
|
126 * |
|
127 * This however might result in diconnecting, if the old iap is |
|
128 * no longer available, like it would happen when WLAN carrier is lost |
|
129 * |
|
130 * @return TBool ETrue: roaming accepted, EFalse: Roaming not accepted |
|
131 */ |
|
132 TBool RequestIsRoamingAllowedL(); |
|
133 |
|
134 /** |
|
135 * This method is called by the vcxconnectionutility when |
|
136 * there have been some change in the iap currently using: |
|
137 * |
|
138 * Connection lost: this happens when for example WLAN carrier |
|
139 * is lost and there is no other iap to use to or when corresponding |
|
140 * connection is closed by some other application. |
|
141 * |
|
142 * Iap change by the roaming: if client has accepted roaming |
|
143 * vcxconnectionutility notifies about new iap is ready to use |
|
144 * |
|
145 * When client is being called by this method, it can request a |
|
146 * iap id by calling CVcxConnectionUtility::GetIap- |
|
147 */ |
|
148 void IapChangedL(); |
|
149 |
|
150 /** |
|
151 * Return iap query status. |
|
152 * |
|
153 * @return ETrue if connection for service has been created or |
|
154 * will be triggered via MIptvVodContentClientObserver |
|
155 * interface, otherwise EFalse |
|
156 */ |
|
157 TBool IapAsked( TUint32 aServiceId ); |
|
158 |
|
159 /** |
|
160 * Set specified service iap query status. |
|
161 * |
|
162 * @param aServiceId the service id, that value is to be set. |
|
163 * @param aSet Value to be set to iap asked flag |
|
164 */ |
|
165 void SetIapAsked( TUint32 aServiceId, TBool aSet ); |
|
166 |
|
167 private: |
|
168 |
|
169 |
|
170 /** |
|
171 * Constructor. |
|
172 * |
|
173 * @param aUiEngine Ui engine |
|
174 * @param aConnUtil Connection util |
|
175 */ |
|
176 CVcxNsContentClientHandler( CVcxNsUiEngine& aUiEngine, |
|
177 CVcxConnectionUtility& aConnUtil ); |
|
178 |
|
179 /** |
|
180 * Private 2nd phase construction. |
|
181 */ |
|
182 void ConstructL(); |
|
183 |
|
184 // Data |
|
185 |
|
186 /** |
|
187 * Pointers to VOD Content Clients. |
|
188 * Own. |
|
189 */ |
|
190 RPointerArray<CIptvVodContentClient> iVodContentClients; |
|
191 |
|
192 /** |
|
193 * Array of content client service id's. |
|
194 */ |
|
195 RArray<TInt> iVodContentClientIds; |
|
196 |
|
197 /** |
|
198 * Array of flags, if the iap query is needed for service |
|
199 * This must be set to ETrue by default. If user cancels in |
|
200 * connection creation dialog, then set to EFalse |
|
201 */ |
|
202 RArray<TBool> iIapAsked; |
|
203 |
|
204 /** |
|
205 * CVcxNsUiEngine |
|
206 */ |
|
207 CVcxNsUiEngine& iUiEngine; |
|
208 |
|
209 /** |
|
210 * Reference to connection utility |
|
211 */ |
|
212 CVcxConnectionUtility& iConnUtil; |
|
213 |
|
214 }; |
|
215 |
|
216 #endif /*VCXNSCONTENTCLIENTHANDLER_H_*/ |