1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/tests_scale/tscale.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,100 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#ifndef __TSCALE_H__
1.26 +#define __TSCALE_H__
1.27 +
1.28 +
1.29 +#include "te_conestepbase.h"
1.30 +
1.31 +#include <coecntrl.h>
1.32 +#include <coeaui.h>
1.33 +#include <eikappui.h>
1.34 +
1.35 +
1.36 +class CScaleAppUi;
1.37 +
1.38 +
1.39 +class CTScale : public CTe_ConeStepBase
1.40 + {
1.41 +public:
1.42 + CTScale();
1.43 +
1.44 +private:
1.45 + // From CTestStep
1.46 + virtual TVerdict doTestStepPreambleL();
1.47 + virtual TVerdict doTestStepL();
1.48 + virtual TVerdict doTestStepPostambleL();
1.49 +
1.50 + // from CTe_graphicsperformanceSuiteStepBase
1.51 + virtual void InitUIL(CCoeEnv* aCoeEnv);
1.52 +
1.53 +private:
1.54 + RSemaphore iSemaphore; // used to wait for font control to finish drawing
1.55 + CScaleAppUi* iAppUi;
1.56 + };
1.57 +
1.58 +_LIT(KTScale,"tscale");
1.59 +
1.60 +
1.61 +class CScaleControl : public CCoeControl
1.62 + {
1.63 +public:
1.64 + static CScaleControl* NewL(const TRect& aRect,const CCoeControl* aParent=NULL);
1.65 + static CScaleControl* NewLC(const TRect& aRect,const CCoeControl* aParent=NULL);
1.66 + ~CScaleControl();
1.67 + TInt Iterations();
1.68 +
1.69 + // from CCoeControl
1.70 + void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1.71 +
1.72 +private:
1.73 + CScaleControl();
1.74 + void ConstructL(const TRect& aRect,const CCoeControl* aParent = NULL);
1.75 +
1.76 + // from CCoeControl
1.77 + void Draw(const TRect& aRect) const;
1.78 +
1.79 +private:
1.80 + RSemaphore iSemaphore; // handle to a Semaphore which is owned by the test step
1.81 + // The current zoom rectangle into the image
1.82 + TRect iSourceRect;
1.83 + // The pixel position of the most recent PointerEvent
1.84 + TPoint iCurrentPointerPos;
1.85 + CFbsBitmap* iSourceBitmap;
1.86 + TReal iSourceRatio;
1.87 + TInt iIterations;
1.88 + RWsSession& iWsSession;
1.89 + };
1.90 +
1.91 +class CScaleAppUi : public CEikAppUi
1.92 + {
1.93 +public:
1.94 + CScaleAppUi();
1.95 + ~CScaleAppUi();
1.96 + void ConstructL();
1.97 + CScaleControl* ScaleControl();
1.98 +
1.99 +private:
1.100 + CScaleControl* iScale;
1.101 + };
1.102 +
1.103 +#endif