|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Object to offer some common utility functions to Iptv engine testing* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CIPTVTESTSMAPIUTIL_H |
|
21 #define CIPTVTESTSMAPIUTIL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "CIptvIapList.h" |
|
25 #include <D32DBMS.H> |
|
26 #include <S32FILE.H> |
|
27 |
|
28 #include "CIptvService.h" |
|
29 #include "CIptvServiceManagementClient.h" |
|
30 #include "MIptvServiceManagementClientObserver.h" |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // MACROS |
|
35 |
|
36 // DATA TYPES |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class CIptvTestActiveWait; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CIptvTestSMApiUtil |
|
47 * |
|
48 * @since |
|
49 */ |
|
50 class CIptvTestSMApiUtil : public CBase, public MIptvServiceManagementClientObserver |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CIptvTestSMApiUtil* NewL(); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CIptvTestSMApiUtil(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * GetUsedIap |
|
68 */ |
|
69 TBool GetUsedIap(TUint32 aServiceId, TUint32& aIAPId,TDes& aIapName); |
|
70 |
|
71 /** |
|
72 * Gets service from service cache which should be up to date. |
|
73 */ |
|
74 CIptvService* GetServiceFromDb(TInt aId); |
|
75 |
|
76 /** |
|
77 * Gets services from SM client. |
|
78 * @param aServicesArray array where services will be added |
|
79 * @param aFlagsFilter only services with these flags will be added, use 0 to skip flags test |
|
80 * @param aOrder CIptvServiceManagementClient::TOrder enumeration to sort the services array or -1 to use no sort |
|
81 */ |
|
82 TBool GetServicesFromDbL(RPointerArray<CIptvService>& aServicesArray, TUint32 aFlagsFilter, CIptvServiceManagementClient::TOrder aOrder); |
|
83 |
|
84 /** |
|
85 * Gets services from service cache which should be up to date. |
|
86 * @param aServicesArray array where services will be added |
|
87 */ |
|
88 TBool GetServicesFromDbL(RPointerArray<CIptvService>& aServicesArray); |
|
89 |
|
90 /** |
|
91 * SetUsedIap |
|
92 */ |
|
93 TInt SetUsedIap(TUint32 aServiceId, TUint32 aIapId); |
|
94 |
|
95 /** |
|
96 * Creates a copy of the service with same name and deletes the original. |
|
97 */ |
|
98 TInt RefreshService(TUint32 aServiceId, TTime aLastDownloadTime); |
|
99 |
|
100 public: // From base classes |
|
101 |
|
102 /** |
|
103 * AddServiceResp |
|
104 */ |
|
105 void AddServiceResp(TRespStatus /*aRespStatus*/){}; |
|
106 |
|
107 /** |
|
108 * UpdateServiceResp |
|
109 */ |
|
110 void UpdateServiceResp(TRespStatus /*aRespStatus*/){}; |
|
111 |
|
112 /** |
|
113 * DeleteServiceResp |
|
114 */ |
|
115 void DeleteServiceResp(TRespStatus /*aRespStatus*/){}; |
|
116 |
|
117 /** |
|
118 * GetServicesResp |
|
119 */ |
|
120 void GetServicesResp(TRespStatus aRespStatus, CDesC8ArraySeg* aServicesArray); |
|
121 |
|
122 /** |
|
123 * ServerShutdownResp |
|
124 */ |
|
125 void ServerShutdownResp(TRespStatus /*aRespStatus*/){}; |
|
126 |
|
127 /** |
|
128 * GetUsedIapResp |
|
129 */ |
|
130 void GetUsedIapResp(TUint32 /*aIapId*/, |
|
131 const TDesC& /*aIapName*/, |
|
132 CIptvNetworkSelection::TConnectionPermission /*aConnectionPermission*/, |
|
133 TBool /* aWlanWhenGPRS */, |
|
134 CIptvNetworkSelection::TRespStatus /*aRespStatus*/){}; |
|
135 |
|
136 /** |
|
137 * HandleSmEvent |
|
138 * Callback for Service Manager generated events. |
|
139 * @param aEvent |
|
140 */ |
|
141 void HandleSmEvent(CIptvSmEvent& aEvent ); |
|
142 |
|
143 private: |
|
144 |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CIptvTestSMApiUtil(); |
|
149 |
|
150 /** |
|
151 * By default Symbian 2nd phase constructor is private. |
|
152 */ |
|
153 void ConstructL(); |
|
154 |
|
155 /** |
|
156 * Refreshes iServicesArray |
|
157 */ |
|
158 TBool RefreshServicesL(); |
|
159 |
|
160 /** |
|
161 * IsServiceIncludedInSearch |
|
162 */ |
|
163 TBool IsServiceIncludedInSearch(TUint32 aSearchLimitFlags, CIptvService& aIptvService); |
|
164 |
|
165 /* |
|
166 * CopyServiceL |
|
167 */ |
|
168 CIptvService* CopyServiceL( CIptvService& aService ); |
|
169 |
|
170 private: // Data |
|
171 |
|
172 CIptvTestActiveWait* iActiveWait; |
|
173 |
|
174 CIptvServiceManagementClient* iIptvServiceManagementClient; |
|
175 |
|
176 //For use of iServicesFileStore / iPasswordsFileStore |
|
177 RFs iFsSession; |
|
178 |
|
179 // Response status of ServiceManager is stored here |
|
180 TRespStatus iSMRespStatus; |
|
181 |
|
182 // |
|
183 RPointerArray<CIptvService> iServicesArray; |
|
184 |
|
185 // |
|
186 TBool iRefreshingServices; |
|
187 |
|
188 |
|
189 TBool iRefreshNeeded; |
|
190 }; |
|
191 |
|
192 #endif // CIPTVTESTSMAPIUTIL_H |
|
193 |
|
194 // End of File |