|
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: manages the locally maintained blocked list |
|
15 * |
|
16 */ |
|
17 // INCLUDE FILES |
|
18 #include "cvimpstblockedlistmanager.h" |
|
19 #include "vimpstdebugtrace.h" |
|
20 |
|
21 |
|
22 // ================= MEMBER FUNCTIONS ======================= |
|
23 // --------------------------------------------------------- |
|
24 // CVIMPSTServiceListManager::NewL |
|
25 // Two-phased constructor. |
|
26 // --------------------------------------------------------- |
|
27 CVIMPSTBlockedListManager* CVIMPSTBlockedListManager::NewL() |
|
28 { |
|
29 TRACE( T_LIT("CVIMPSTBlockedListManager::NewL start")); |
|
30 CVIMPSTBlockedListManager* self = |
|
31 CVIMPSTBlockedListManager::NewLC(); |
|
32 CleanupStack::Pop( self ); |
|
33 TRACE( T_LIT("CVIMPSTBlockedListManager::NewL end")); |
|
34 return self; |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------- |
|
38 // CVIMPSTBlockedListManager::NewLC |
|
39 // Two-phased constructor. |
|
40 // --------------------------------------------------------- |
|
41 CVIMPSTBlockedListManager* CVIMPSTBlockedListManager::NewLC() |
|
42 { |
|
43 TRACE( T_LIT("CVIMPSTBlockedListManager::NewLC start")); |
|
44 CVIMPSTBlockedListManager* self = new (ELeave) CVIMPSTBlockedListManager; |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL(); |
|
47 TRACE( T_LIT("CVIMPSTBlockedListManager::NewLC end")); |
|
48 return self; |
|
49 } |
|
50 |
|
51 // --------------------------------------------------------- |
|
52 // CVIMPSTBlockedListManager::ConstructL |
|
53 // --------------------------------------------------------- |
|
54 void CVIMPSTBlockedListManager::ConstructL() |
|
55 { |
|
56 TRACE( T_LIT("CVIMPSTBlockedListManager::ConstructL start")); |
|
57 TRACE( T_LIT("CVIMPSTBlockedListManager::ConstructL end")); |
|
58 } |
|
59 |
|
60 // --------------------------------------------------------- |
|
61 // CVIMPSTBlockedListManager::CVIMPSTBlockedListManager |
|
62 // --------------------------------------------------------- |
|
63 CVIMPSTBlockedListManager::CVIMPSTBlockedListManager() |
|
64 { |
|
65 |
|
66 } |
|
67 |
|
68 // --------------------------------------------------------- |
|
69 // CVIMPSTBlockedListManager::~CVIMPSTBlockedListManager |
|
70 // --------------------------------------------------------- |
|
71 CVIMPSTBlockedListManager::~CVIMPSTBlockedListManager() |
|
72 { |
|
73 iBlockedList.ResetAndDestroy(); |
|
74 iBlockedList.Close(); |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------- |
|
78 // CVIMPSTBlockedListManager::AddToBlockedListL |
|
79 // --------------------------------------------------------- |
|
80 void CVIMPSTBlockedListManager::AddToBlockedListL(const TDesC& aContact) |
|
81 { |
|
82 HBufC* contact = aContact.AllocL(); |
|
83 iBlockedList.Append(contact);//owner ship tranfered. |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // CVIMPSTBlockedListManager::AddToBlockedList |
|
88 // --------------------------------------------------------- |
|
89 void CVIMPSTBlockedListManager::RemoveFromBlockListL(const TDesC& aContact) |
|
90 { |
|
91 for(TInt i=0; i<iBlockedList.Count(); ++i) |
|
92 { |
|
93 if(0 == aContact.CompareC(iBlockedList[i]->Des())) |
|
94 { |
|
95 HBufC* unblocked = iBlockedList[i]; |
|
96 iBlockedList.Remove(i); |
|
97 delete unblocked ; |
|
98 } |
|
99 } |
|
100 } |
|
101 |
|
102 |
|
103 // --------------------------------------------------------- |
|
104 // CVIMPSTBlockedListManager::BlockedList |
|
105 // --------------------------------------------------------- |
|
106 RPointerArray<HBufC>* CVIMPSTBlockedListManager::BlockedList() |
|
107 { |
|
108 return &iBlockedList; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------- |
|
112 // CVIMPSTBlockedListManager::ResetL |
|
113 // --------------------------------------------------------- |
|
114 void CVIMPSTBlockedListManager::ResetL() |
|
115 { |
|
116 iBlockedList.ResetAndDestroy(); |
|
117 } |
|
118 |
|
119 |
|
120 |
|
121 // end of file |