phonebookui/Phonebook2/Presentation/inc/CPbk2DefaultSavingStoreMonitor.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 *     Phonebook 2 default saving store monitor.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPBK2DEFAULTSAVINGSTOREMONITOR_H
       
    21 #define CPBK2DEFAULTSAVINGSTOREMONITOR_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CRepository;
       
    29 class TVPbkContactStoreUriPtr;
       
    30 class CVPbkContactStoreUriArray;
       
    31 class MPbk2DefaultSavingStoreObserver;
       
    32 
       
    33 /**
       
    34  * Phonebook 2 contact store configuration monitor.
       
    35  */
       
    36 NONSHARABLE_CLASS(CPbk2DefaultSavingStoreMonitor) : 
       
    37         public CActive
       
    38     {
       
    39 	public: // Construction & destruction
       
    40 		static CPbk2DefaultSavingStoreMonitor* NewL(
       
    41 		    CRepository& aRepository,
       
    42 		    MPbk2DefaultSavingStoreObserver& aObserver );
       
    43 
       
    44         ~CPbk2DefaultSavingStoreMonitor();
       
    45 
       
    46     public: //New functions
       
    47         /**
       
    48          * Return default saving store's uri. 
       
    49          *
       
    50          * @return default saving store
       
    51          */
       
    52         TVPbkContactStoreUriPtr DefaultSavingStoreL() const;
       
    53 
       
    54     private: // From CActive
       
    55         void RunL();
       
    56         void DoCancel();
       
    57         
       
    58     private: //New functions
       
    59         /**
       
    60          * Update default saving store   
       
    61          * return default saving store, ownership transferred     
       
    62          */
       
    63         HBufC* UpdateDefaultSavingStoreL() const;
       
    64 
       
    65     private: // Implementation
       
    66         CPbk2DefaultSavingStoreMonitor( 
       
    67             CRepository& aRepository,
       
    68 		    MPbk2DefaultSavingStoreObserver& aObserver );
       
    69         void ConstructL();
       
    70         void RenewRequestL();
       
    71 
       
    72 	private: // Data
       
    73         CRepository& iRepository;    
       
    74         /// Own: The URI of the default store
       
    75         mutable HBufC* iDefaultStoreUri;  
       
    76         /// Ref: observer for changes
       
    77         MPbk2DefaultSavingStoreObserver& iObserver;  
       
    78 	};
       
    79 
       
    80 #endif // CPBK2DEFAULTSAVINGSTOREMONITOR_H
       
    81 
       
    82 // End of File