phonebookengines/VirtualPhonebook/VPbkSimStoreImpl/inc/CCacheReadyNotificationCmd.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     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:  A command that completes when TSY cache is ready
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VPBKSIMSTOREIMPL_CCACHEREADYNOTIFICATIONCMD_H
       
    21 #define VPBKSIMSTOREIMPL_CCACHEREADYNOTIFICATIONCMD_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MVPbkSimCommand.h>
       
    26 #include <rmmcustomapi.h>
       
    27 
       
    28 namespace VPbkSimStoreImpl {
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CCustomStore;
       
    32 class CCacheStatusCmd;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  A command that completes when TSY cache is ready.
       
    38 */
       
    39 NONSHARABLE_CLASS(CCacheReadyNotificationCmd) : public CActive,
       
    40                                                 public MVPbkSimCommand
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         * @param aStore a store that supports notification
       
    47         * @param aCacheStatus the TSY cache status
       
    48         * @return a new instance of this class
       
    49         */
       
    50         static CCacheReadyNotificationCmd* NewLC( CCustomStore& aStore,
       
    51             RMmCustomAPI::TPndCacheStatus& aCacheStatus,
       
    52             CCacheStatusCmd& aCacheStatusCmd );
       
    53         
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CCacheReadyNotificationCmd();
       
    58 
       
    59     public: // Functions from base classes
       
    60 
       
    61         /**
       
    62         * From MVPbkSimCommand
       
    63         */
       
    64         void Execute();
       
    65 
       
    66         /**
       
    67         * From MVPbkSimCommand
       
    68         */
       
    69         void AddObserverL( MVPbkSimCommandObserver& aObserver );
       
    70 
       
    71         /**
       
    72         * From MVPbkSimCommand
       
    73         */
       
    74         void CancelCmd();
       
    75         
       
    76     private: // Functions from base classes
       
    77         /**
       
    78         * From CActive
       
    79         */
       
    80         void RunL();
       
    81         
       
    82         /**
       
    83         * From CActive
       
    84         */
       
    85         void DoCancel();
       
    86         
       
    87     private:
       
    88 
       
    89         /**
       
    90         * C++ default constructor.
       
    91         */
       
    92         CCacheReadyNotificationCmd( CCustomStore& aStore, 
       
    93             RMmCustomAPI::TPndCacheStatus& aCacheStatus,
       
    94             CCacheStatusCmd& aCacheStatusCmd );
       
    95 
       
    96     private:    // Data
       
    97         /// a store that supports notification
       
    98         CCustomStore& iStore;
       
    99         /// The name of the phonebook which is becomes ready
       
   100         TName iETelStoreName;
       
   101         /// The TSY cache status which is updated if notfication completes
       
   102         RMmCustomAPI::TPndCacheStatus& iCacheStatus;
       
   103         /// Ref: A command that can get current TSY cache state.
       
   104         CCacheStatusCmd& iCacheStatusCmd;
       
   105         /// Ref: only one observer supported
       
   106         MVPbkSimCommandObserver* iObserver;
       
   107     };
       
   108 } // namespace VPbkSimStoreImpl
       
   109 #endif      // VPBKSIMSTOREIMPL_CCACHEREADYNOTIFICATIONCMD_H
       
   110             
       
   111 // End of File