stif/stif_plat/inc/TestThreadContainerRunnerFactory.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains the header file of the 
       
    15 * CTestThreadContainerRunnerFactory class implementations.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TESTTHREADCONTAINERRUNNERFACTORY_H_
       
    20 #define TESTTHREADCONTAINERRUNNERFACTORY_H_
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // CONSTANTS
       
    26 // None
       
    27 
       
    28 // MACROS
       
    29 // None
       
    30 
       
    31 // DATA TYPES
       
    32 // None
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 // None
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CTestThreadContainerRunner;
       
    39 class CUiEnvProxy;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 // DESCRIPTION
       
    44 // CTestThreadContainerRunnerFactory class interface.
       
    45 class CTestThreadContainerRunnerFactory: public CActive
       
    46 	{
       
    47 	public: // Enumerations
       
    48 	    // None
       
    49 	
       
    50 	private: // Enumerations
       
    51 		/**
       
    52 		 * .Current operation type
       
    53 		 */
       
    54 		enum TOperationType { ECreate, // Create TestModuleContainer
       
    55 							  EDelete, // Delete TestModuleContainer
       
    56 							  ENone    // No operation
       
    57 							};
       
    58 	
       
    59 	public:  // Constructors and destructor
       
    60 		/**
       
    61 		 * C++ destructor.
       
    62 		 */
       
    63 		~CTestThreadContainerRunnerFactory();
       
    64 	
       
    65 	private:  // Constructors and destructor
       
    66 	    // None
       
    67 	
       
    68 	public: // New functions
       
    69 	    /**
       
    70 	    * NewL is first phase of two-phased constructor.
       
    71 	    */		
       
    72 		IMPORT_C static CTestThreadContainerRunnerFactory* NewL( TThreadId aThreadId, CActiveScheduler* aScheduler, CUiEnvProxy* aUiEnvProxy );
       
    73 	
       
    74 		/**
       
    75 		 * Creates new CTestThreadContainerRunner object.
       
    76 		 */
       
    77 		CTestThreadContainerRunner* CreateL();
       
    78 		
       
    79 		/**
       
    80 		 * Deletes CTestThreadContainerRunner object.
       
    81 		 */
       
    82 		void DeleteL( CTestThreadContainerRunner* aTestThreadContainerRunner );
       
    83 
       
    84 		/**
       
    85 		 * Gets UIEnvProxy.
       
    86 		 */
       
    87 		CUiEnvProxy* GetUiEnvProxy();
       
    88 	public: // Functions from base classes
       
    89 		/**
       
    90 		 * RunL derived from CActive handles the completed requests.
       
    91 		 */
       
    92 		void RunL();
       
    93 
       
    94 		/**
       
    95 		 * DoCancel derived from CActive handles the Cancel.
       
    96 		 */
       
    97 		void DoCancel();
       
    98 
       
    99     protected:	// New functions
       
   100         // None
       
   101         
       
   102     protected:	// Functions from base classes
       
   103         // None
       
   104         
       
   105     private:	// New functions
       
   106 	    /**
       
   107 	    * C++ default constructor.
       
   108 	    */
       
   109 		CTestThreadContainerRunnerFactory();
       
   110 
       
   111 		/**
       
   112 	    * By default Symbian OS constructor is private.
       
   113 	    */
       
   114 		void ConstructL( TThreadId aThreadId, CActiveScheduler* aScheduler, CUiEnvProxy* aUiEnvProxy );
       
   115 
       
   116     private:	// Functions from base classes
       
   117         // None    
       
   118     
       
   119 	public:		//Data
       
   120 	    // None
       
   121         
       
   122 	protected:	// Data
       
   123         // None
       
   124         
       
   125     private:	// Data
       
   126 		TThreadId iThreadId;				// Main thread id.
       
   127 		CActiveScheduler* iScheduler;		// Active scheduler from main thread.
       
   128 		CUiEnvProxy* iUiEnvProxy;			// UIEnvProxy.
       
   129 		
       
   130 		CTestThreadContainerRunner* iTestThreadContainerRunner; // Temporary pointer for CTestThreadContainerRunner
       
   131 																// which was created or should be delated.
       
   132 		TOperationType iOperation;			// Indicates current operation.
       
   133 		RSemaphore iOperationEndSemaphore;	// Operation end semaphore
       
   134 		
       
   135     public:		// Friend classes
       
   136         // None
       
   137 
       
   138     protected:	// Friend classes
       
   139         // None
       
   140 
       
   141     private:	// Friend classes
       
   142         // None
       
   143 	};
       
   144 
       
   145 
       
   146 #endif /*TESTTHREADCONTAINERRUNNERFACTORY_H_*/
       
   147 
       
   148 // End of File