phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CContactRetriever.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2004-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:  Virtual Phonebook asynchronous single contact retriever 
       
    15                  operation.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CCONTACTRETRIEVER_H
       
    21 #define CCONTACTRETRIEVER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MVPbkContactOperation.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MVPbkContactLink;
       
    30 class MVPbkSingleContactOperationObserver;
       
    31 namespace VPbkEngUtils { class CVPbkAsyncOperation; }
       
    32 class CContactDatabase;
       
    33 
       
    34 namespace VPbkCntModel {
       
    35 
       
    36 class CContactLink;
       
    37 class CContactStore;
       
    38 class CContact;
       
    39 
       
    40 // CLASS DECLARATIONS
       
    41 
       
    42 /**
       
    43  * Virtual Phonebook asynchronous single contact retriever operation.
       
    44  */
       
    45 NONSHARABLE_CLASS( CContactRetriever ): 
       
    46         public CBase,
       
    47         public MVPbkContactOperation
       
    48     {
       
    49     public:  // Constructor, destructor
       
    50         /**
       
    51          * Creates a asynchronous contact retriever.
       
    52          */
       
    53         static CContactRetriever* NewLC(
       
    54                 const MVPbkContactLink& aLink,
       
    55                 CContactStore& aContactStore,
       
    56                 MVPbkSingleContactOperationObserver& aObserver);
       
    57 
       
    58         /**
       
    59          * Creates a asynchronous contact retriever.
       
    60          * Takes ownership of the aLink.
       
    61          */
       
    62         static CContactRetriever* NewLC(
       
    63                 MVPbkContactLink* aLink,
       
    64                 CContactStore& aContactStore,
       
    65                 MVPbkSingleContactOperationObserver& aObserver);
       
    66 
       
    67         /**
       
    68          * Destructor. Cancels any previously executing read operation and
       
    69          * destroys this object.
       
    70          */
       
    71         ~CContactRetriever();
       
    72 
       
    73     public: // from MVPbkContactOperation
       
    74         void StartL();
       
    75         void Cancel();
       
    76         
       
    77     private: // implementation
       
    78         CContactRetriever(CContactStore& aContactStore,
       
    79                          MVPbkSingleContactOperationObserver& aObserver);
       
    80         void BaseConstructL();
       
    81         void ConstructL(const MVPbkContactLink& aLink);
       
    82         void ConstructL(MVPbkContactLink* aLink);
       
    83         void DoReadL(MVPbkSingleContactOperationObserver& aObserver);
       
    84         void RetrieveError(MVPbkSingleContactOperationObserver& aObserver, TInt aError);
       
    85 
       
    86     private: // data members
       
    87         ///Ref: Contact store
       
    88         CContactStore& iContactStore;
       
    89         ///Ref: contact operation observer
       
    90         MVPbkSingleContactOperationObserver& iObserver;
       
    91         ///Own: contact link
       
    92         CContactLink* iLink;
       
    93         ///Own: Asynchronous operation
       
    94         VPbkEngUtils::CVPbkAsyncOperation* iAsyncOperation;
       
    95 
       
    96     };
       
    97 
       
    98 } // namespace VPbkCntModel
       
    99 
       
   100 #endif // CCONTACTRETRIEVER_H
       
   101 //End of file
       
   102