uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappgallerytestcase.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:  alfperfapp gallery test case class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef ALFPERFAPPGALLERYTESTCASE_H_
       
    21 #define ALFPERFAPPGALLERYTESTCASE_H_
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <alf/alfimagevisual.h>
       
    25 #include "alfperfapptestcase.h"
       
    26 #include <alf/alfdisplaybackgrounditem.h>
       
    27 #include <aknappui.h>
       
    28 
       
    29 class CAlfImageLoaderUtil;
       
    30 class CAlfLayout;
       
    31 class CAlfViewportLayout;
       
    32 class CAlfPerfAppGalleryTestCaseControl;
       
    33 
       
    34 class MImagesLoadedObserver
       
    35     {
       
    36 public:
       
    37     virtual void ImagesLoaded( TInt aErrorCode ) = 0;
       
    38     };
       
    39 
       
    40 /**
       
    41  *  CAlfPerfAppGalleryTestCase class.
       
    42  */
       
    43 class CAlfPerfAppGalleryTestCase : public CAlfPerfAppTestCase, public MImagesLoadedObserver
       
    44     {
       
    45 public:
       
    46     /**
       
    47      * Returns ETrue if test case is supported.
       
    48      * @param aCaseId test case id.
       
    49      * @return ETrue if supported.
       
    50      */
       
    51     static TBool IsSupported( TInt aCaseId );
       
    52 
       
    53     static CAlfPerfAppGalleryTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
       
    54     ~CAlfPerfAppGalleryTestCase();
       
    55 
       
    56     // From base class CAlfPerfAppTestCase:
       
    57     virtual void SetupL( 
       
    58         CAlfEnv& aEnv, 
       
    59         const TRect& aVisibleArea, 
       
    60         TRequestStatus& aStatus );
       
    61     virtual void ExecuteL( TRequestStatus& aStatus );
       
    62     virtual void TearDown();   
       
    63     virtual void HandleVisibleAreaChange( const TRect& aRect );
       
    64     virtual TInt CaseID();
       
    65 
       
    66     // From MImagesLoadedObserver
       
    67     void ImagesLoaded( TInt aErrorCode );
       
    68     
       
    69 private:
       
    70     
       
    71     CAlfPerfAppGalleryTestCase( TInt aCaseId, TInt aSequenceIndex );
       
    72     void ConstructL();
       
    73 
       
    74 private:
       
    75 
       
    76     /**
       
    77      * Test case of which execution this instance was created.
       
    78      */ 
       
    79     TInt iCaseId;
       
    80 
       
    81     /**
       
    82      * Alf environment.
       
    83      * Not owned.
       
    84      */
       
    85     CAlfEnv* iEnv;
       
    86 
       
    87     /**
       
    88      * Test case control.
       
    89      * Not owned.
       
    90      */
       
    91     CAlfPerfAppGalleryTestCaseControl* iControl;
       
    92 
       
    93     /**
       
    94      * Image visuals.
       
    95      */
       
    96     RPointerArray< CAlfImageVisual > iImages;
       
    97         
       
    98     /**
       
    99      * Cycle counter.
       
   100      */        
       
   101     TInt iCycleCounter;
       
   102     /**
       
   103      * Image loader utility.
       
   104      * Owned.
       
   105      */
       
   106     CAlfImageLoaderUtil* iLoader;
       
   107     
       
   108     TRequestStatus* iStatus;
       
   109     
       
   110     /**
       
   111      * A temporary store for holding the status of orientation
       
   112      * information of the application before the test case
       
   113      * is started. The previous value is restored in teardown.
       
   114      */
       
   115     CAknAppUiBase::TAppUiOrientation iOrientation;
       
   116 
       
   117     };
       
   118 
       
   119 #endif /*ALFPERFAPPGALLERYTESTCASE_H_*/