os/graphics/graphicstest/uibench/src/trenderorientation.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code 
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef TRENDERORIENTATION_H
sl@0
    23
#define TRENDERORIENTATION_H
sl@0
    24
sl@0
    25
#include <e32property.h>
sl@0
    26
#include "te_graphicsperformanceSuiteStepBase.h"
sl@0
    27
sl@0
    28
/**
sl@0
    29
CTWindowSet contains a window server session, a group window and a child window.
sl@0
    30
 */
sl@0
    31
class CTWindowSet : public CBase
sl@0
    32
    {
sl@0
    33
public:
sl@0
    34
    ~CTWindowSet();
sl@0
    35
    void ConstructL();
sl@0
    36
    void Destroy();
sl@0
    37
sl@0
    38
    inline RWsSession&     Session()
sl@0
    39
        {return iWs;};
sl@0
    40
    inline RWindowGroup&   WindowGroup()
sl@0
    41
        {return iWindowGroup;};
sl@0
    42
sl@0
    43
private:
sl@0
    44
    RWsSession      iWs;
sl@0
    45
    RWindowGroup    iWindowGroup;
sl@0
    46
    RWindow         iChildWindow;    
sl@0
    47
    };
sl@0
    48
sl@0
    49
/**
sl@0
    50
Test case to test the performance of various use cases which affect the render orientation RProperty
sl@0
    51
*/
sl@0
    52
class CTRenderOrientation : public CTe_graphicsperformanceSuiteStepBase
sl@0
    53
    {
sl@0
    54
public:
sl@0
    55
    CTRenderOrientation();
sl@0
    56
    ~CTRenderOrientation();
sl@0
    57
sl@0
    58
    // From CTestStep
sl@0
    59
    virtual TVerdict doTestStepPreambleL();
sl@0
    60
    virtual TVerdict doTestStepPostambleL();
sl@0
    61
    
sl@0
    62
    virtual TVerdict doTestStepL();
sl@0
    63
sl@0
    64
private:
sl@0
    65
    enum TWindowSet
sl@0
    66
        {
sl@0
    67
        // One per orientation
sl@0
    68
        EFirstWindowSet,
sl@0
    69
        ESecondWindowSet,
sl@0
    70
        EThirdWindowSet,
sl@0
    71
        EFourthWindowSet,
sl@0
    72
        
sl@0
    73
        ENumWindowSets
sl@0
    74
        };
sl@0
    75
    
sl@0
    76
    enum TTestPhase
sl@0
    77
        {
sl@0
    78
        EIndicatedOrientationChange,    // window indicates a new render orientation
sl@0
    79
        EWindowOrdinalChange,           // window order changed, render orientation dictated by a different window with a different orientation
sl@0
    80
        EThemeOrientationChange,        // theme orientation changed, render orienation dictated by this due to relevant window being set to EDisplayOrientationAuto
sl@0
    81
        EThemeOrientationChangeOnly,    // theme orientation change only, to compare timings to above
sl@0
    82
        
sl@0
    83
        ENumTestPhases
sl@0
    84
        };    
sl@0
    85
    
sl@0
    86
    void TestOrientationChangeL(const TDesC& aStepName, TTestPhase aTestPhase);
sl@0
    87
    
sl@0
    88
    TRenderOrientation  GetRenderOrientationL();
sl@0
    89
    TRenderOrientation  GetThemeOrientationL();
sl@0
    90
    TRenderOrientation  GetOrientationL(RProperty& aProperty);
sl@0
    91
    void                ThemeServerProperty(const TDesC& aCmd);
sl@0
    92
    
sl@0
    93
private:    
sl@0
    94
    CTWindowSet     iWindowSet[ENumWindowSets];
sl@0
    95
    RProperty       iWsRenderOrientationProperty;
sl@0
    96
    RProperty       iThemeOrientationProperty;
sl@0
    97
    
sl@0
    98
    RTimer          iTimeoutTimer;
sl@0
    99
    TRequestStatus  iTimeoutStatus;
sl@0
   100
    TRequestStatus  iOrientationStatus;
sl@0
   101
    TInt            iTimingsTaken;
sl@0
   102
    };
sl@0
   103
sl@0
   104
_LIT(KTRenderOrientation,"trenderorientation");
sl@0
   105
sl@0
   106
#endif /* TRENDERORIENTATION_H */