phoneengine/PhoneCntFinder/ContactService/inc/cphcntfetchcontact.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c)  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:  Definition of CPhCntFetchContact class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTFETCHCONTACT_H
       
    20 #define CPHCNTFETCHCONTACT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "cphcntasynctosync.h"
       
    25 #include "MPhCntContactFetchObserver.h"
       
    26 
       
    27 class MPhCntContactStores;
       
    28 class MVPbkContactLink;
       
    29 class MVPbkStoreContact;
       
    30 
       
    31 /**
       
    32  *  ?one_line_short_description
       
    33  *
       
    34  *  ?more_complete_description
       
    35  *
       
    36  *  @lib ?library
       
    37  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CPhCntFetchContact ) : 
       
    40     public CPhCntAsyncToSync,
       
    41     public MPhCntContactFetchObserver
       
    42     {
       
    43 public:
       
    44     static CPhCntFetchContact* NewL( MPhCntContactStores& aContactStores );
       
    45 
       
    46     static CPhCntFetchContact* NewLC( MPhCntContactStores& aContactStores );
       
    47 
       
    48     virtual ~CPhCntFetchContact();
       
    49     
       
    50     /**
       
    51      * Fetches contact, which aContactLink identifies.
       
    52      *
       
    53      * @since S60 ?S60_version
       
    54      * @param ?arg1 ?description
       
    55      * @param ?arg2 ?description
       
    56      * @return ?description
       
    57      */
       
    58     TInt FetchContact( 
       
    59         const MVPbkContactLink& aContactLink, 
       
    60         CPhCntContact*& aContact );
       
    61         
       
    62      /**
       
    63       * Fetches first contact from array of contact links.
       
    64       *
       
    65       * @since S60 v3.2
       
    66       * @param aContactLinkArray Contact link array as descriptor.
       
    67       * @param aContact Result of the fetch.
       
    68       * @return Error code.
       
    69       */
       
    70      TInt FetchContact( 
       
    71         const TDesC8& aContactLinkArray, 
       
    72         CPhCntContact*& aContact );
       
    73     
       
    74 // from base class CPhCntAsyncToSync
       
    75 
       
    76     /**
       
    77      * From CPhCntAsyncToSync
       
    78      * ?description
       
    79      *
       
    80      * @since S60 ?S60_version
       
    81      * @param ?arg1 ?description
       
    82      */
       
    83      void DoMakeAsyncRequestL();
       
    84 
       
    85 // from base class MPhCntContactFetchObserver
       
    86 
       
    87     /**
       
    88      * From MPhCntContactFetchObserver
       
    89      * ?description
       
    90      *
       
    91      * @since S60 ?S60_version
       
    92      * @param ?arg1 ?description
       
    93      */
       
    94      void ContactReceived( CPhCntContact* aContact, TInt aError );
       
    95 
       
    96 private:
       
    97 
       
    98     CPhCntFetchContact( MPhCntContactStores& aContactStores );
       
    99 
       
   100     void ConstructL();
       
   101 
       
   102 private: // data
       
   103 
       
   104     /**
       
   105      * Contact stores, where contact is fetched.
       
   106      * Not own.
       
   107      */
       
   108     MPhCntContactStores& iContactStores;
       
   109     
       
   110     /**
       
   111      * Received contact.
       
   112      * Not own.
       
   113      */
       
   114     CPhCntContact* iReceivedContact;
       
   115     
       
   116     /**
       
   117      * Link to the contact to be fetched.
       
   118      * Not own.
       
   119      */
       
   120     const MVPbkContactLink* iContactLink;
       
   121 
       
   122     };
       
   123 
       
   124 #endif // CPHCNTFETCHCONTACT_H