phoneengine/PhoneCntFinder/inc/Misc/CPhCntSingleItemFetchImpl.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2002 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 single item fetch interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTSINGLEITEMFETCHIMPL_H
       
    20 #define CPHCNTSINGLEITEMFETCHIMPL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include    "CPhCntSingleItemFetch.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CPbkSingleItemFetch;
       
    27 class CPbkSingleItemFetchDlg;
       
    28 class CPbkFieldIdArray;
       
    29 class MPhoneCntPbkOwner;
       
    30 class CPhCntSingleCallFetchDlg;
       
    31 class CPbkContactItem;
       
    32 class TPbkContactItemField;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  It is implementation of single item fetch interface.
       
    38 *
       
    39 *  @lib PhoneCntFinder
       
    40 *  @since 1.0
       
    41 */
       
    42 NONSHARABLE_CLASS( CPhCntSingleItemFetchImpl )
       
    43     : public CPhCntSingleItemFetch
       
    44     {
       
    45     public:  // Constructors and destructor      
       
    46                 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         *
       
    50         * @param aPbkOwner phonebook owner interface.
       
    51         * @return new instance of the class.
       
    52         */
       
    53         static CPhCntSingleItemFetchImpl* NewL(
       
    54             MPhoneCntPbkOwner& aPbkOwner );
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         ~CPhCntSingleItemFetchImpl();
       
    60 
       
    61     public: // Functions from base classes
       
    62         
       
    63         /**
       
    64         * From CPhCntSingleItemFetch
       
    65         */
       
    66         TInt FetchLD( TFetchParams& aParams );
       
    67         
       
    68     private:
       
    69 
       
    70         /**
       
    71         * C++ constructor.
       
    72         */
       
    73         CPhCntSingleItemFetchImpl(
       
    74             MPhoneCntPbkOwner& aPbkOwner );
       
    75 
       
    76         /**
       
    77         * Symbian OS constructor.
       
    78         */
       
    79         void ConstructL();
       
    80 
       
    81         /**
       
    82         * Fetch DTMF via single item fetch.
       
    83         *
       
    84         * @param aParams it contains parameters.
       
    85         */
       
    86         TInt FetchDtmfLD( TFetchParams& aParams );
       
    87 
       
    88         /**
       
    89         * Fetch new phonenumber field via single item fetch.
       
    90         *
       
    91         * @param aParams it contains parameters.
       
    92         */
       
    93         TInt FetchNewCallLD( TFetchParams& aParams );
       
    94 
       
    95         /**
       
    96         * Generates array of field id for DTMF fetch.
       
    97         */
       
    98         CPbkFieldIdArray* GenerateFieldIdArrayLC();
       
    99 
       
   100         /**
       
   101         * Pushes cleanup item to stack that resets some pointers.
       
   102         */
       
   103         void CleanupResetPtrPushL();
       
   104 
       
   105         /**
       
   106         * Resets iFetch & iDestroyed pointers.
       
   107         */
       
   108         static void ResetPointers( TAny* aAny );
       
   109 
       
   110         /**
       
   111         * Extracts result.
       
   112         *
       
   113         * @param aParams result will be stored there.
       
   114         * @param aItem contact item.
       
   115         * @param aField selected field.
       
   116         * @return error code.
       
   117         */
       
   118         static TInt ExtractResult( 
       
   119             TFetchParams& aParams,
       
   120             const CPbkContactItem* aItem,
       
   121             const TPbkContactItemField* aField );
       
   122 
       
   123     private:    // Data
       
   124 
       
   125         // Ref to pbk owner.
       
   126         MPhoneCntPbkOwner& iPbkOwner;
       
   127         
       
   128         // Pointer to boolean flag, will be updated to ETrue upon destruction.
       
   129         TBool* iDestroyed;
       
   130 
       
   131         // Owned: single item fetch
       
   132         CPbkSingleItemFetchDlg* iFetch;        
       
   133 
       
   134         // Owned: single entry fetch
       
   135         CPhCntSingleCallFetchDlg* iEntryFetch;
       
   136 
       
   137         // Type of fetch
       
   138         CPhCntSingleItemFetch::TFetchType iType;
       
   139 
       
   140     };
       
   141 
       
   142 #endif      // CPHCNTSINGLEITEMFETCHIMPL_H
       
   143             
       
   144 // End of File