stif/stif_plat/inc/UIEngineContainer.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 CUIEngine.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef STIF_TFW_IF_CONTAINER_H
       
    19 #define STIF_TFW_IF_CONTAINER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <StifTFwIf.h>
       
    25 
       
    26 #include <TestEngineClient.h>
       
    27 #include <stifinternal/UIEngine.h>
       
    28 
       
    29 // CONSTANTS
       
    30 // None
       
    31 _LIT( KUIStoreDefaultDir, "C:\\TestFramework\\" );
       
    32 // MACROS
       
    33 // None
       
    34 
       
    35 // DATA TYPES
       
    36 // None
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 // None
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CUIEngine;
       
    43 class CUIEngineRunner;
       
    44 class CUIEnginePrinter;
       
    45 class CUIEngineErrorPrinter;
       
    46 class CUIEngineRemote;
       
    47 
       
    48 // CLASS DECLARATION
       
    49 
       
    50 // DESCRIPTION
       
    51 
       
    52 // CUIEngineContainer is interface between main class CUIEngine
       
    53 // and CUIEngineRunner, which execute test cases
       
    54 class CUIEngineContainer
       
    55         : public CBase
       
    56     {
       
    57     public: // Enumerations
       
    58         // Case state
       
    59         enum TCaseState
       
    60             {
       
    61             ENotStarted,
       
    62             ERunning,
       
    63             EPaused,
       
    64             EExecuted,
       
    65             EFinished,
       
    66             };
       
    67 
       
    68     private: // Enumerations
       
    69         // None
       
    70 
       
    71     public: // Constructor
       
    72 
       
    73         /**
       
    74         * NewL is two-phased constructor.
       
    75         */
       
    76         static CUIEngineContainer* NewL( CUIEngine* aUIEngine,
       
    77                                 const TTestInfo& aTestInfo,
       
    78                                 RTestEngineServer& aTestEngineServ,
       
    79                                 RTestEngine& aTestEngine );
       
    80 
       
    81     public: // New functions
       
    82 
       
    83 
       
    84     public: // Functions from base classes
       
    85 
       
    86         /**
       
    87         * StartContainerL starts test case execution.
       
    88         *
       
    89         * Returns Symbian OS error code.
       
    90         */
       
    91         TInt StartContainerL();
       
    92 
       
    93         /**
       
    94         * TestCaseExecuted informs that test case has executed.
       
    95         */
       
    96         void TestCaseExecuted( TFullTestResult& aResult, TInt aStatus );
       
    97 
       
    98         /**
       
    99         * PrintProgress forwards print information from test case.
       
   100         */
       
   101         void PrintProgress( TTestProgress& aProgress );
       
   102 
       
   103         /**
       
   104         * RemoteSend forwards remote protocol messages from master.
       
   105         */
       
   106         void RemoteSend( const TDesC& aRemoteMsg, TInt aStatus );
       
   107         
       
   108         /**
       
   109         * GoingToReboot forwards reboot indication.
       
   110         */
       
   111         TInt GoingToReboot( TRequestStatus& aStatus );
       
   112         
       
   113         /**
       
   114         * RemoteReceive forwards remote protocol messages to master.
       
   115         */
       
   116         TInt RemoteReceive( const TDesC& aRemoteMsg );
       
   117 
       
   118         /**
       
   119         * CancelTest cancels test case execution. TestCompleted() will be called 
       
   120         * with aTestExecutionResult set to KErrCancel.
       
   121         *
       
   122         * Returns Symbian OS error code.
       
   123         */
       
   124         IMPORT_C TInt CancelTest();
       
   125 
       
   126         /**
       
   127         * PauseTest pauses test case execution.
       
   128         *  
       
   129         * Returns Symbian OS error code.
       
   130         */
       
   131         IMPORT_C TInt PauseTest();
       
   132 
       
   133         /**
       
   134         * ResumeTest resumes test case execution.
       
   135         *
       
   136         * Returns Symbian OS error code.
       
   137         */
       
   138         IMPORT_C TInt ResumeTest();
       
   139         
       
   140         /**
       
   141         * Return remote identifier.
       
   142         */
       
   143         TUint32 RemoteId() const { return iRemoteId; };
       
   144 
       
   145         /**
       
   146         * Set remote identifier.
       
   147         */
       
   148         void SetRemoteId( TUint32 aRemoteId ){ iRemoteId = aRemoteId; };
       
   149 
       
   150         /**
       
   151         * Return master identifier.
       
   152         */
       
   153         TUint32 MasterId() const { return iMasterId; };
       
   154         
       
   155         /**
       
   156         * Return test case execution state. 
       
   157         */
       
   158         TCaseState State() const { return iState; };
       
   159         
       
   160         /**
       
   161         * Printer signals all prints done event.
       
   162         */ 
       
   163         void PrintsDone();
       
   164 
       
   165     protected: // New functions
       
   166         // None
       
   167 
       
   168     protected: // Functions from base classes
       
   169         // None
       
   170 
       
   171     private:  // Constructors and destructor
       
   172 
       
   173         /** 
       
   174         * C++ default constructor.
       
   175         */
       
   176         CUIEngineContainer( CUIEngine* aUIEngine,
       
   177             const TTestInfo& aTestInfo,
       
   178             RTestEngineServer& aTestEngineServ,
       
   179             RTestEngine& aTestEngine );
       
   180 
       
   181         /**
       
   182         * By default Symbian OS constructor is private.
       
   183         */
       
   184         void ConstructL();
       
   185         
       
   186         /**
       
   187         * Destructor of CUIEngineContainer.
       
   188         */
       
   189         ~CUIEngineContainer();
       
   190 
       
   191     public: //Data
       
   192         // Pointer to UIEngine
       
   193         CUIEngine*                         iUIEngine;
       
   194 
       
   195     protected: // Data
       
   196         // None
       
   197 
       
   198     private: // Data
       
   199 
       
   200         // Handle to Test Engine Server
       
   201         RTestEngineServer                   iTestEngineServ;
       
   202 
       
   203         // Handle to Test Engine
       
   204         RTestEngine                         iTestEngine;
       
   205 
       
   206         // Handle to Test Case
       
   207         RTestCase                           iTestCase;
       
   208         
       
   209         // Test case runner
       
   210         CUIEngineRunner*                    iRunner;
       
   211         
       
   212         // Test case printer
       
   213         CUIEnginePrinter*                   iPrinter;
       
   214         
       
   215         // Test case remote command handler
       
   216         CUIEngineRemote*                    iRemote;
       
   217 
       
   218         // Test info and package
       
   219         TTestInfo                           iTestInfo;
       
   220         TTestInfoPckg                       iTestInfoPckg;
       
   221 
       
   222         // Case state
       
   223         TCaseState                          iState;
       
   224         
       
   225         // Remote protocol identifier
       
   226         TUint32                             iRemoteId;
       
   227 
       
   228         // Master protocol identifier
       
   229         TUint32                             iMasterId;
       
   230 
       
   231     public: // Friend classes
       
   232         friend class CUIEngine;
       
   233 
       
   234     protected: // Friend classes
       
   235    
       
   236     private: // Friend classes
       
   237 
       
   238     };
       
   239 
       
   240 
       
   241 #endif      // STIF_TFW_IF_CONTAINER_H 
       
   242 
       
   243 // End of File