os/graphics/graphicstest/uibench/s60/src/tests_fonts/tcomplexfonts.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/tests_fonts/tcomplexfonts.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,112 @@
     1.4 + // Copyright (c) 2006-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 +This file specifies the interface to the test of having a full
    1.25 + 	   screen of text within a CONE control.  
    1.26 +*/
    1.27 +
    1.28 +
    1.29 +#ifndef __TCOMPLEXFONTS_H__
    1.30 +#define __TCOMPLEXFONTS_H__
    1.31 +
    1.32 +
    1.33 +#include "te_conestepbase.h"
    1.34 +
    1.35 +#include <coecntrl.h> 
    1.36 +#include <coeaui.h>
    1.37 +#include <txtrich.h>
    1.38 +#include <frmtlay.h> 
    1.39 +#include <frmtview.h> 
    1.40 +#include <txtfrmat.h> 
    1.41 +
    1.42 +
    1.43 +_LIT(KTComplexFonts,"tcomplexfonts");
    1.44 +
    1.45 +
    1.46 +/**
    1.47 + * Cone control that contains formatted text. If the control receives
    1.48 + * a pointer event it redraws itself and signals a Semaphore once it
    1.49 + * has finished with formatting and redrawing the text.
    1.50 + */
    1.51 +class CComplexFontsControl : public CCoeControl
    1.52 +	{
    1.53 +public:
    1.54 +    static CComplexFontsControl* NewL(const CCoeControl* aParent=NULL);
    1.55 +    static CComplexFontsControl* NewLC(const CCoeControl* aParent=NULL);
    1.56 +    ~CComplexFontsControl();
    1.57 +
    1.58 +private:
    1.59 +    // From CCoeControl
    1.60 +    void Draw(const TRect& aRect) const;
    1.61 +    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    1.62 +
    1.63 +	CComplexFontsControl();
    1.64 +    void ConstructL(const CCoeControl* aParent = NULL);
    1.65 +    
    1.66 +private:
    1.67 +    RSemaphore iSemaphore; // handle to a Semaphore which is owned by the test step
    1.68 +    
    1.69 +	CRichText* iRichText; // text
    1.70 +	
    1.71 +	CParaFormatLayer* iParaFormatLayer;
    1.72 +	CCharFormatLayer* iCharFormatLayer;
    1.73 +	
    1.74 +	CTextLayout* iLayout; // text layout
    1.75 +	CTextView* iTextView; // text view which covers the whole screen
    1.76 +
    1.77 +	CParaFormat iParaFormat;
    1.78 +	CWsScreenDevice* iScreen;	
    1.79 +	RWsSession& iWsSession;
    1.80 +	};
    1.81 +
    1.82 +class CComplexFontsAppUi : public CEikAppUi
    1.83 +    {
    1.84 +public:
    1.85 +    CComplexFontsAppUi();
    1.86 +    virtual ~CComplexFontsAppUi();
    1.87 +    void ConstructL();
    1.88 +    
    1.89 +private:   
    1.90 +    CComplexFontsControl* iComplexFontsControl;
    1.91 +    };
    1.92 +
    1.93 +class CTComplexFonts : public CTe_ConeStepBase
    1.94 +	{
    1.95 +public:
    1.96 +	CTComplexFonts();
    1.97 +
    1.98 +private:
    1.99 +	// From CTestStep
   1.100 +    virtual TVerdict doTestStepPreambleL();
   1.101 +	virtual TVerdict doTestStepL();
   1.102 +	virtual TVerdict doTestStepPostambleL();
   1.103 +	
   1.104 +	// from CTe_ConeStepBase
   1.105 +	virtual void InitUIL(CCoeEnv* aCoeEnv);
   1.106 +	
   1.107 +	void DrawComplexFontsL();
   1.108 +	void GenerateEventL(TRawEvent::TType aEventType);
   1.109 +	
   1.110 +private:
   1.111 +    RSemaphore iSemaphore; // used to wait for font control to finish drawing
   1.112 +	};
   1.113 +
   1.114 +
   1.115 +#endif