phonebookui/Phonebook2/inc/CPbk2MemoryEntryContactLoader.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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:  Phonebook 2 memory entry contact loader.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2MEMORYENTRYCONTACTLOADER_H
       
    20 #define CPBK2MEMORYENTRYCONTACTLOADER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2ContactNavigationLoader.h>
       
    25 #include <MVPbkSingleContactOperationObserver.h>
       
    26 #include <MVPbkContactStoreObserver.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MVPbkStoreContact;
       
    30 class MVPbkContactOperationBase;
       
    31 class MPbk2MemoryEntryView;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Phonebook 2 memory entry contact loader utility class.
       
    37  */
       
    38 class CPbk2MemoryEntryContactLoader : public CBase,
       
    39                                       public MPbk2ContactNavigationLoader,
       
    40                                       private MVPbkSingleContactOperationObserver,
       
    41                                       private MVPbkContactStoreObserver
       
    42     {
       
    43     public: // Constructors and destructor
       
    44 
       
    45         /**
       
    46          * Creates a new instance of this class.
       
    47          *
       
    48          * @param aMemoryEntryAppView   Memory entry app view using the
       
    49          *              services of this class.
       
    50          * @return  A new instance of this class.
       
    51          */
       
    52         IMPORT_C static CPbk2MemoryEntryContactLoader* NewL(
       
    53                 MPbk2MemoryEntryView& aMemoryEntryView );
       
    54 
       
    55         /**
       
    56          * Destructor.
       
    57          */
       
    58         ~CPbk2MemoryEntryContactLoader();
       
    59 
       
    60     public: // From MPbk2ContactNavigationLoader
       
    61         IMPORT_C void ChangeContactL(
       
    62                 const MVPbkContactLink& aContactLink );
       
    63         IMPORT_C MVPbkContactLink* ContactLinkLC() const;
       
    64 
       
    65     private: // From MVPbkSingleContactOperationObserver
       
    66         void VPbkSingleContactOperationComplete(
       
    67                 MVPbkContactOperationBase& aOperation,
       
    68                 MVPbkStoreContact* aContact );
       
    69         void VPbkSingleContactOperationFailed(
       
    70                 MVPbkContactOperationBase& aOperation,
       
    71                 TInt aError );
       
    72 
       
    73     private: // From MVPbkContactStoreObserver
       
    74         void StoreReady(
       
    75                 MVPbkContactStore& aContactStore );
       
    76         void StoreUnavailable(
       
    77                 MVPbkContactStore& aContactStore,
       
    78                 TInt aReason );
       
    79         void HandleStoreEventL(
       
    80                 MVPbkContactStore& aContactStore,
       
    81                 TVPbkContactStoreEvent aStoreEvent );
       
    82 
       
    83     private: // Implementation
       
    84         CPbk2MemoryEntryContactLoader(
       
    85                 MPbk2MemoryEntryView& aMemoryEntryView );
       
    86         void RetrieveContactL();
       
    87 
       
    88     protected: // Data
       
    89         /// Own: Retrieve operation
       
    90         MVPbkContactOperationBase* iRetrieveOperation;
       
    91         /// Ref: Memory entry appview
       
    92         MPbk2MemoryEntryView& iMemoryEntryView;
       
    93         /// Own: Contact link
       
    94         MVPbkContactLink* iContactLink;
       
    95         /// Ref: Contact store of the current contact
       
    96         MVPbkContactStore* iContactStore;
       
    97     };
       
    98 
       
    99 #endif // CPBK2MEMORYENTRYCONTACTLOADER_H
       
   100 
       
   101 // End of File