telephonyserverplugins/multimodetsy/test/Te_LoopBack/Te_LoopBackrestartsignal.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "Te_LoopBackrestartsignal.h"
       
    17 #include "Te_LoopBackScriptEng.h"
       
    18 
       
    19 CRestartSignal* CRestartSignal::NewL(CATScriptEng* aScriptEng)
       
    20 	{
       
    21 	CRestartSignal* self=new(ELeave) CRestartSignal(aScriptEng);
       
    22 	return self;
       
    23 	}
       
    24 
       
    25 CRestartSignal::CRestartSignal(CATScriptEng* aScriptEng)
       
    26 					: CActive(EPriorityStandard), iScriptEng(aScriptEng)
       
    27 	{
       
    28 	CActiveScheduler::Add(this);
       
    29 	}
       
    30 
       
    31 void CRestartSignal::Start(TRequestStatus** aStatus)
       
    32 	{
       
    33 	*aStatus=&iStatus;
       
    34 	iStatus = KRequestPending;
       
    35 	SetActive();
       
    36 	}
       
    37 
       
    38 CRestartSignal::~CRestartSignal()
       
    39 	{
       
    40 	Cancel();
       
    41 	}
       
    42 
       
    43 void CRestartSignal::RunL()
       
    44 	{
       
    45 	iScriptEng->Restart();
       
    46 	iStatus = KRequestPending;
       
    47 	SetActive();
       
    48 	}
       
    49 
       
    50 void CRestartSignal::DoCancel()
       
    51 	{
       
    52 	TRequestStatus* status=&iStatus;
       
    53 	User::RequestComplete(status,KErrCancel);
       
    54 	}