convergedcallengine/cce/inc/cccedurationtimer.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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:  Provides call duration timer for PS calls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCCEDURATIONTIMER_H
       
    20 #define CCCEDURATIONTIMER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MCCECallObserver;
       
    27 class MCCEConferenceCallObserver;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  CCCEDurationTimer call duration class.
       
    33 *  Used for count call duration
       
    34 *
       
    35 *  @lib cce.lib
       
    36 *  @since Series 60 3.2
       
    37 */
       
    38 NONSHARABLE_CLASS(CCCEDurationTimer) : public CBase, public MBeating
       
    39     {
       
    40 public:
       
    41 
       
    42     /**
       
    43     * Two-phased constructor.
       
    44     */
       
    45     static CCCEDurationTimer* NewL();
       
    46 
       
    47     /**
       
    48     * Destructor
       
    49     */
       
    50     virtual ~CCCEDurationTimer(); 
       
    51 
       
    52 public:
       
    53     
       
    54     /**
       
    55      * Set observer
       
    56      *
       
    57      * @since S60 v3.2
       
    58      */
       
    59     void SetObserver( MCCECallObserver* aObserver );
       
    60 
       
    61     /**
       
    62      * Set conference call observer
       
    63      *
       
    64      * @since S60 v3.2
       
    65      */
       
    66 	void SetConferenceObserver( MCCEConferenceCallObserver* aObserver );
       
    67 
       
    68     /**
       
    69      * Start timer.
       
    70      *
       
    71      * @since S60 v3.2
       
    72      */
       
    73     void Start();
       
    74     
       
    75     /**
       
    76      * Start timer
       
    77      *
       
    78      * @since S60 v3.2
       
    79      */
       
    80     void Start(TInt aBeatsOffset);
       
    81 	
       
    82     /**
       
    83      * Restart air duration timer from the given value
       
    84      *
       
    85      * @since S60 v3.2
       
    86      * @param aBeatsOffset innitial timer value
       
    87      */
       
    88     void RestartAirTimeDuration(TInt aBeatsOffset);
       
    89 	
       
    90     /**
       
    91      * Start timer
       
    92      *
       
    93      * @since S60 v3.2
       
    94      */
       
    95     void StartAirTimeDuration();
       
    96     
       
    97     /**
       
    98      * Call start time
       
    99      *
       
   100      * @since S60 v3.2
       
   101      */
       
   102     TDateTime StartTime();  
       
   103 
       
   104     /**
       
   105      * Stop timer
       
   106      *
       
   107      * @since S60 v3.2
       
   108      * @return True if heart beat runner was started
       
   109      */
       
   110     TBool Stop();
       
   111 
       
   112     /**
       
   113      * Returns number of beats from the previous Start of the timer.
       
   114      * @since S60 v3.2
       
   115      */
       
   116     TInt NumberOfBeats() const;
       
   117     
       
   118     /**
       
   119      * Set the number of beats to zero
       
   120      * @since S60 v3.2
       
   121      */
       
   122     void Reset();
       
   123     
       
   124 // from base class MBeating
       
   125 
       
   126     /**
       
   127      * Called when we need to synchronize
       
   128      *
       
   129      * @since S60 v3.2
       
   130      */
       
   131     void Synchronize();
       
   132 
       
   133 protected:
       
   134 
       
   135     /**
       
   136      * Default constructor
       
   137      */
       
   138     CCCEDurationTimer();
       
   139 
       
   140     /**
       
   141      * 2nd phase of the construction
       
   142      */
       
   143     void ConstructL();
       
   144 
       
   145 // from base class MBeating
       
   146 
       
   147     /**
       
   148      * Called when beat works ok, once every second.
       
   149      *
       
   150      * @since S60 v3.2
       
   151      */
       
   152     void Beat();        
       
   153 
       
   154 private: // data
       
   155 
       
   156     /**
       
   157      * Pointer to PS Data object. 
       
   158      * If this is NULL, timer is used to AirTime duration.
       
   159      */
       
   160     MCCECallObserver* iObserver;
       
   161 	
       
   162     /**
       
   163      * Conference call duration observer.
       
   164      */
       
   165 	MCCEConferenceCallObserver* iConferenceCallObserver;
       
   166 
       
   167     /**
       
   168      * Timer
       
   169      * Own
       
   170      */
       
   171     CHeartbeat*     iHeartbeat; 
       
   172 
       
   173     /**
       
   174      * True if timer is running
       
   175      */
       
   176     TBool           iActive; 
       
   177 
       
   178     /**
       
   179      * Current timer value
       
   180      */
       
   181     TInt            iNumberOfBeats;
       
   182 
       
   183     /**
       
   184      * Timer start time
       
   185      */
       
   186     TTime           iStartTime;
       
   187 
       
   188     /**
       
   189      * Is this timer instance used to airtimeduration
       
   190      */
       
   191     TBool           iAirTimeDuration;
       
   192     };
       
   193 
       
   194 #endif      // CCCEDURATIONTIMER_H
       
   195 
       
   196 // End of File