accessoryservices/accessoryserver/inc/Server/AccSrvProcessCommandTimer.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Timer for ProcessCommand handling
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CACCSRVPROCESSCOMMANDTIMER_H
       
    20 #define CACCSRVPROCESSCOMMANDTIMER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "acc_debug.h"
       
    24 #include <e32base.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KInitCmdTimeOut    = 5000000;
       
    28 const TInt KProcessCmdTimeOut = 2500000;
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class MAccSrvProcessCommandObserver;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Timer class for time out of ProcessCommands.
       
    43 *
       
    44 *  @lib AccServer.exe
       
    45 *  @since S60 3.1
       
    46 */
       
    47 NONSHARABLE_CLASS( CAccSrvProcessCommandTimer ) : public CTimer
       
    48     {
       
    49     public: // Constructors and destructor
       
    50 
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CAccSrvProcessCommandTimer* NewL(
       
    55             MAccSrvProcessCommandObserver* aProcessCommandObserver,
       
    56             TInt aTime = KProcessCmdTimeOut );
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CAccSrvProcessCommandTimer();
       
    62 
       
    63     public: // New functions
       
    64 
       
    65        /**
       
    66         * Starts the timer.
       
    67         * @since S60 3.1
       
    68         * @param void
       
    69         * @return void
       
    70         */
       
    71         void StartTimer();
       
    72 
       
    73     public: // Functions from base classes
       
    74 
       
    75     protected: // New functions
       
    76 
       
    77     protected: // Functions from base classes
       
    78 
       
    79         /**
       
    80         * From CActive Handles an active object's request completion event.
       
    81         */
       
    82         void RunL();
       
    83         
       
    84         /**
       
    85         * From CActive Handles RunL's leave cases
       
    86         */
       
    87         TInt RunError( TInt aError );
       
    88 
       
    89     private:
       
    90 
       
    91         /**
       
    92         * C++ default constructor.
       
    93         */
       
    94         CAccSrvProcessCommandTimer(
       
    95             MAccSrvProcessCommandObserver* aProcessCommandObserver,
       
    96             TInt aTime );
       
    97 
       
    98         /**
       
    99         * By default Symbian 2nd phase constructor is private.
       
   100         */
       
   101         void ConstructL();
       
   102 
       
   103     public:     // Data
       
   104 
       
   105     protected:  // Data
       
   106 
       
   107     private:    // Data
       
   108 
       
   109         TInt iTime; // TimeOut time
       
   110 
       
   111         // Pointer to ProcessCommandObserver object
       
   112         MAccSrvProcessCommandObserver* iProcessCommandObserver; // Not owned
       
   113 
       
   114     public:     // Friend classes
       
   115 
       
   116     protected:  // Friend classes
       
   117 
       
   118     private:    // Friend classes
       
   119 
       
   120     };
       
   121 
       
   122 #endif // CACCSRVPROCESSCOMMANDTIMER_H
       
   123 
       
   124 // End of File