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