|
1 /* |
|
2 * Copyright (c) 2008 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 "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: conecction provider plugin implementation class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_ICPPLUGIN_H |
|
20 #define C_ICPPLUGIN_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <cchservice.h> |
|
25 #include "imserviceobserver.h" |
|
26 |
|
27 |
|
28 class CIcpServiceManager; |
|
29 |
|
30 /** |
|
31 * CIcpPlugin class |
|
32 * @lib imconnectionprovider.dll |
|
33 */ |
|
34 class CIcpPlugin : public CCchService, |
|
35 public MImServiceObserver |
|
36 { |
|
37 |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor |
|
42 */ |
|
43 static CIcpPlugin* NewL( TAny* aParam ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CIcpPlugin(); |
|
49 |
|
50 public : // from base class CCHService |
|
51 |
|
52 /** |
|
53 * Client enables service. CCHService implementation |
|
54 * should use MCCHServiceObserver for service state notifications. |
|
55 * @see MCCHServiceObserver |
|
56 * @param aServiceSelection Service selection |
|
57 */ |
|
58 void EnableServiceL( const TServiceSelection& aServiceSelection ); |
|
59 |
|
60 /** |
|
61 * Client enables service. CCHService implementation |
|
62 * should use MCCHServiceObserver for service state notifications. |
|
63 * @see MCCHServiceObserver |
|
64 * @param aServiceSelection Service selection |
|
65 * @param aIapId Iap id |
|
66 */ |
|
67 void EnableServiceL( const TServiceSelection& aServiceSelection, |
|
68 TUint aIapId ); |
|
69 |
|
70 /** |
|
71 * Client disables service. |
|
72 * @param aServiceId |
|
73 */ |
|
74 void DisableServiceL( const TServiceSelection& aServiceSelection ); |
|
75 |
|
76 /** |
|
77 * Client checks is the service available by the IAP id array. |
|
78 * CCHService implementation should return ETrue if service is |
|
79 * registrable by the (some) IAP, array contains. |
|
80 * @param aServiceSelection Service selection |
|
81 * @param aIapIdArray Id array of the currently available iaps. |
|
82 * @return ETrue if service is available. |
|
83 */ |
|
84 TBool IsAvailableL( const TServiceSelection& aServiceSelection, |
|
85 const RArray<TUint32>& aIapIdArray ) const; |
|
86 |
|
87 /** |
|
88 * Get service state information. |
|
89 * @param aServiceSelection Service selection |
|
90 * @param aState Current service state. |
|
91 * @return General symbian error code. |
|
92 */ |
|
93 TInt GetServiceState( const TServiceSelection& aServiceSelection, |
|
94 TCCHSubserviceState& aState ) const; |
|
95 |
|
96 /** |
|
97 * Get service network information. |
|
98 * @param aConnectionInfo Connection info |
|
99 * @return General symbian error code. |
|
100 */ |
|
101 TInt GetServiceNetworkInfo( TServiceConnectionInfo& aConnectionInfo ) const; |
|
102 |
|
103 /** |
|
104 * Set Snap id for service. |
|
105 * @param aServiceSelection Service selection |
|
106 * @return General symbian error code. |
|
107 */ |
|
108 TInt SetSnapId( const TServiceSelection& aServiceSelection, |
|
109 TUint aSnapId ); |
|
110 |
|
111 /** |
|
112 * Set IAP id for service. |
|
113 * @param aServiceSelection Service selection |
|
114 * @param aIapId |
|
115 * @return General symbian error code. |
|
116 */ |
|
117 TInt SetIapId( const TServiceSelection& aServiceSelection, |
|
118 TUint aIapId ); |
|
119 |
|
120 /** |
|
121 * Get service specifics information about service and protocol |
|
122 * @param aServiceSelection Service selection |
|
123 * @param aBuffer Info will be inserted to this buffer |
|
124 */ |
|
125 void GetServiceInfoL( const TServiceSelection& aServiceSelection, |
|
126 RBuf& aBuffer ) const; |
|
127 |
|
128 /** |
|
129 * Reserves the service for exclusive use |
|
130 * @param aServiceSelection Selected service, ID and type |
|
131 * @return General symbian error code. |
|
132 */ |
|
133 TInt ReserveService( const TServiceSelection& aServiceSelection ); |
|
134 |
|
135 /** |
|
136 * Frees the exclusive service reservation |
|
137 * @param aServiceSelection Selected service, ID and type |
|
138 * @return General symbian error code. |
|
139 */ |
|
140 TInt FreeService( const TServiceSelection& aServiceSelection ); |
|
141 |
|
142 /** |
|
143 * Is the service reserved |
|
144 * @param aServiceSelection Selected service, ID and type |
|
145 * @return TBool |
|
146 */ |
|
147 TBool IsReserved( const TServiceSelection& aServiceSelection ) const; |
|
148 |
|
149 public : // from base class MSCPServiceObserver |
|
150 |
|
151 /** |
|
152 * Service state observer. |
|
153 * @since S60 5.0 |
|
154 * @param aServiceId |
|
155 * @param aState a new state of the service. |
|
156 */ |
|
157 void ServiceStateChanged( |
|
158 const TUint aServiceId, |
|
159 const TCCHSubserviceType aSubService, |
|
160 TCCHSubserviceState aState, |
|
161 TInt aError ); |
|
162 |
|
163 /** |
|
164 * Returns the connection parameters |
|
165 * @since S60 3.2.3 |
|
166 * @param aServiceSelection Selected service, ID and type |
|
167 * @param aParameter Connection parameter of the service |
|
168 * @param aValue Value of the parameter |
|
169 * @return Symbian error code |
|
170 */ |
|
171 TInt GetConnectionParameter( |
|
172 const TServiceSelection& aServiceSelection, |
|
173 TCchConnectionParameter aParameter, |
|
174 TInt& aValue ) const; |
|
175 |
|
176 /** |
|
177 * Returns the connection parameters |
|
178 * @since S60 3.2.3 |
|
179 * @param aServiceSelection Selected service, ID and type |
|
180 * @param aParameter Connection parameter of the service |
|
181 * @param aValue Value of the parameter |
|
182 * @return Symbian error code |
|
183 */ |
|
184 TInt GetConnectionParameter( |
|
185 const TServiceSelection& aServiceSelection, |
|
186 TCchConnectionParameter aParameter, |
|
187 RBuf& aValue ) const; |
|
188 |
|
189 /** |
|
190 * Sets the connection parameters |
|
191 * @since S60 3.2.3 |
|
192 * @param aServiceSelection Selected service, ID and type |
|
193 * @param aParameter Connection parameter of the service |
|
194 * @param aValue Value of the parameter |
|
195 * @return Symbian error code |
|
196 */ |
|
197 TInt SetConnectionParameter( |
|
198 const TServiceSelection& aServiceSelection, |
|
199 TCchConnectionParameter aParameter, |
|
200 TInt aValue ); |
|
201 |
|
202 /** |
|
203 * Sets the connection parameters |
|
204 * @since S60 3.2.3 |
|
205 * @param aServiceSelection Selected service, ID and type |
|
206 * @param aParameter Connection parameter of the service |
|
207 * @param aValue Value of the parameter |
|
208 * @return Symbian error code |
|
209 */ |
|
210 TInt SetConnectionParameter( |
|
211 const TServiceSelection& aServiceSelection, |
|
212 TCchConnectionParameter aParameter, |
|
213 const TDesC& aValue ); |
|
214 |
|
215 |
|
216 private: |
|
217 |
|
218 /** |
|
219 * Constructor is hidden |
|
220 */ |
|
221 CIcpPlugin( MCchServiceObserver& aServiceObserver ); |
|
222 |
|
223 /** |
|
224 * 2nd phase constructor |
|
225 */ |
|
226 void ConstructL(); |
|
227 |
|
228 private: |
|
229 |
|
230 /** |
|
231 * Service manager. Own |
|
232 */ |
|
233 CIcpServiceManager* iServiceManager; |
|
234 |
|
235 /** |
|
236 * not owns : CCH service observer. |
|
237 */ |
|
238 MCchServiceObserver& iServiceObserver; |
|
239 |
|
240 }; |
|
241 |
|
242 #endif // C_SCPPLUGIN_H |
|
243 |
|
244 // End of file |
|
245 |