phonebookui/Phonebook2/CommonUI/src/CPbk2NonTopContactSelector.cpp
branchRCL_3
changeset 20 f4a778e096c2
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "CPbk2NonTopContactSelector.h"
       
    19 #include <MVPbkBaseContact.h>
       
    20 
       
    21 // Virtual Phonebook
       
    22 #include <CVPbkTopContactManager.h>
       
    23 
       
    24 CPbk2NonTopContactSelector* CPbk2NonTopContactSelector::NewL()
       
    25     {
       
    26     return new (ELeave) CPbk2NonTopContactSelector();
       
    27     }
       
    28 
       
    29 CPbk2NonTopContactSelector::CPbk2NonTopContactSelector()
       
    30 : iContinue(ETrue)
       
    31     {
       
    32     }
       
    33 
       
    34 CPbk2NonTopContactSelector::~CPbk2NonTopContactSelector()
       
    35     {
       
    36     }
       
    37 
       
    38 TBool CPbk2NonTopContactSelector::IsContactIncluded(
       
    39         const MVPbkBaseContact& aContact )
       
    40     {
       
    41     TBool isContactIncluded( 
       
    42             !CVPbkTopContactManager::IsTopContact( aContact ) );
       
    43 	
       
    44     // Continue until we found first contact that is not top contact
       
    45 	// we can stop selector when we found first contact that is not top contact
       
    46 	// because top contacts are sorted to top of the contact list.
       
    47     iContinue = !isContactIncluded;
       
    48     return isContactIncluded;
       
    49     
       
    50     }
       
    51 
       
    52 TAny* CPbk2NonTopContactSelector::ContactSelectorExtension( TUid aExtensionUid )
       
    53     {
       
    54     if( aExtensionUid == KVPbkOptimizedSelectorExtensionUid )
       
    55         {
       
    56         return static_cast<MVPbkOptimizedSelector*>( this );
       
    57         }
       
    58     return NULL;
       
    59     }
       
    60 
       
    61 TBool CPbk2NonTopContactSelector::Continue() const
       
    62     {
       
    63     return iContinue;
       
    64     }
       
    65 
       
    66 
       
    67 // End of File