systemswstubs/featuremanagerstub/src/plugintimer.cpp
changeset 46 e1758cbb96ac
parent 1 ffb8e2ddd8dc
equal deleted inserted replaced
43:e71858845f73 46:e1758cbb96ac
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Feature Manager stub plugin timer implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "plugintimer.h"
       
    20 #include <featureinfoplugin.h>
       
    21 #include "trace.h"
       
    22 
       
    23 CPluginTimer* CPluginTimer::NewL( const TTimeIntervalMicroSeconds32& anInterval, 
       
    24                                   MFeatureInfoPluginCallback& aService,
       
    25                                   FeatureInfoCommand::TFeatureInfoCmd aCommandId,
       
    26                                   TUint8 aTransId, 
       
    27                                   TInt aRetVal,
       
    28                                   MPluginTimerCallback* aCallback )
       
    29     {
       
    30     CPluginTimer* self = new( ELeave ) CPluginTimer(0, aService, aCommandId, 
       
    31                                                     aTransId, aRetVal, aCallback);
       
    32     
       
    33     CleanupStack::PushL( self );
       
    34     self->ConstructL();
       
    35     CleanupStack::Pop( self );
       
    36 
       
    37     CActiveScheduler::Add(self);
       
    38 
       
    39     COMPONENT_TRACE((_L("FeatMgr Plugin - CPluginTimer::NewL - Setting timer: %d"), anInterval));
       
    40 
       
    41     self->After(anInterval);
       
    42 
       
    43     return self;
       
    44     }
       
    45 
       
    46 CPluginTimer::~CPluginTimer()    
       
    47     {
       
    48     // PCLint demands
       
    49     iCallback = NULL; 
       
    50     }
       
    51 
       
    52 CPluginTimer::CPluginTimer( TInt aPriority, 
       
    53                             MFeatureInfoPluginCallback& aService,
       
    54                             FeatureInfoCommand::TFeatureInfoCmd aCommandId,
       
    55                             TUint8 aTransId,
       
    56                             TInt aRetVal,
       
    57                             MPluginTimerCallback* aCallback )
       
    58     : CTimer(aPriority),
       
    59     iService(aService),
       
    60     iCommandId(aCommandId),
       
    61     iTransId(aTransId),
       
    62     iRetVal(aRetVal),
       
    63     iCallback(aCallback)
       
    64     {
       
    65     }
       
    66 
       
    67 void CPluginTimer::ConstructL()
       
    68     {
       
    69     CTimer::ConstructL();
       
    70     }
       
    71 
       
    72     
       
    73 void CPluginTimer::RunL(  )
       
    74     {
       
    75     iCallback->GenericTimerFiredL(iService, iCommandId, iTransId, iRetVal );
       
    76 
       
    77     }
       
    78