upnp/upnpstack/upnphttptransfer/inc/httpnotifytimer.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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:  Session timeout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_HTTPNOTIFYTIMER_H
       
    20 #define C_HTTPNOTIFYTIMER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CONSTANTS
       
    26 static const TInt KSecond = 1000000;
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CHttpNotifyTimer;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 * An interface from notifytimer to its customer (service)
       
    34 *
       
    35 *  @since Series60 5.0 HN
       
    36 */
       
    37 class MHttpNotifyTimerObserver
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42         * TimerEventL
       
    43         * A callback function to time updates.
       
    44         * @since Series60 5.0 HN
       
    45         * @param aTimer A pointer containing updated time.
       
    46         * @return None
       
    47         */
       
    48 	virtual void TimerEventL( CHttpNotifyTimer* aTimer ) = 0;
       
    49     };
       
    50     
       
    51 // CLASS DECLARATION
       
    52 /**
       
    53 * Wrapper for RTimer classs to notify observer about elaspsed time
       
    54 *
       
    55 *  @since Series60 5.0 HN
       
    56 */
       
    57 class CHttpNotifyTimer : public CActive
       
    58     {
       
    59     protected:
       
    60         /**
       
    61         * Constructor
       
    62         */
       
    63         CHttpNotifyTimer( MHttpNotifyTimerObserver* aObserver );
       
    64     public:
       
    65         static CHttpNotifyTimer* NewL(MHttpNotifyTimerObserver* aObserver);
       
    66         void ConstructL();
       
    67         
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71 	    ~CHttpNotifyTimer();
       
    72         /**
       
    73         * At
       
    74         * @since Series60 5.0 HN
       
    75         * @param aTime
       
    76         */
       
    77         void AfterSeconds( TInt aIntervalInSeconds );
       
    78        
       
    79         /**
       
    80         * RunL
       
    81         * Active object state machine.
       
    82         * @since Series60 5.0 HN
       
    83         */
       
    84     	void RunL();
       
    85 
       
    86         /**
       
    87         * RunError
       
    88         * RunError in case RunL leaves.
       
    89         * @since Series60 5.0 HN
       
    90         */
       
    91         TInt RunError( TInt aError );
       
    92 
       
    93         /**
       
    94         * DoCancel
       
    95         * Cancel outstanding request(s) and reset the iActive flag.
       
    96         * @since Series60 5.0 HN
       
    97         */
       
    98     	void DoCancel();
       
    99 
       
   100     private: 
       
   101 
       
   102         // Interface observer object, owned
       
   103     	MHttpNotifyTimerObserver* iObserver;
       
   104 
       
   105         // Timer, owned
       
   106     	RTimer iTimer;
       
   107 };
       
   108 
       
   109 
       
   110 #endif // C_HTTPNOTIFYTIMER_H
       
   111 
       
   112 // End Of File