os/persistentdata/featuremgmt/featuremgr/test/helper/test_plugins/inc/plugintimer.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2002-2009 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:
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 #ifndef __PLUGINTIMER_H_
    22 #define __PLUGINTIMER_H_
    23 
    24 #include <featmgr/featureinfoplugin.h>
    25 
    26 /**
    27 *  An interface for handling timer expiration events.
    28 */
    29 class MPluginTimerCallback
    30     {
    31     public:
    32         /** 
    33         * Called when the timer fires
    34         */
    35         virtual void GenericTimerFiredL( MFeatureInfoPluginCallback& aService,
    36                                        FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    37                                        TUint8 aTransId,
    38                                        TInt aRetVal ) = 0;
    39     };
    40 
    41 
    42 class CPluginTimer : public CTimer
    43     {
    44     public:
    45         CPluginTimer( TInt aPriority, 
    46                       MFeatureInfoPluginCallback& aService,
    47                       FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    48                       TUint8 aTransId,
    49                       TInt aRetVal,
    50                       MPluginTimerCallback* aCallback );
    51         
    52         ~CPluginTimer();
    53 
    54         CPluginTimer(TInt aPriority);
    55 
    56         static CPluginTimer* NewL( const TTimeIntervalMicroSeconds32& anInterval, 
    57                                    MFeatureInfoPluginCallback& aService,
    58                                    FeatureInfoCommand::TFeatureInfoCmd aCommandId,
    59                                    TUint8 aTransId,
    60                                    TInt aRetVal,
    61                                    MPluginTimerCallback* aCallback );
    62                          
    63         void ConstructL();
    64         
    65         void RunL();
    66         
    67         inline TUint8 TransId() const
    68             {
    69             return  iTransId;
    70             };
    71     
    72     private:
    73     
    74        MFeatureInfoPluginCallback& iService;  // Not owned
    75         
    76        FeatureInfoCommand::TFeatureInfoCmd iCommandId;
    77        TUint8 iTransId;
    78        TInt iRetVal;
    79        
    80        MPluginTimerCallback* iCallback;  // Not owned
    81     
    82     };
    83 
    84 
    85 #endif // __PLUGINTIMER_H_