sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // textendedbitmap.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef TEXTENDEDBITMAPGC_H sl@0: #define TEXTENDEDBITMAPGC_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** Test class for testing the operation of extended bitmaps with different graphics sl@0: contexts. Creators of this test class must provide a pointer to a MTestHarnessCallBack object sl@0: and a CBitmapContext. The MTestHarnessCallBack callback object allows CTExtendedBitmapGc to sl@0: pass logging and test status operations back to the creator. All drawing operations that this sl@0: test class performs are drawn to the supplied CBitmapContext object. sl@0: */ sl@0: class CTExtendedBitmapGc : public CBase sl@0: { sl@0: public: sl@0: /** Stripe styles that are supported by the example bitmap example rasterizer, note that only sl@0: vertical and horizontal stripes are supported sl@0: */ sl@0: enum TStripeStyle sl@0: { sl@0: EVerticalStripe = 0, sl@0: EHorizontalStripe = 1 sl@0: }; sl@0: sl@0: /** Defines whether this class should draw extended bitmaps as flags, or as plain white sl@0: rectangles. EDrawFlag should be used when testing with BitGdi where the example rasterizer sl@0: is available, or when testing with WServ where the example extended bitmap render stage is sl@0: available. Otherwise EDrawWhite should be used. It is up to the creator of CTExtendedBitmapGc sl@0: to decide which draw mode should be used. sl@0: */ sl@0: enum TDrawMode sl@0: { sl@0: EDrawFlag, sl@0: EDrawWhite sl@0: }; sl@0: sl@0: public: sl@0: IMPORT_C static CTExtendedBitmapGc* NewL(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode, TDisplayMode aDisplayMode); sl@0: IMPORT_C ~CTExtendedBitmapGc(); sl@0: IMPORT_C void RunTestCaseL(TInt aCurTestCase); sl@0: sl@0: // Helper functions sl@0: IMPORT_C static void WriteExtendedBitmapInfoL(TUint8* aData, sl@0: TInt& aDataSize, sl@0: const TRgb* aColorArray, sl@0: TStripeStyle aStripeStyle); sl@0: sl@0: private: sl@0: // Construction sl@0: CTExtendedBitmapGc(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode); sl@0: void ConstructL(TDisplayMode aDisplayMode); sl@0: sl@0: // Test cases sl@0: void TestBitmapDrawingL(TBool aTestRegionOfInterest, TStripeStyle aStripeStyle, TInt aCaseNumber); sl@0: void TestBrushPatternL(TInt aCaseNumber); sl@0: sl@0: // Helper functions sl@0: void CreateTestBitmapLC(CFbsBitmap*& aBmpRet, sl@0: const TSize& aSize, sl@0: TDisplayMode aDisplayMode, sl@0: const TRgb& aColor1, sl@0: const TRgb& aColor2, sl@0: const TRgb& aColor3, sl@0: TStripeStyle aStripeStyle); sl@0: sl@0: CTestExecuteLogger& Logger() {return iCallBack->Logger();} sl@0: sl@0: private: sl@0: MTestHarnessCallBack* iCallBack; sl@0: TDrawMode iDrawMode; sl@0: TDisplayMode iDisplayMode; sl@0: CBitmapContext& iGc; sl@0: TBool iIsFbs; sl@0: CFont* iFont; sl@0: }; sl@0: sl@0: #endif // TEXTENDEDBITMAPGC_H