lowlevellibsandfws/pluginfw/Framework/RegistrarTest/RegistrarStubs.cpp
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 // The stub classes for testing the CRegistrar class 
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "Discoverer.h"
       
    19 #include "BackupNotifier.h"
       
    20 #include "RegistryData.h"
       
    21 
       
    22 //******************************************
       
    23 // CDiscoverer Stubs
       
    24 //******************************************
       
    25 CDiscoverer* CDiscoverer::NewL(MDiscovererObserver& aDiscovererObserver, RFs& aFs)
       
    26 	{
       
    27 	return new(ELeave) CDiscoverer(aDiscovererObserver, aFs);
       
    28 	}
       
    29 
       
    30 CDiscoverer::CDiscoverer(MDiscovererObserver& aDiscovererObserver, RFs& aFs) :
       
    31 CBase(),
       
    32 iDiscovererObserver(aDiscovererObserver),
       
    33 iFs(aFs)
       
    34 	{
       
    35 	}
       
    36 
       
    37 CDiscoverer::~CDiscoverer()
       
    38 	{
       
    39 	}
       
    40 
       
    41 TInt CDiscoverer::Suspend()
       
    42 	{
       
    43 	return KErrNone;
       
    44 	}
       
    45 
       
    46 TInt CDiscoverer::Resume()
       
    47 	{
       
    48 	return KErrNone;
       
    49 	}
       
    50 
       
    51 //******************************************
       
    52 // CBackupNotifier Stubs
       
    53 //******************************************
       
    54 CBackupNotifier* CBackupNotifier::NewL(MBackupNotifierObserver& aObserver)
       
    55 	{
       
    56 	return new(ELeave) CBackupNotifier(aObserver);
       
    57 	}
       
    58 
       
    59 CBackupNotifier::CBackupNotifier(MBackupNotifierObserver& aObserver) :
       
    60 CBase(),
       
    61 iObserver(aObserver)
       
    62 	{
       
    63 	}
       
    64 
       
    65 CBackupNotifier::~CBackupNotifier()
       
    66 	{
       
    67 	}
       
    68 
       
    69 void CBackupNotifier::HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes)
       
    70 	{
       
    71 	switch(aBackupOperationAttributes.iOperation)
       
    72 		{
       
    73 		case EStart:
       
    74 			iObserver.Suspend();
       
    75 			break;
       
    76 		case EEnd:
       
    77 			iObserver.Resume();
       
    78 			break;
       
    79 		default:
       
    80 			break;
       
    81 		}
       
    82 	}