messagingfw/watcherfw/src/watcherwait.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2000-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 // watcherwait.cpp
       
    15 //
       
    16 
       
    17 #include <watcher.h>
       
    18 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS 
       
    19 #include "cwatcher.h"
       
    20 #endif
       
    21 
       
    22 EXPORT_C CWatcherWait* CWatcherWait::NewLC(TInt aPriority)
       
    23 	{
       
    24 	CWatcherWait* self = new(ELeave)CWatcherWait(aPriority);
       
    25 	CleanupStack::PushL(self);
       
    26 	return self;
       
    27 	}
       
    28 
       
    29 CWatcherWait::CWatcherWait(TInt aPriority)
       
    30 : CActive(aPriority)
       
    31 	{
       
    32 	CActiveScheduler::Add(this);
       
    33 	}
       
    34 
       
    35 EXPORT_C CWatcherWait::~CWatcherWait()
       
    36 	{
       
    37 	Cancel();
       
    38 	}
       
    39 
       
    40 EXPORT_C void CWatcherWait::Start()
       
    41 	{
       
    42 	iStatus = KRequestPending;
       
    43 	SetActive();
       
    44 	}
       
    45 
       
    46 void CWatcherWait::RunL()
       
    47 	{
       
    48 	CActiveScheduler::Stop();
       
    49 	}
       
    50 
       
    51 void CWatcherWait::DoCancel()
       
    52 	{
       
    53 	TRequestStatus* s=&iStatus;
       
    54 	User::RequestComplete(s, KErrCancel);
       
    55 	}