wvuing/wvuistorage/src/CCARefreshTimer.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004-2005 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:  Timer implementation to wait multiple refresh.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCAREFRESHTIMER_H
       
    20 #define CCAREFRESHTIMER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MCARefreshTimerObserver;
       
    27 
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  The CCARefreshTimer class handles the waiting functionality for the
       
    33 *  storage manager to wait before calling observer in case of multiple
       
    34 *  contacts adding.
       
    35 *
       
    36 *  @lib CAStorage.dll
       
    37 *  @since 2.8
       
    38 */
       
    39 class CCARefreshTimer : public CTimer
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * @param aObserver The observer to which the notify about the
       
    46         *                  timer events is
       
    47         * given.
       
    48         */
       
    49         static CCARefreshTimer* NewL( MCARefreshTimerObserver* aObserver );
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CCARefreshTimer(  );
       
    55 
       
    56     protected:  // Functions from CTimer
       
    57 
       
    58         /**
       
    59         * @see CTimer
       
    60         */
       
    61         void RunL();
       
    62 
       
    63         /**
       
    64         * @see CTimer
       
    65         */
       
    66         TInt RunError( TInt aError );
       
    67 
       
    68     public: // new methods
       
    69 
       
    70         /**
       
    71          * Starts timer. If timer is already running, stops timer and
       
    72          * restarts it.
       
    73          */
       
    74         void Start( );
       
    75 
       
    76     private:
       
    77 
       
    78         /**
       
    79         * C++ default constructor.
       
    80         */
       
    81         CCARefreshTimer( MCARefreshTimerObserver* aObserver );
       
    82 
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL();
       
    87 
       
    88     private:    // Data
       
    89 
       
    90         // A pointer to the observer
       
    91         MCARefreshTimerObserver* iObserver;			/// Not owned
       
    92     };
       
    93 
       
    94 #endif      // CCAREFRESHTIMER_H
       
    95 
       
    96 // End of File