|
1 /* |
|
2 * Copyright (c) 2008-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 "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 #ifndef C_CCCHUICCHHANDLER_H |
|
20 #define C_CCCHUICCHHANDLER_H |
|
21 |
|
22 #include <cch.h> |
|
23 #include "cchuicommon.hrh" |
|
24 |
|
25 /** |
|
26 * CCH Handler. |
|
27 * This class implements CCH handling. |
|
28 * |
|
29 * @code |
|
30 * // Create intance and get snap used by service. |
|
31 * iCCHHandler = CCchUiCchHandler::NewL(); |
|
32 * TInt serviceId( KServiceId ); |
|
33 * TInt snapId( KErrNone ); |
|
34 * iCCHHandler->GetConnectionSnapId( serviceId, snapId ); |
|
35 * @endcode |
|
36 * |
|
37 * @lib cchui.lib |
|
38 * @since S60 5.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CCchUiCchHandler ) : public CBase |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CCchUiCchHandler* NewL( CCch& aCch ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CCchUiCchHandler(); |
|
53 |
|
54 |
|
55 /** |
|
56 * Get snap id. |
|
57 * |
|
58 * @since S60 5.0 |
|
59 * @param aServiceId Service id. |
|
60 * @param aSnapId Snap id will be stored here. |
|
61 * @param aErr error code |
|
62 */ |
|
63 void GetConnectionSnapIdL( TInt aServiceId, TInt& aSnapId, TInt& aErr ); |
|
64 |
|
65 /** |
|
66 * Set snap id. |
|
67 * |
|
68 * @since S60 5.0 |
|
69 * @param aServiceId Service id. |
|
70 * @param aSnapId Snap id to be set. |
|
71 * @param aErr error code. |
|
72 */ |
|
73 void SetConnectionSnapIdL( TInt aServiceId, TInt aSnapId, TInt& aErr ); |
|
74 |
|
75 /** |
|
76 * Get service username. |
|
77 * |
|
78 * @since S60 5.0 |
|
79 * @param aServiceId Service id. |
|
80 * @param aUserName service username. |
|
81 * @param aErr error code. |
|
82 */ |
|
83 void GetUsernameL( TInt aServiceId, RBuf& aUserName, TInt& aErr ); |
|
84 |
|
85 /** |
|
86 * Set username for service. |
|
87 * |
|
88 * @since S60 5.0 |
|
89 * @param aResultParams Contains needed info to set username. |
|
90 * @param aErr |
|
91 */ |
|
92 void SetUsernameL( TCCHUiNotifierParams aResultParams, TInt& aErr ); |
|
93 |
|
94 /** |
|
95 * Set password for service. |
|
96 * |
|
97 * @since S60 5.0 |
|
98 * @param aResultParams Contains needed info to set password. |
|
99 * @param aErr error code. |
|
100 */ |
|
101 void SetPasswordL( TCCHUiNotifierParams aResultParams, TInt& aErr ); |
|
102 |
|
103 /** |
|
104 * Starts observing for service events for service specified |
|
105 * by aServiceId. |
|
106 * |
|
107 * @since S60 5.0 |
|
108 * @param aServiceId service identifier |
|
109 * @param aObserver observer for service events |
|
110 */ |
|
111 void StartObservingL( |
|
112 TUint aServiceId, |
|
113 MCchServiceStatusObserver& aObserver ); |
|
114 |
|
115 /** |
|
116 * Stops observing for specific service defined by aServiceId |
|
117 * |
|
118 * @since S60 5.0 |
|
119 * @param aServiceId service identifier |
|
120 * @param aObserver observer for service events |
|
121 */ |
|
122 void StopObservingL( |
|
123 TUint aServiceId, |
|
124 MCchServiceStatusObserver& aObserver ); |
|
125 |
|
126 /** |
|
127 * For checking service state. |
|
128 * |
|
129 * @since S60 5.0 |
|
130 * @param aServiceId service identifier |
|
131 * @param aSubServiceType subservice type |
|
132 * @param aErr Symbian error code |
|
133 * @return subservice state |
|
134 */ |
|
135 TCCHSubserviceState GetServiceStateL( |
|
136 TUint aServiceId, |
|
137 TCCHSubserviceType aSubServiceType, |
|
138 TInt& aErr ); |
|
139 |
|
140 /** |
|
141 * For getting current connections iap id. |
|
142 * Is left as zero if no current connection exists. |
|
143 * |
|
144 * @since S60 5.0 |
|
145 * @param aServiceId service identifier |
|
146 * @param aSubServiceType subservice type |
|
147 * @param aIapId current connection iap id to be stored here |
|
148 * @param aErr error code to be stored here |
|
149 */ |
|
150 void GetCurrentConnectionIapIdL( |
|
151 TUint aServiceId, |
|
152 TCCHSubserviceType aSubServiceType, |
|
153 TInt& aIapId, |
|
154 TInt& aErr ); |
|
155 |
|
156 /** |
|
157 * Enables service |
|
158 * |
|
159 * @since S60 5.0 |
|
160 * @param aServiceId service identifier |
|
161 */ |
|
162 void EnableL( TUint aServiceId ); |
|
163 |
|
164 /** |
|
165 * Disables service |
|
166 * |
|
167 * @since S60 5.0 |
|
168 * @param aServiceId service identifier |
|
169 */ |
|
170 void DisableL( TUint aServiceId ); |
|
171 |
|
172 /** |
|
173 * For checking if all subservices are disabled |
|
174 * |
|
175 * @since S60 5.0 |
|
176 * @param aServiceId service identifier |
|
177 * @param aState checked state |
|
178 * @return ETrue if all subservices are in checked state |
|
179 */ |
|
180 TBool AllSubservicesInStateL( TUint aServiceId, |
|
181 TCCHSubserviceState aState ); |
|
182 |
|
183 private: |
|
184 |
|
185 CCchUiCchHandler( CCch& aCch ); |
|
186 |
|
187 private: // data |
|
188 |
|
189 /** |
|
190 * Handle to CCH Client API. |
|
191 * Not own. |
|
192 */ |
|
193 CCch& iCchClientApi; |
|
194 |
|
195 CCHUI_UNIT_TEST( UT_CchUi ) |
|
196 }; |
|
197 |
|
198 #endif // C_CCCHUICCHHANDLER_H |