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