internetradio2.0/irdataprovider/inc/irdataprovidertimer.h
changeset 14 896e9dbc5f19
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
       
     1 /*
       
     2 * Copyright (c) 2006-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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IRDATAPROVIDERTIMER_H
       
    20 #define IRDATAPROVIDERTIMER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  * Call for timer expiry
       
    26  */
       
    27 class MIRDataProviderTimeoutNotifier
       
    28     {
       
    29 public:
       
    30 
       
    31     /**
       
    32      * Called when the timer raises an event.
       
    33      */
       
    34     virtual void TimerExpired() = 0;
       
    35     };
       
    36 
       
    37 /**
       
    38  * Timer class for response timerouts
       
    39  */
       
    40 NONSHARABLE_CLASS ( CIRDataProviderTimer ) : public CTimer
       
    41     {
       
    42 public:
       
    43 
       
    44     /**
       
    45      * CIRDataProviderTimer::NewL()
       
    46      * Two phase constructor
       
    47      * @param aPriority Specifies the priority of the timer
       
    48      * @param aNotify Reference of the observer
       
    49      * @return CIRDataProviderTimer object
       
    50      */
       
    51 
       
    52     static CIRDataProviderTimer *NewL( const TInt aPriority,
       
    53                     MIRDataProviderTimeoutNotifier &aNotify );
       
    54 
       
    55     /** 
       
    56      * CIRDataProviderTimer::NewLC()
       
    57      * @param aPriority Specifies the priority of the timer
       
    58      * @param aNotify Reference of the observer
       
    59      * @return CIRDataProviderTimer object
       
    60      */
       
    61     static CIRDataProviderTimer *NewLC( const TInt aPriority,
       
    62                     MIRDataProviderTimeoutNotifier &aNotify );
       
    63 
       
    64     /**
       
    65      * CIRDataProviderTimer::~CIRDataProviderTimer()
       
    66      * Default C++ destructor
       
    67      */
       
    68     virtual ~CIRDataProviderTimer();
       
    69 
       
    70 protected:
       
    71 
       
    72     /** 
       
    73      * Derived from CTimer
       
    74      * CIRDataProviderTimer::RunL()
       
    75      */
       
    76     void RunL();
       
    77 
       
    78     /** 
       
    79      * Derived from CTimer
       
    80      * CIRDataProviderTimer::RunError()
       
    81      */
       
    82     TInt RunError( TInt aError );
       
    83 
       
    84 private:
       
    85 
       
    86     /**
       
    87      * CIRDataProviderTimer::CIRDataProviderTimer()
       
    88      * 
       
    89      */
       
    90     CIRDataProviderTimer( const TInt aPriority,
       
    91                     MIRDataProviderTimeoutNotifier &aNotify );
       
    92 
       
    93     /**
       
    94      * CIRDataProviderTimer::ConstructL()
       
    95      * Second phase constructor
       
    96      */
       
    97     void ConstructL();
       
    98 
       
    99 private:
       
   100 
       
   101     /** 
       
   102      * Handle to the class to be notified of a timeout event.
       
   103      */
       
   104     MIRDataProviderTimeoutNotifier &iNotify;
       
   105 
       
   106     };
       
   107 
       
   108 #endif // IRDATAPROVIDERTIMER_H
       
   109 
       
   110