meetingrequest/mrgui/inc/cesmrcontactmanagerhandler.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 2008-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:  Definition of class CESMRContactManagerHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRCONTACTMANAGERHANDLER_H
       
    20 #define CESMRCONTACTMANAGERHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <MVPbkContactStoreObserver.h>
       
    25 #include <MVPbkContactStoreListObserver.h>
       
    26 
       
    27 class CVPbkContactManager;
       
    28 
       
    29 NONSHARABLE_CLASS( MESMRContactManagerObserver )
       
    30     {
       
    31 public:
       
    32     virtual void ContactManagerReady ( ) = 0;
       
    33     };
       
    34 
       
    35 NONSHARABLE_CLASS( CESMRContactManagerHandler ) : 
       
    36 	public CBase,
       
    37     public MVPbkContactStoreListObserver
       
    38     {
       
    39 public:
       
    40     static CESMRContactManagerHandler* NewL ( );
       
    41     ~CESMRContactManagerHandler ( );
       
    42 
       
    43     /**
       
    44      * Is ready
       
    45      * @return ETrue if is else EFalse
       
    46      */
       
    47     IMPORT_C TBool IsReady ( );
       
    48     
       
    49     /**
       
    50      * Add observer
       
    51      * @param aObserver
       
    52      */
       
    53     IMPORT_C void AddObserverL (MESMRContactManagerObserver* aObserver );
       
    54     
       
    55     /**
       
    56      *  Remove observer
       
    57      *  @param aObserver
       
    58      */
       
    59     IMPORT_C void RemoveObserver (MESMRContactManagerObserver* aObserver );
       
    60     
       
    61     /**
       
    62      * Get contact manager
       
    63      */
       
    64     IMPORT_C CVPbkContactManager& GetContactManager ( );
       
    65 
       
    66 private:
       
    67     CESMRContactManagerHandler ( );
       
    68     void ConstructL ( );
       
    69 
       
    70     // from MVPbkContactStoreListObserver
       
    71     void OpenComplete ( );
       
    72     // from MVPbkContactStoreObserver
       
    73     void StoreReady (MVPbkContactStore& aContactStore );
       
    74     void StoreUnavailable (MVPbkContactStore& aContactStore, TInt aReason );
       
    75     void HandleStoreEventL (MVPbkContactStore& aContactStore,
       
    76             TVPbkContactStoreEvent aStoreEvent );
       
    77 
       
    78 private: //Data
       
    79 	/// Own:
       
    80     TBool iContactManagerReady;
       
    81     /// Own:
       
    82     CVPbkContactManager* iContactManager;
       
    83     /// Own:
       
    84     RPointerArray<MESMRContactManagerObserver> iObservers;
       
    85     };
       
    86 
       
    87 #endif