|
1 /* |
|
2 * Copyright (c) 2007-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: stores the parameters needed for xmpp |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "xmppparameters.h" |
|
19 |
|
20 // ======== MEMBER FUNCTIONS ======== |
|
21 |
|
22 // --------------------------------------------------------------------------- |
|
23 // CXmppParameters::CXmppParameters |
|
24 // --------------------------------------------------------------------------- |
|
25 // |
|
26 CXmppParameters::CXmppParameters() |
|
27 { |
|
28 } |
|
29 |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // CXmppParameters::ConstructL |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 void CXmppParameters::ConstructL() |
|
36 { |
|
37 iServerAddress = HBufC::NewL(KMaxLength); |
|
38 iUserName = HBufC::NewL(KMaxLength); |
|
39 iPassword = HBufC::NewL(KMaxLength); |
|
40 iResource = HBufC::NewL(KMaxLength); |
|
41 iProxyServer = HBufC::NewL(KMaxLength); |
|
42 |
|
43 iConnMgrBus = HBufC::NewL(KMaxLength); |
|
44 iConnMgrPath = HBufC::NewL(KMaxLength); |
|
45 iProtocol = HBufC::NewL(KMaxLength); |
|
46 |
|
47 } |
|
48 |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // CXmppParameters::NewL() |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 EXPORT_C CXmppParameters* CXmppParameters::NewL() |
|
55 { |
|
56 |
|
57 CXmppParameters* self = new( ELeave ) |
|
58 CXmppParameters(); |
|
59 |
|
60 CleanupStack::PushL( self ); |
|
61 |
|
62 self->ConstructL(); |
|
63 CleanupStack::Pop( self ); |
|
64 |
|
65 return self; |
|
66 } |
|
67 |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // CXmppParameters::~CXmppParameters |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 CXmppParameters::~CXmppParameters() |
|
74 { |
|
75 delete iServerAddress; |
|
76 delete iUserName; |
|
77 delete iPassword; |
|
78 delete iResource; |
|
79 delete iProxyServer; |
|
80 |
|
81 delete iProtocol; |
|
82 delete iConnMgrPath; |
|
83 delete iConnMgrBus; |
|
84 // before destory cancel each of the active objects request |
|
85 } |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // CXmppParameters::SetIapId |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 void CXmppParameters::SetIapId(TInt32 aIapId) |
|
92 { |
|
93 iIapId = aIapId; |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // CXmppParameters::SetSettingsId |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 void CXmppParameters::SetSettingsId(TUint32 aSettingsId) |
|
101 { |
|
102 iSettingsId = aSettingsId; |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------------------------- |
|
106 // CXmppParameters::SetServerAddress |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 void CXmppParameters::SetServerAddress(const TDesC& aServerAddress) |
|
110 { |
|
111 iServerAddress->Des().Copy(aServerAddress); |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // CXmppParameters::SetUsername |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 void CXmppParameters::SetUserName(const TDesC& aUserName) |
|
119 { |
|
120 iUserName->Des().Copy(aUserName); |
|
121 } |
|
122 |
|
123 // --------------------------------------------------------------------------- |
|
124 // CXmppParameters::SetPasswd |
|
125 // --------------------------------------------------------------------------- |
|
126 // |
|
127 void CXmppParameters::SetPasswd(const TDesC& aPassword) |
|
128 { |
|
129 iPassword->Des().Copy(aPassword); |
|
130 } |
|
131 |
|
132 // --------------------------------------------------------------------------- |
|
133 // CXmppParameters::SetResource |
|
134 // --------------------------------------------------------------------------- |
|
135 // |
|
136 void CXmppParameters::SetResource(const TDesC& aResource) |
|
137 { |
|
138 iResource->Des().Copy(aResource); |
|
139 } |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // CXmppParameters::SetProxyServer |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void CXmppParameters::SetProxyServer(const TDesC& aProxyServer) |
|
146 { |
|
147 iProxyServer->Des().Copy(aProxyServer); |
|
148 } |
|
149 |
|
150 // --------------------------------------------------------------------------- |
|
151 // CXmppParameters::SetServerPort |
|
152 // --------------------------------------------------------------------------- |
|
153 // |
|
154 void CXmppParameters::SetServerPort(TInt32 aServerPort) |
|
155 { |
|
156 iServerPort = aServerPort; |
|
157 } |
|
158 |
|
159 // --------------------------------------------------------------------------- |
|
160 // CXmppParameters::SetProxyPort |
|
161 // --------------------------------------------------------------------------- |
|
162 // |
|
163 void CXmppParameters::SetProxyPort(TInt32 aProxyPort) |
|
164 { |
|
165 iProxyPort = aProxyPort; |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------------------------- |
|
169 // CXmppParameters::SetSsl |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 void CXmppParameters::SetSsl(TBool aSsl) |
|
173 { |
|
174 iSsl = aSsl; |
|
175 } |
|
176 |
|
177 |
|
178 // --------------------------------------------------------------------------- |
|
179 // CXmppParameters::SetProxyServer |
|
180 // --------------------------------------------------------------------------- |
|
181 // |
|
182 void CXmppParameters::SetConnMgrBus(const TDesC& aConnMgrBus) |
|
183 { |
|
184 iConnMgrBus->Des().Copy(aConnMgrBus); |
|
185 } |
|
186 |
|
187 // --------------------------------------------------------------------------- |
|
188 // CXmppParameters::SetProxyServer |
|
189 // --------------------------------------------------------------------------- |
|
190 // |
|
191 void CXmppParameters::SetConnMgrPath(const TDesC& aConnMgrPath) |
|
192 { |
|
193 iConnMgrPath->Des().Copy(aConnMgrPath); |
|
194 } |
|
195 |
|
196 // --------------------------------------------------------------------------- |
|
197 // CXmppParameters::SetProxyServer |
|
198 // --------------------------------------------------------------------------- |
|
199 // |
|
200 void CXmppParameters::SetProtocol(const TDesC& aProtocol) |
|
201 { |
|
202 iProtocol->Des().Copy(aProtocol); |
|
203 } |
|
204 // --------------------------------------------------------------------------- |
|
205 // CXmppParameters::IapId |
|
206 // --------------------------------------------------------------------------- |
|
207 // |
|
208 EXPORT_C TInt32 CXmppParameters::IapId() |
|
209 { |
|
210 return iIapId; |
|
211 } |
|
212 |
|
213 // --------------------------------------------------------------------------- |
|
214 // CXmppParameters::SettingsId |
|
215 // --------------------------------------------------------------------------- |
|
216 // |
|
217 EXPORT_C TUint32 CXmppParameters::SettingsId() |
|
218 { |
|
219 return iSettingsId; |
|
220 } |
|
221 |
|
222 // --------------------------------------------------------------------------- |
|
223 // CXmppParameters::ServerAddress |
|
224 // --------------------------------------------------------------------------- |
|
225 // |
|
226 EXPORT_C const TDesC& CXmppParameters::ServerAddress() |
|
227 { |
|
228 return *iServerAddress; |
|
229 } |
|
230 |
|
231 // --------------------------------------------------------------------------- |
|
232 // CXmppParameters::Username |
|
233 // --------------------------------------------------------------------------- |
|
234 // |
|
235 EXPORT_C const TDesC& CXmppParameters::UserName() |
|
236 { |
|
237 return *iUserName; |
|
238 } |
|
239 |
|
240 // --------------------------------------------------------------------------- |
|
241 // CXmppParameters::Passwd |
|
242 // --------------------------------------------------------------------------- |
|
243 // |
|
244 EXPORT_C const TDesC& CXmppParameters::Passwd() |
|
245 { |
|
246 return *iPassword; |
|
247 } |
|
248 |
|
249 // --------------------------------------------------------------------------- |
|
250 // CXmppParameters::Resource |
|
251 // --------------------------------------------------------------------------- |
|
252 // |
|
253 EXPORT_C const TDesC& CXmppParameters::Resource() |
|
254 { |
|
255 return *iResource; |
|
256 } |
|
257 |
|
258 // --------------------------------------------------------------------------- |
|
259 // CXmppParameters::ProxyServer |
|
260 // --------------------------------------------------------------------------- |
|
261 // |
|
262 EXPORT_C const TDesC& CXmppParameters::ProxyServer() |
|
263 { |
|
264 return *iProxyServer; |
|
265 } |
|
266 |
|
267 // --------------------------------------------------------------------------- |
|
268 // CXmppParameters::ServerPort |
|
269 // --------------------------------------------------------------------------- |
|
270 // |
|
271 EXPORT_C TInt32 CXmppParameters::ServerPort() |
|
272 { |
|
273 return iServerPort; |
|
274 } |
|
275 |
|
276 // --------------------------------------------------------------------------- |
|
277 // CXmppParameters::ProxyPort |
|
278 // --------------------------------------------------------------------------- |
|
279 // |
|
280 EXPORT_C TInt32 CXmppParameters::ProxyPort() |
|
281 { |
|
282 return iProxyPort; |
|
283 } |
|
284 |
|
285 // --------------------------------------------------------------------------- |
|
286 // CXmppParameters::Ssl |
|
287 // --------------------------------------------------------------------------- |
|
288 // |
|
289 EXPORT_C TBool CXmppParameters::Ssl() |
|
290 { |
|
291 return iSsl; |
|
292 } |
|
293 |
|
294 // --------------------------------------------------------------------------- |
|
295 // CXmppParameters::ConnMgrBus |
|
296 // --------------------------------------------------------------------------- |
|
297 // |
|
298 EXPORT_C const TDesC& CXmppParameters::ConnMgrBus() |
|
299 { |
|
300 return *iConnMgrBus; |
|
301 } |
|
302 |
|
303 // --------------------------------------------------------------------------- |
|
304 // CXmppParameters::ConnMgrPath |
|
305 // --------------------------------------------------------------------------- |
|
306 // |
|
307 EXPORT_C const TDesC& CXmppParameters::ConnMgrPath() |
|
308 { |
|
309 return *iConnMgrPath; |
|
310 } |
|
311 |
|
312 // --------------------------------------------------------------------------- |
|
313 // CXmppParameters::Protocol |
|
314 // --------------------------------------------------------------------------- |
|
315 // |
|
316 EXPORT_C const TDesC& CXmppParameters::Protocol() |
|
317 { |
|
318 return *iProtocol; |
|
319 } |
|
320 |
|
321 |
|
322 // End of File |
|
323 |