upnp/upnpstack/upnphttptransfer/inc/httptransfertimer.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:  Header file of the class CHttpTransferTimer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_HTTPTRANSFERTIMER_H
       
    20 #define C_HTTPTRANSFERTIMER_H
       
    21 
       
    22 // system includes
       
    23 #include <e32base.h>
       
    24 #include <e32cons.h>
       
    25 
       
    26 // forward declarations
       
    27 class MHttpTransferTimerObserver;
       
    28 
       
    29 /**
       
    30  * This class is a timer that launches new transfers in CHttpUploader
       
    31  * and CHttpDownloader
       
    32  *
       
    33  *
       
    34  * @lib httptransfer.lib
       
    35  * @since S60 v3.2
       
    36  */
       
    37 class CHttpTransferTimer : public CBase,
       
    38                            public MBeating
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Static NewL method to construct the timer.
       
    44      *
       
    45      * @since S60 3.2
       
    46      * @param aInterval Timer interval in seconds 
       
    47      * @param aCallback The call back reference 
       
    48      * @return CHttpTransferTimer* timer instance
       
    49      */
       
    50     static CHttpTransferTimer* NewL( 
       
    51                                 TInt aInterval,
       
    52                                 MHttpTransferTimerObserver* aCallback );
       
    53 
       
    54     /**
       
    55      * Destructor
       
    56      *
       
    57      * @since S60 v3.2
       
    58      */
       
    59     virtual ~CHttpTransferTimer();
       
    60 
       
    61 private:
       
    62 
       
    63     /**
       
    64      * Second phase constructor
       
    65      *
       
    66      * @since S60 v3.2
       
    67      */
       
    68     void ConstructL();
       
    69 
       
    70     /**
       
    71      * Constructor
       
    72      *
       
    73      * @since S60 v3.2
       
    74      * @param aInterval Interval when call back is called
       
    75      * @param aCallback Callback interface
       
    76      */
       
    77     CHttpTransferTimer( TInt aInterval,
       
    78                         MHttpTransferTimerObserver* aCallback );
       
    79 
       
    80 private: 
       
    81 
       
    82 // From base class MBeating
       
    83 
       
    84     /**
       
    85      * Called when the beat is in sync.
       
    86      *
       
    87      * @since S60 3.0
       
    88      */
       
    89     void Beat();
       
    90 
       
    91     /**
       
    92      * Called when the beat needs to be syncronized.
       
    93      *
       
    94      * @since S60 3.0
       
    95      */
       
    96     void Synchronize() {}
       
    97 
       
    98 private: 
       
    99     
       
   100     /**
       
   101      * Heartbeat active object
       
   102      * Own.
       
   103      */
       
   104     CHeartbeat* iHeartbeat;
       
   105 
       
   106     /**
       
   107      * Call back pointer.
       
   108      * Not own.
       
   109      */
       
   110     MHttpTransferTimerObserver *iCallback;
       
   111 
       
   112     /**
       
   113      * Interval in seconds
       
   114      */
       
   115     TInt iInterval;
       
   116     
       
   117     /**
       
   118      * Counter
       
   119      */
       
   120     TInt iCounter;
       
   121      
       
   122     };
       
   123 
       
   124 #endif // C_HTTPTRANSFERTIMER_H
       
   125 
       
   126 // End of file