|
1 /* |
|
2 * Copyright (c) 2006 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: Implementation of RCmDestination |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <cmdestination.h> |
|
19 #include "cmdestinationimpl.h" |
|
20 #include "cmmanagerimpl.h" |
|
21 #include <cmpluginbaseeng.h> |
|
22 #include <cmpluginbase.h> |
|
23 |
|
24 using namespace CMManager; |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // RCmDestination::Close() |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 EXPORT_C void RCmDestination::Close() |
|
31 { |
|
32 if( !iDestinatonData ) |
|
33 { |
|
34 return; |
|
35 } |
|
36 |
|
37 iDestinatonData->Cmmgr()->RemoveDestFromPool(iDestinatonData); |
|
38 iDestinatonData = NULL; |
|
39 } |
|
40 |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // RCmDestination::~RCmDestination() |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 EXPORT_C RCmDestination::~RCmDestination() |
|
47 { |
|
48 Close(); |
|
49 } |
|
50 |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // RCmDestination::RCmDestination( RCmDestination& ) |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C RCmDestination::RCmDestination( |
|
57 const RCmDestination& aCmDestination) |
|
58 : iDestinatonData( aCmDestination.iDestinatonData ) |
|
59 { |
|
60 iDestinatonData->IncrementRefCounter(); |
|
61 } |
|
62 |
|
63 |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // RCmDestination::RCmDestination::operator=() |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 EXPORT_C RCmDestination& RCmDestination::operator=( |
|
70 const RCmDestination& aCmDestination) |
|
71 { |
|
72 if (this != &aCmDestination) |
|
73 { |
|
74 delete iDestinatonData; |
|
75 iDestinatonData = aCmDestination.iDestinatonData; |
|
76 iDestinatonData->IncrementRefCounter(); |
|
77 } |
|
78 return *this; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // RCmDestination::ConnectionMethodCount() |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 EXPORT_C TInt RCmDestination::ConnectionMethodCount() const |
|
86 { |
|
87 __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), KErrBadHandle ) ); |
|
88 |
|
89 return iDestinatonData->ConnectionMethodCount(); |
|
90 }; |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // RCmDestination::ConnectionMethodL |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C RCmConnectionMethod |
|
97 RCmDestination::ConnectionMethodL( TInt anIndex ) const |
|
98 { |
|
99 if (!iDestinatonData) |
|
100 { |
|
101 User::Leave(KErrBadHandle); |
|
102 } |
|
103 |
|
104 RCmConnectionMethod cm; |
|
105 CCmDestinationImpl* aImplementation = |
|
106 CCmDestinationImpl::NewLC(iDestinatonData); |
|
107 // Deleting aImplementation will decrement the ref counter |
|
108 iDestinatonData->IncrementRefCounter(); |
|
109 cm.iImplementation = |
|
110 aImplementation->GetConnectionMethodL( anIndex )->Plugin(); |
|
111 //CCmDestinationImpl::GetConnectionMethodL doesn't give ownership |
|
112 cm.iImplementation->IncrementRefCounter(); |
|
113 CleanupStack::PopAndDestroy(aImplementation); |
|
114 |
|
115 return cm; |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // RCmDestination::ConnectionMethodByIDL |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C RCmConnectionMethod |
|
123 RCmDestination::ConnectionMethodByIDL( TInt aIapId ) const |
|
124 { |
|
125 if (!iDestinatonData) |
|
126 { |
|
127 User::Leave(KErrBadHandle); |
|
128 } |
|
129 |
|
130 RCmConnectionMethod cm; |
|
131 |
|
132 CCmDestinationImpl* aImplementation = |
|
133 CCmDestinationImpl::NewLC(iDestinatonData); |
|
134 // Deleting aImplementation will decrement the ref counter |
|
135 iDestinatonData->IncrementRefCounter(); |
|
136 cm.iImplementation = |
|
137 aImplementation->ConnectionMethodByIDL( aIapId )->Plugin(); |
|
138 //CCmDestinationImpl::ConnectionMethodByIDL doesn't give ownership |
|
139 cm.iImplementation->IncrementRefCounter(); |
|
140 CleanupStack::PopAndDestroy(aImplementation); |
|
141 |
|
142 return cm; |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // RCmDestination::PriorityL() |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 EXPORT_C TUint RCmDestination::PriorityL(const RCmConnectionMethod& aCCMItem ) const |
|
150 { |
|
151 if (!iDestinatonData) |
|
152 { |
|
153 User::Leave(KErrBadHandle); |
|
154 } |
|
155 |
|
156 CCmDestinationImpl* aImplementation = |
|
157 CCmDestinationImpl::NewLC(iDestinatonData); |
|
158 // Deleting aImplementation will decrement the ref counter |
|
159 iDestinatonData->IncrementRefCounter(); |
|
160 TUint retValue = aImplementation->PriorityL( *aCCMItem.iImplementation ); |
|
161 CleanupStack::PopAndDestroy(aImplementation); |
|
162 return retValue; |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // RCmDestination::NameLC() |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 EXPORT_C HBufC* RCmDestination::NameLC ( ) const |
|
170 { |
|
171 if (!iDestinatonData) |
|
172 { |
|
173 User::Leave(KErrBadHandle); |
|
174 } |
|
175 |
|
176 CCmDestinationImpl* aImplementation = |
|
177 CCmDestinationImpl::NewLC(iDestinatonData); |
|
178 // Deleting aImplementation will decrement the ref counter |
|
179 iDestinatonData->IncrementRefCounter(); |
|
180 HBufC* retValue = aImplementation->NameLC(); |
|
181 CleanupStack::Pop(retValue); |
|
182 CleanupStack::PopAndDestroy(aImplementation); |
|
183 CleanupStack::PushL(retValue); |
|
184 return retValue; |
|
185 }; |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // RCmDestination::Id() |
|
189 // ----------------------------------------------------------------------------- |
|
190 // |
|
191 EXPORT_C TUint32 RCmDestination::Id() const |
|
192 { |
|
193 __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), |
|
194 KErrBadHandle ) ); |
|
195 |
|
196 return iDestinatonData->Id(); |
|
197 } |
|
198 |
|
199 // ----------------------------------------------------------------------------- |
|
200 // RCmDestination::ElementId() |
|
201 // ----------------------------------------------------------------------------- |
|
202 // |
|
203 EXPORT_C TUint32 RCmDestination::ElementId() const |
|
204 { |
|
205 __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), |
|
206 KErrBadHandle ) ); |
|
207 |
|
208 return iDestinatonData->ElementId(); |
|
209 } |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // RCmDestination::IconL() |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 EXPORT_C CGulIcon* RCmDestination::IconL() const |
|
216 { |
|
217 if (!iDestinatonData) |
|
218 { |
|
219 User::Leave(KErrBadHandle); |
|
220 } |
|
221 |
|
222 CCmDestinationImpl* aImplementation = |
|
223 CCmDestinationImpl::NewLC(iDestinatonData); |
|
224 // Deleting aImplementation will decrement the ref counter |
|
225 iDestinatonData->IncrementRefCounter(); |
|
226 CGulIcon* retValue = aImplementation->IconL(); |
|
227 CleanupStack::PopAndDestroy(aImplementation); |
|
228 return retValue; |
|
229 } |
|
230 |
|
231 |
|
232 // ----------------------------------------------------------------------------- |
|
233 // RCmDestination::MetadataL() |
|
234 // ----------------------------------------------------------------------------- |
|
235 // |
|
236 EXPORT_C |
|
237 TUint32 RCmDestination::MetadataL( TSnapMetadataField aMetaField ) const |
|
238 { |
|
239 if (!iDestinatonData) |
|
240 { |
|
241 User::Leave(KErrBadHandle); |
|
242 } |
|
243 return iDestinatonData->MetadataL( aMetaField ); |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // RCmDestination::ProtectionLevel() |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 EXPORT_C TProtectionLevel RCmDestination::ProtectionLevel() const |
|
251 { |
|
252 __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), |
|
253 KErrBadHandle ) ); |
|
254 |
|
255 return iDestinatonData->ProtectionLevel(); |
|
256 } |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // RCmDestination::IsHidden() |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 EXPORT_C TBool RCmDestination::IsHidden() const |
|
263 { |
|
264 __ASSERT_ALWAYS( iDestinatonData, User::Panic(_L( "CMManager" ), |
|
265 KErrBadHandle ) ); |
|
266 |
|
267 TBool hidden( EFalse ); |
|
268 TRAPD( err, hidden = iDestinatonData->IsHiddenL() ); |
|
269 __ASSERT_ALWAYS( err == KErrNone, User::Panic(_L( "CMManager" ), |
|
270 KErrArgument ) ); |
|
271 |
|
272 return hidden; |
|
273 } |
|
274 |
|
275 // ----------------------------------------------------------------------------- |
|
276 // RCmDestination::CreateConnectionMethodL() |
|
277 // ----------------------------------------------------------------------------- |
|
278 // |
|
279 EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL |
|
280 ( TUint32 aImplementationUid ) |
|
281 { |
|
282 if (!iDestinatonData) |
|
283 { |
|
284 User::Leave(KErrBadHandle); |
|
285 } |
|
286 |
|
287 RCmConnectionMethod cm; |
|
288 CCmDestinationImpl* aImplementation = |
|
289 CCmDestinationImpl::NewLC(iDestinatonData); |
|
290 // Deleting aImplementation will decrement the ref counter |
|
291 iDestinatonData->IncrementRefCounter(); |
|
292 CCmPluginBase* imp = aImplementation->CreateConnectionMethodL( |
|
293 aImplementationUid ); |
|
294 imp->IncrementRefCounter(); |
|
295 CleanupStack::PushL(imp); |
|
296 cm.iImplementation = imp->Plugin(); |
|
297 CleanupStack::PopAndDestroy(imp); |
|
298 |
|
299 CleanupStack::PopAndDestroy(aImplementation); |
|
300 return cm; |
|
301 } |
|
302 |
|
303 // ----------------------------------------------------------------------------- |
|
304 // RCmDestinationExt::CreateConnectionMethodL() |
|
305 // ----------------------------------------------------------------------------- |
|
306 // |
|
307 EXPORT_C RCmConnectionMethod RCmDestination::CreateConnectionMethodL( |
|
308 TUint32 aImplementationUid, |
|
309 TUint32 aConnMethId ) |
|
310 { |
|
311 if (!iDestinatonData) |
|
312 { |
|
313 User::Leave(KErrBadHandle); |
|
314 } |
|
315 |
|
316 RCmConnectionMethod cm; |
|
317 CCmDestinationImpl* implementation = |
|
318 CCmDestinationImpl::NewLC( iDestinatonData ); |
|
319 // Deleting aImplementation will decrement the ref counter |
|
320 iDestinatonData->IncrementRefCounter(); |
|
321 CCmPluginBase* imp = implementation->CreateConnectionMethodL( |
|
322 aImplementationUid, |
|
323 aConnMethId ); |
|
324 imp->IncrementRefCounter(); |
|
325 CleanupStack::PushL(imp); |
|
326 cm.iImplementation = imp->Plugin(); |
|
327 CleanupStack::PopAndDestroy(imp); |
|
328 |
|
329 CleanupStack::PopAndDestroy(implementation); |
|
330 return cm; |
|
331 } |
|
332 |
|
333 // ----------------------------------------------------------------------------- |
|
334 // RCmDestination::AddConnectionMethodL() |
|
335 // ----------------------------------------------------------------------------- |
|
336 // |
|
337 EXPORT_C TInt RCmDestination::AddConnectionMethodL( |
|
338 RCmConnectionMethod aConnectionMethod ) |
|
339 { |
|
340 if (!iDestinatonData) |
|
341 { |
|
342 User::Leave(KErrBadHandle); |
|
343 } |
|
344 |
|
345 CCmDestinationImpl* implementation = |
|
346 CCmDestinationImpl::NewLC(iDestinatonData); |
|
347 // Deleting aImplementation will decrement the ref counter |
|
348 iDestinatonData->IncrementRefCounter(); |
|
349 |
|
350 CCmPluginBase* connMethod = new (ELeave) |
|
351 CCmPluginBase(aConnectionMethod.iImplementation); |
|
352 connMethod->IncrementRefCounter(); |
|
353 CleanupStack::PushL( connMethod ); |
|
354 |
|
355 // Check if the given connection method exists already in this destination |
|
356 if ( aConnectionMethod.iImplementation->IdIsValid() && |
|
357 implementation->CheckIfCMExistsL( *connMethod ) ) |
|
358 { |
|
359 CleanupStack::PopAndDestroy( connMethod ); |
|
360 CleanupStack::PopAndDestroy( implementation ); |
|
361 User::Leave( KErrAlreadyExists ); |
|
362 } |
|
363 |
|
364 TInt retValue = implementation->AddConnectionMethodL( *connMethod ); |
|
365 CleanupStack::PopAndDestroy( connMethod ); |
|
366 CleanupStack::PopAndDestroy( implementation ); |
|
367 return retValue; |
|
368 } |
|
369 |
|
370 // ----------------------------------------------------------------------------- |
|
371 // RCmDestination::AddEmbeddedDestinationL() |
|
372 // ----------------------------------------------------------------------------- |
|
373 // |
|
374 EXPORT_C TInt RCmDestination::AddEmbeddedDestinationL( |
|
375 const RCmDestination& aDestination ) |
|
376 { |
|
377 if (!iDestinatonData) |
|
378 { |
|
379 User::Leave(KErrBadHandle); |
|
380 } |
|
381 |
|
382 if ( this == &aDestination ) |
|
383 { |
|
384 User::Leave( KErrArgument ); |
|
385 } |
|
386 |
|
387 CCmDestinationImpl* aImplementation = |
|
388 CCmDestinationImpl::NewLC(iDestinatonData); |
|
389 // Deleting will decrement the ref counter |
|
390 aImplementation->IncrementRefCounter(); |
|
391 CCmDestinationImpl* aDestToAdd = |
|
392 CCmDestinationImpl::NewLC(aDestination.iDestinatonData); |
|
393 // Deleting will decrement the ref counter |
|
394 aDestToAdd->IncrementRefCounter(); |
|
395 |
|
396 TInt retValue = aImplementation->AddEmbeddedDestinationL( |
|
397 *aDestToAdd ); |
|
398 CleanupStack::PopAndDestroy(aDestToAdd); |
|
399 CleanupStack::PopAndDestroy(aImplementation); |
|
400 return retValue; |
|
401 } |
|
402 |
|
403 // ----------------------------------------------------------------------------- |
|
404 // RCmDestination::DeleteConnectionMethodL() |
|
405 // ----------------------------------------------------------------------------- |
|
406 // |
|
407 EXPORT_C void RCmDestination::DeleteConnectionMethodL( |
|
408 RCmConnectionMethod& aConnectionMethod ) |
|
409 { |
|
410 if (!iDestinatonData) |
|
411 { |
|
412 User::Leave(KErrBadHandle); |
|
413 } |
|
414 |
|
415 CCmDestinationImpl* aImplementation = |
|
416 CCmDestinationImpl::NewLC(iDestinatonData); |
|
417 // Deleting aImplementation will decrement the ref counter |
|
418 iDestinatonData->IncrementRefCounter(); |
|
419 CCmPluginBase* connMethod = new (ELeave) |
|
420 CCmPluginBase(aConnectionMethod.iImplementation); |
|
421 connMethod->IncrementRefCounter(); |
|
422 CleanupStack::PushL( connMethod ); |
|
423 aImplementation->DeleteConnectionMethodL( |
|
424 *connMethod ); |
|
425 CleanupStack::PopAndDestroy(connMethod); |
|
426 CleanupStack::PopAndDestroy(aImplementation); |
|
427 } |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
|
430 // RCmDestination::RemoveConnectionMethodL() |
|
431 // ----------------------------------------------------------------------------- |
|
432 // |
|
433 EXPORT_C void RCmDestination::RemoveConnectionMethodL( |
|
434 RCmConnectionMethod aConnectionMethod ) |
|
435 { |
|
436 if (!iDestinatonData) |
|
437 { |
|
438 User::Leave(KErrBadHandle); |
|
439 } |
|
440 |
|
441 CCmDestinationImpl* aImplementation = |
|
442 CCmDestinationImpl::NewLC(iDestinatonData); |
|
443 // Deleting aImplementation will decrement the ref counter |
|
444 iDestinatonData->IncrementRefCounter(); |
|
445 aImplementation->RemoveConnectionMethodL( |
|
446 *aConnectionMethod.iImplementation ); |
|
447 CleanupStack::PopAndDestroy(aImplementation); |
|
448 } |
|
449 |
|
450 // ----------------------------------------------------------------------------- |
|
451 // RCmDestination::ModifyPriorityL() |
|
452 // ----------------------------------------------------------------------------- |
|
453 // |
|
454 EXPORT_C void RCmDestination::ModifyPriorityL( |
|
455 RCmConnectionMethod& aCCmItem, |
|
456 TUint aIndex ) |
|
457 { |
|
458 if (!iDestinatonData) |
|
459 { |
|
460 User::Leave(KErrBadHandle); |
|
461 } |
|
462 |
|
463 CCmDestinationImpl* aImplementation = |
|
464 CCmDestinationImpl::NewLC(iDestinatonData); |
|
465 // Deleting aImplementation will decrement the ref counter |
|
466 iDestinatonData->IncrementRefCounter(); |
|
467 CCmPluginBase* connMethod = new (ELeave) |
|
468 CCmPluginBase(aCCmItem.iImplementation); |
|
469 connMethod->IncrementRefCounter(); |
|
470 CleanupStack::PushL( connMethod ); |
|
471 aImplementation->ModifyPriorityL( *connMethod, aIndex ); |
|
472 CleanupStack::PopAndDestroy(connMethod); |
|
473 CleanupStack::PopAndDestroy(aImplementation); |
|
474 } |
|
475 |
|
476 // ----------------------------------------------------------------------------- |
|
477 // RCmDestination::SetNameL() |
|
478 // ----------------------------------------------------------------------------- |
|
479 // |
|
480 EXPORT_C void RCmDestination::SetNameL( const TDesC& aName ) |
|
481 { |
|
482 if (!iDestinatonData) |
|
483 { |
|
484 User::Leave(KErrBadHandle); |
|
485 } |
|
486 |
|
487 CCmDestinationImpl* aImplementation = |
|
488 CCmDestinationImpl::NewLC(iDestinatonData); |
|
489 // Deleting aImplementation will decrement the ref counter |
|
490 iDestinatonData->IncrementRefCounter(); |
|
491 aImplementation->SetNameL( aName ); |
|
492 CleanupStack::PopAndDestroy(aImplementation); |
|
493 } |
|
494 |
|
495 // ----------------------------------------------------------------------------- |
|
496 // RCmDestination::SetIconL() |
|
497 // ----------------------------------------------------------------------------- |
|
498 // |
|
499 EXPORT_C void RCmDestination::SetIconL( TUint32 anIndex ) |
|
500 { |
|
501 if (!iDestinatonData) |
|
502 { |
|
503 User::Leave(KErrBadHandle); |
|
504 } |
|
505 |
|
506 if ( anIndex > KNumOfIcons ) |
|
507 { |
|
508 User::Leave( KErrArgument ); |
|
509 } |
|
510 |
|
511 CCmDestinationImpl* aImplementation = |
|
512 CCmDestinationImpl::NewLC(iDestinatonData); |
|
513 // Deleting aImplementation will decrement the ref counter |
|
514 iDestinatonData->IncrementRefCounter(); |
|
515 aImplementation->SetIconL( anIndex ); |
|
516 CleanupStack::PopAndDestroy(aImplementation); |
|
517 } |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // RCmDestination::SetMetadataL() |
|
521 // ----------------------------------------------------------------------------- |
|
522 // |
|
523 EXPORT_C void RCmDestination::SetMetadataL( TSnapMetadataField aMetaField, |
|
524 TUint32 aValue ) |
|
525 { |
|
526 if (!iDestinatonData) |
|
527 { |
|
528 User::Leave(KErrBadHandle); |
|
529 } |
|
530 |
|
531 CCmDestinationImpl* aImplementation = |
|
532 CCmDestinationImpl::NewLC(iDestinatonData); |
|
533 // Deleting aImplementation will decrement the ref counter |
|
534 iDestinatonData->IncrementRefCounter(); |
|
535 aImplementation->SetMetadataL( aMetaField, aValue ); |
|
536 CleanupStack::PopAndDestroy(aImplementation); |
|
537 } |
|
538 |
|
539 // ----------------------------------------------------------------------------- |
|
540 // RCmDestination::SetProtectionL() |
|
541 // ----------------------------------------------------------------------------- |
|
542 // |
|
543 EXPORT_C void RCmDestination::SetProtectionL( TProtectionLevel aProtLevel ) |
|
544 { |
|
545 if (!iDestinatonData) |
|
546 { |
|
547 User::Leave(KErrBadHandle); |
|
548 } |
|
549 |
|
550 CCmDestinationImpl* aImplementation = |
|
551 CCmDestinationImpl::NewLC(iDestinatonData); |
|
552 // Deleting aImplementation will decrement the ref counter |
|
553 iDestinatonData->IncrementRefCounter(); |
|
554 aImplementation->SetProtectionL( aProtLevel ); |
|
555 CleanupStack::PopAndDestroy(aImplementation); |
|
556 } |
|
557 |
|
558 // ----------------------------------------------------------------------------- |
|
559 // RCmDestination::SetHiddenL() |
|
560 // ----------------------------------------------------------------------------- |
|
561 // |
|
562 EXPORT_C void RCmDestination::SetHiddenL( TBool aHidden ) |
|
563 { |
|
564 if (!iDestinatonData) |
|
565 { |
|
566 User::Leave(KErrBadHandle); |
|
567 } |
|
568 |
|
569 CCmDestinationImpl* aImplementation = |
|
570 CCmDestinationImpl::NewLC(iDestinatonData); |
|
571 // Deleting aImplementation will decrement the ref counter |
|
572 iDestinatonData->IncrementRefCounter(); |
|
573 aImplementation->SetHiddenL( aHidden ); |
|
574 CleanupStack::PopAndDestroy(aImplementation); |
|
575 } |
|
576 |
|
577 // ----------------------------------------------------------------------------- |
|
578 // RCmDestination::UpdateL() |
|
579 // ----------------------------------------------------------------------------- |
|
580 // |
|
581 EXPORT_C void RCmDestination::UpdateL() |
|
582 { |
|
583 if (!iDestinatonData) |
|
584 { |
|
585 User::Leave(KErrBadHandle); |
|
586 } |
|
587 |
|
588 CCmDestinationImpl* aImplementation = |
|
589 CCmDestinationImpl::NewLC(iDestinatonData); |
|
590 // Deleting aImplementation will decrement the ref counter |
|
591 iDestinatonData->IncrementRefCounter(); |
|
592 aImplementation->UpdateL(); |
|
593 CleanupStack::PopAndDestroy(aImplementation); |
|
594 } |
|
595 |
|
596 // ----------------------------------------------------------------------------- |
|
597 // RCmDestination::DeleteLD() |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 EXPORT_C void RCmDestination::DeleteLD() |
|
601 { |
|
602 if (!iDestinatonData) |
|
603 { |
|
604 User::Leave(KErrBadHandle); |
|
605 } |
|
606 |
|
607 CCmDestinationImpl* aImplementation = |
|
608 CCmDestinationImpl::NewLC(iDestinatonData); |
|
609 iDestinatonData->IncrementRefCounter(); |
|
610 aImplementation->DeleteLD(); |
|
611 CleanupStack::Pop(aImplementation); |
|
612 iDestinatonData = NULL; |
|
613 } |
|
614 |
|
615 // ----------------------------------------------------------------------------- |
|
616 // RCmDestination::IsConnectedL() |
|
617 // ----------------------------------------------------------------------------- |
|
618 // |
|
619 EXPORT_C TBool RCmDestination::IsConnectedL() const |
|
620 { |
|
621 if (!iDestinatonData) |
|
622 { |
|
623 User::Leave(KErrBadHandle); |
|
624 } |
|
625 |
|
626 CCmDestinationImpl* aImplementation = |
|
627 CCmDestinationImpl::NewLC(iDestinatonData); |
|
628 // Deleting aImplementation will decrement the ref counter |
|
629 iDestinatonData->IncrementRefCounter(); |
|
630 TBool retValue = aImplementation->IsConnectedL(); |
|
631 CleanupStack::PopAndDestroy(aImplementation); |
|
632 return retValue; |
|
633 } |
|
634 |
|
635 // ----------------------------------------------------------------------------- |
|
636 // RCmDestination::RCmDestination |
|
637 // ----------------------------------------------------------------------------- |
|
638 // |
|
639 EXPORT_C RCmDestination::RCmDestination() |
|
640 : iDestinatonData( NULL ) |
|
641 { |
|
642 } |
|
643 |
|
644 // ----------------------------------------------------------------------------- |
|
645 // RCmDestination::operator== |
|
646 // ----------------------------------------------------------------------------- |
|
647 // |
|
648 EXPORT_C TBool RCmDestination::operator==(const RCmDestination& aDestination ) const |
|
649 { |
|
650 return ( iDestinatonData == aDestination.iDestinatonData ); |
|
651 }; |
|
652 |
|
653 // ----------------------------------------------------------------------------- |
|
654 // RCmDestination::operator!= |
|
655 // ----------------------------------------------------------------------------- |
|
656 // |
|
657 EXPORT_C TBool RCmDestination::operator!=(const RCmDestination& aDestination ) const |
|
658 { |
|
659 return !( iDestinatonData == aDestination.iDestinatonData ); |
|
660 }; |
|
661 |
|
662 // End of file |