phonebookui/Phonebook2/spbcontentprovider/inc/spbphonenumberparser.h
changeset 0 e686773b3f54
child 3 04ab22b956c2
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2009 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: Phone number parser
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SPBPHONENUMBERPARSER_H_
       
    20 #define SPBPHONENUMBERPARSER_H_
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MVPbkSingleContactOperationObserver.h>
       
    25 
       
    26 class CVPbkContactManager;
       
    27 class CSpbContent;
       
    28 class MVPbkContactLink;
       
    29 class MVPbkContactOperationBase;
       
    30 
       
    31 /**
       
    32  * Finds contacts's active phone number
       
    33  */
       
    34 NONSHARABLE_CLASS( CSpbPhoneNumberParser ) :
       
    35     public CBase,
       
    36     public MVPbkSingleContactOperationObserver
       
    37     {
       
    38    
       
    39 public: // Construction & destruction
       
    40     static CSpbPhoneNumberParser* NewL( 
       
    41             CVPbkContactManager& aContactManager,
       
    42             CSpbContent& aContent);
       
    43     ~CSpbPhoneNumberParser();
       
    44 
       
    45 public: // Interface
       
    46     void FetchPhoneNumber( const MVPbkContactLink& aLink);
       
    47     
       
    48 private:    // from MVPbkSingleContactOperationObserver
       
    49     void VPbkSingleContactOperationComplete(
       
    50             MVPbkContactOperationBase& aOperation,
       
    51             MVPbkStoreContact* aContact );
       
    52     void VPbkSingleContactOperationFailed(
       
    53             MVPbkContactOperationBase& aOperation, 
       
    54             TInt aError );
       
    55     
       
    56 private:	// new functions
       
    57     /*
       
    58      * Solves what to show on names list. 
       
    59 	 * - If only one number, it's shown. 
       
    60 	 * - If default number is set, it's shown. 
       
    61 	 * - Otherwise nothing is shown.
       
    62      * @param aContact
       
    63      */
       
    64     void SolvePhoneNumberL( MVPbkStoreContact& aContact );
       
    65     
       
    66 private:    // constructors
       
    67     inline CSpbPhoneNumberParser(
       
    68             CVPbkContactManager& aContactManager,
       
    69             CSpbContent& aContent);
       
    70     inline void ConstructL();
       
    71    
       
    72 private: // data
       
    73     CVPbkContactManager& iContactManager;
       
    74     CSpbContent& iContent;
       
    75     MVPbkContactOperationBase* iOperation;
       
    76     };
       
    77 
       
    78 #endif /*SPBPHONENUMBERPARSER_H_*/