phoneclientserver/phoneserver/Inc/Ussd/CPhSrvUssdReplyTimer.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002 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 timer based class used to notify objects when an automatic
       
    15 *                response is expected.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHSRVUSSDREPLYTIMER_H
       
    21 #define CPHSRVUSSDREPLYTIMER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MPhSrvUssdReplyTimerObserver;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  A timer based class used to notify objects when an 
       
    36 *  automatic response is expected
       
    37 *
       
    38 *  @since 1.0
       
    39 */
       
    40 class CPhSrvUssdReplyTimer : public CTimer
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         *
       
    47         * @param aObserver Observer for reply timer expiration event.
       
    48         */
       
    49         static CPhSrvUssdReplyTimer* 
       
    50             NewL( MPhSrvUssdReplyTimerObserver& aObserver );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         ~CPhSrvUssdReplyTimer();
       
    56         
       
    57 
       
    58     public: // New functions
       
    59 
       
    60         /**
       
    61         * Query is the timer active or not.
       
    62         * 
       
    63         * @return True if timer is running/paused.
       
    64         */
       
    65         TBool IsTimerActive() const;
       
    66 
       
    67         /**
       
    68         * Start the timer.
       
    69         */
       
    70         void Start();
       
    71 
       
    72         /**
       
    73         * Pause the timer.
       
    74         */
       
    75         void Pause();
       
    76 
       
    77         /**
       
    78         * Continue paused timer.
       
    79         */
       
    80         void Continue();
       
    81 
       
    82         /**
       
    83         * Stop the timer.
       
    84         */
       
    85         void Stop();
       
    86 
       
    87 
       
    88     private: // Functions from base classes
       
    89 
       
    90         /**
       
    91         * From CActive
       
    92         */
       
    93         void RunL();
       
    94 
       
    95         /**
       
    96         * From CActive
       
    97         */
       
    98         TInt RunError( TInt aError );
       
    99 
       
   100 
       
   101     private:
       
   102 
       
   103         /**
       
   104         * C++ constructor.
       
   105         */
       
   106         CPhSrvUssdReplyTimer( MPhSrvUssdReplyTimerObserver& aObserver );
       
   107 
       
   108         /**
       
   109         * By default Symbian 2nd phase constructor is private.
       
   110         */
       
   111         void ConstructL();
       
   112 
       
   113 
       
   114     private:     // Data
       
   115 
       
   116         // The actual timer.
       
   117         RTimer iTimer;
       
   118 
       
   119         // The counter for remaining time.
       
   120         TTimeIntervalMicroSeconds32 iTimeLeft;
       
   121 
       
   122         // When the timer was started last time.
       
   123         TTime iLastStartTime;
       
   124 
       
   125         // Observer for timer events.
       
   126         MPhSrvUssdReplyTimerObserver& iObserver;
       
   127     };
       
   128 
       
   129 #endif // CPHSRVUSSDREPLYTIMER_H
       
   130 
       
   131 
       
   132 // End of File