uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcasecontrol.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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 ALFPERFAPPSUITETESTCASECONTROL_H_
       
    19 #define ALFPERFAPPSUITETESTCASECONTROL_H_
       
    20 
       
    21 // INCLUDES
       
    22 #include <Alf/AlfControl.h>
       
    23 
       
    24 // CONSTANTS
       
    25 const TInt KAlfPerfAppSuiteControlGroup = 1;
       
    26 
       
    27 const TInt KAlfPerfAppSuiteCmdCompleteNow = 0x5000;
       
    28 const TInt KAlfPerfAppSuiteCmdNext = 0x5001;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32  * Abstract Suite test case control.
       
    33  */
       
    34 class CAlfPerfAppSuiteTestCaseControl : public CAlfControl
       
    35     {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Constructor.
       
    40      */
       
    41     CAlfPerfAppSuiteTestCaseControl();
       
    42 
       
    43     /**
       
    44      * Destructor.
       
    45      */
       
    46     ~CAlfPerfAppSuiteTestCaseControl();
       
    47 
       
    48     /**
       
    49      * Base class constructor. Derived classes may
       
    50      * override this, but base class needs to be called.
       
    51      */
       
    52     virtual void ConstructL( 
       
    53             CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
       
    54 
       
    55     /**
       
    56      * Starts execution of the test case. By default,
       
    57      * request status is stored to local variable.
       
    58      */
       
    59     void StartExecuteL( TRequestStatus& aStatus );    
       
    60 
       
    61     /**
       
    62      * Cancels execution. This control and environment will be
       
    63      * deleted soon after calling this method.
       
    64      */
       
    65     void CancelExecution();
       
    66 
       
    67     /**
       
    68      * Starts execution.
       
    69      * If this method leaves, then request must not be completed.
       
    70      * By default, this method completes immediately.
       
    71      */
       
    72     virtual void DoStartExecuteL();
       
    73 
       
    74     /**
       
    75      * Sets visible area.
       
    76      * @param aVisibleArea visible area.
       
    77      */
       
    78     virtual void SetVisibleArea( const TRect& aVisibleArea );    
       
    79 
       
    80     // From base class CAlfControl:
       
    81 
       
    82     /**
       
    83      * Handles events.
       
    84      * Derived classes should forward to base class.
       
    85      * @param aEvent event to be handled.
       
    86      * @return ETrue if consumed, EFalse otherwise.
       
    87      */
       
    88     virtual TBool OfferEventL( const TAlfEvent& aEvent );
       
    89 
       
    90 protected:
       
    91 
       
    92     /**
       
    93      * Completes automatically after specified duration.
       
    94      * @param aDuration duration in ms
       
    95      */
       
    96     void CompleteAfterL( TInt aDuration );
       
    97 
       
    98     /**
       
    99      * Completes current request.
       
   100      */
       
   101     void CompleteNow( TInt aErrorCode );
       
   102 
       
   103     /**
       
   104      * Returns test case id.
       
   105      */
       
   106     inline TInt CaseId() const;
       
   107 
       
   108     /**
       
   109      * Returns ETrue if test case execution is still ongoing.
       
   110      */
       
   111     TBool IsExecutionOngoing() const;
       
   112 
       
   113     /**
       
   114      * Test case id.
       
   115      */
       
   116     TInt iCaseId;
       
   117 
       
   118     /**
       
   119      * Current visible screen area.
       
   120      */
       
   121     TRect iVisibleArea;
       
   122 
       
   123 private:
       
   124 
       
   125     /**
       
   126      * Pointer to request status.
       
   127      * Not owned.
       
   128      */
       
   129     TRequestStatus* iStatus;
       
   130 
       
   131     };
       
   132 
       
   133 #endif // ALFPERFAPPSUITETESTCASECONTROL_H_
       
   134 
       
   135 // end of file
       
   136