natplugins/natpnatfwsdpprovider/tsrc/testconsole/inc/nsptestmanager.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2008 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 #ifndef NSPTESTMANAGER_H
       
    19 #define NSPTESTMANAGER_H
       
    20 
       
    21 #include "nsptest.h"
       
    22 
       
    23 class CRepository;
       
    24 class CConsoleBase;
       
    25 class CNSPPlugin;
       
    26 //class MNSPTestVisitor;
       
    27 class MNSPTest;
       
    28 class CNSPTest;
       
    29 
       
    30 class CNSPTestManager : public CBase
       
    31 	{
       
    32 public: // Enums
       
    33 
       
    34 	enum TestType
       
    35 		{
       
    36 		ESingle,
       
    37 		ERelease,
       
    38 		EIce
       
    39 		};
       
    40 
       
    41 public: // Methods
       
    42 	static CNSPTestManager* NewL( CNSPPlugin& aApi, CRepository& aRep );
       
    43 	static CNSPTestManager* NewLC( CNSPPlugin& aApi, CRepository& aRep );
       
    44 	~CNSPTestManager();
       
    45 	
       
    46 	MNSPTest& RelTestL();
       
    47 	TInt Remove( MNSPTest& aTest );
       
    48 	void StartL( MNSPTest& aTest, CConsoleBase& aConsole );
       
    49 	void Cancel( MNSPTest& aTest );
       
    50 	void StartAllL( CConsoleBase& aConsole );
       
    51 	void CancelAll();
       
    52 	void AcceptL( MNSPTestVisitor& aVisitor );
       
    53 
       
    54 private: // Methods
       
    55 	CNSPTestManager( CNSPPlugin& aApi, CRepository& aRep );
       
    56 	void ConstructL();
       
    57 	CNSPTest* Find( TestType aType );
       
    58 
       
    59 private: // data
       
    60 	CNSPPlugin& iApi;
       
    61 	CRepository& iRep;
       
    62 	RPointerArray<CNSPTest> iTestArray; // own
       
    63 	};
       
    64 
       
    65 class TFinder : public MNSPTestVisitor
       
    66 	{
       
    67 public:
       
    68 	TFinder( CNSPTestManager::TestType aType );
       
    69 	void VisitL( MNSPTest& aTest );
       
    70 	void VisitL( CNSPTest& aTest );
       
    71 	void VisitL( CNSPReleaseTest& aTest );
       
    72 	CNSPTest* Ptr();
       
    73 
       
    74 protected:
       
    75 	CNSPTestManager::TestType iType;
       
    76 	CNSPTest* iTest; // not own
       
    77 	};
       
    78 
       
    79 #endif // NSPTESTMANAGER_H