|
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 "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: s_cch.h |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MyCchServiceH |
|
19 #define MyCchServiceH |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <cch.h> |
|
23 #define KMECOIMPLEMENTATIONUID 0x20012423 |
|
24 const TInt KTestServiceId = 255; |
|
25 |
|
26 _LIT( KTestServiceName, "TEST_SERVICE" ); |
|
27 _LIT(KTestUserName, "testlm123@gmail.com"); |
|
28 _LIT(KOwnUserNameMatch,"gizmo:Sharath"); // dont change this value |
|
29 _LIT(KTestPassword, "password"); |
|
30 _LIT(KTestDescription, "error"); |
|
31 |
|
32 TInt CreateSpEntryL( TInt aServiceId ); |
|
33 class MyCchService : public CCchService |
|
34 { |
|
35 TInt Enable( TCCHSubserviceType aType ); |
|
36 |
|
37 /** |
|
38 * Launches service disable. See MCchServiceObserver for status changes. |
|
39 * |
|
40 * @param aType Type of service |
|
41 * @return Symbian error |
|
42 */ |
|
43 TInt Disable( TCCHSubserviceType aType ); |
|
44 |
|
45 /** |
|
46 * Returns the current service state |
|
47 * |
|
48 * @param aType Type of service |
|
49 * @param aStatus Status of the service, return value |
|
50 * @return Symbian error code |
|
51 */ |
|
52 TInt GetStatus( TCCHSubserviceType aType, |
|
53 TCchServiceStatus& aStatus ) const ; |
|
54 |
|
55 /** |
|
56 * Returns the connection parameters |
|
57 * |
|
58 * @param aType Type of service |
|
59 * @param aParameter Connection parameter of the service |
|
60 * @param aValue Value of the parameter |
|
61 * @return Symbian error code |
|
62 */ |
|
63 TInt GetConnectionParameter( TCCHSubserviceType aType, |
|
64 TCchConnectionParameter aParameter, TInt& aValue ) const; |
|
65 |
|
66 /** |
|
67 * Returns the connection parameters |
|
68 * |
|
69 * @param aType Type of service |
|
70 * @param aParameter Connection parameter of the service |
|
71 * @param aValue Value of the parameter |
|
72 * @return Symbian error code |
|
73 */ |
|
74 TInt GetConnectionParameter( TCCHSubserviceType aType, |
|
75 TCchConnectionParameter aParameter, RBuf& aValue ) const; |
|
76 |
|
77 /** |
|
78 * Sets the connection parameters |
|
79 * |
|
80 * @param aType The type of service |
|
81 * @param aParameter Connection parameter of the service |
|
82 * @param aValue Value of the parameter |
|
83 * @return Symbian error code |
|
84 */ |
|
85 TInt SetConnectionParameter( TCCHSubserviceType aType, |
|
86 TCchConnectionParameter aParameter, TInt aValue ); |
|
87 |
|
88 /** |
|
89 * Sets the connection parameters |
|
90 * |
|
91 * @param aType The type of service |
|
92 * @param aParameter Connection parameter of the service |
|
93 * @param aValue Value of the parameter |
|
94 * @return Symbian error code |
|
95 */ |
|
96 TInt SetConnectionParameter( TCCHSubserviceType aType, |
|
97 TCchConnectionParameter aParameter, const TDesC& aValue ); |
|
98 |
|
99 /** |
|
100 * Reserves the service for exclusive usage |
|
101 * |
|
102 * @param aType Type of service |
|
103 * @return Symbian error code |
|
104 */ |
|
105 TInt Reserve( TCCHSubserviceType aType ); |
|
106 |
|
107 /** |
|
108 * Frees the service of exclusive usage |
|
109 * |
|
110 * @param aType Type of service |
|
111 * @return Symbian error code |
|
112 */ |
|
113 TInt Free( TCCHSubserviceType aType ); |
|
114 |
|
115 /** |
|
116 * Is the service reserved |
|
117 * |
|
118 * @param aType Type of service |
|
119 * @param aReserved True if the service is reserved |
|
120 * @return Symbian error code |
|
121 */ |
|
122 TInt IsReserved( TCCHSubserviceType aType, TBool& aReserved ) const; |
|
123 |
|
124 /** |
|
125 * Returns the service id |
|
126 * |
|
127 * @return The id of the service |
|
128 */ |
|
129 TInt ServiceId() const; |
|
130 |
|
131 /** |
|
132 * @deprecated Do not use this anymore, change to AddObserver! |
|
133 * |
|
134 * Adds observer for listening service events |
|
135 * |
|
136 * @param aObserver Event observing class |
|
137 */ |
|
138 void SetObserver( MCchServiceStatusObserver& aObserver ); |
|
139 |
|
140 /** |
|
141 * @deprecated Do not use this anymore, change to |
|
142 * RemoveObserver method with paramater |
|
143 * |
|
144 * Removes the observer of service events |
|
145 */ |
|
146 void RemoveObserver( ); |
|
147 |
|
148 /** |
|
149 * Adds observer for listening service events |
|
150 * |
|
151 * @param aObserver Event observing class |
|
152 * @return KErrAlreadyExist Observer already added |
|
153 * KErrNone Observer was added |
|
154 */ |
|
155 TInt AddObserver( MCchServiceStatusObserver& aObserver ); |
|
156 |
|
157 /** |
|
158 * Removes the observer of service events |
|
159 * |
|
160 * @param aObserver Event observing class |
|
161 * @return KErrNotFound Observer was not found |
|
162 * KErrNone Observer was removed |
|
163 */ |
|
164 TInt RemoveObserver( MCchServiceStatusObserver& aObserver ); |
|
165 |
|
166 /** |
|
167 * Checks if the type is supported |
|
168 * |
|
169 * @param aType Type of service |
|
170 * @param aSupported True if the service type is supported |
|
171 * @return Symbian error code |
|
172 */ |
|
173 TInt IsSupported( TCCHSubserviceType aType, TBool& aSupported ) const; |
|
174 |
|
175 private: |
|
176 MCchServiceStatusObserver* iObserver; |
|
177 |
|
178 }; |
|
179 |
|
180 |
|
181 #endif //MyCchService |
|
182 |
|
183 |
|
184 |
|
185 |