os/graphics/graphicstest/uibench/s60/src/tests_fonts/tcomplexfonts.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1  // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  // All rights reserved.
     3  // This component and the accompanying materials are made available
     4  // under the terms of "Eclipse Public License v1.0"
     5  // which accompanies this distribution, and is available
     6  // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  //
     8  // Initial Contributors:
     9  // Nokia Corporation - initial contribution.
    10  //
    11  // Contributors:
    12  //
    13  // Description:
    14  //
    15 
    16 /**
    17  @file 
    18  @test
    19  @internalComponent - Internal Symbian test code
    20 
    21 This file specifies the interface to the test of having a full
    22  	   screen of text within a CONE control.  
    23 */
    24 
    25 
    26 #ifndef __TCOMPLEXFONTS_H__
    27 #define __TCOMPLEXFONTS_H__
    28 
    29 
    30 #include "te_conestepbase.h"
    31 
    32 #include <coecntrl.h> 
    33 #include <coeaui.h>
    34 #include <txtrich.h>
    35 #include <frmtlay.h> 
    36 #include <frmtview.h> 
    37 #include <txtfrmat.h> 
    38 
    39 
    40 _LIT(KTComplexFonts,"tcomplexfonts");
    41 
    42 
    43 /**
    44  * Cone control that contains formatted text. If the control receives
    45  * a pointer event it redraws itself and signals a Semaphore once it
    46  * has finished with formatting and redrawing the text.
    47  */
    48 class CComplexFontsControl : public CCoeControl
    49 	{
    50 public:
    51     static CComplexFontsControl* NewL(const CCoeControl* aParent=NULL);
    52     static CComplexFontsControl* NewLC(const CCoeControl* aParent=NULL);
    53     ~CComplexFontsControl();
    54 
    55 private:
    56     // From CCoeControl
    57     void Draw(const TRect& aRect) const;
    58     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    59 
    60 	CComplexFontsControl();
    61     void ConstructL(const CCoeControl* aParent = NULL);
    62     
    63 private:
    64     RSemaphore iSemaphore; // handle to a Semaphore which is owned by the test step
    65     
    66 	CRichText* iRichText; // text
    67 	
    68 	CParaFormatLayer* iParaFormatLayer;
    69 	CCharFormatLayer* iCharFormatLayer;
    70 	
    71 	CTextLayout* iLayout; // text layout
    72 	CTextView* iTextView; // text view which covers the whole screen
    73 
    74 	CParaFormat iParaFormat;
    75 	CWsScreenDevice* iScreen;	
    76 	RWsSession& iWsSession;
    77 	};
    78 
    79 class CComplexFontsAppUi : public CEikAppUi
    80     {
    81 public:
    82     CComplexFontsAppUi();
    83     virtual ~CComplexFontsAppUi();
    84     void ConstructL();
    85     
    86 private:   
    87     CComplexFontsControl* iComplexFontsControl;
    88     };
    89 
    90 class CTComplexFonts : public CTe_ConeStepBase
    91 	{
    92 public:
    93 	CTComplexFonts();
    94 
    95 private:
    96 	// From CTestStep
    97     virtual TVerdict doTestStepPreambleL();
    98 	virtual TVerdict doTestStepL();
    99 	virtual TVerdict doTestStepPostambleL();
   100 	
   101 	// from CTe_ConeStepBase
   102 	virtual void InitUIL(CCoeEnv* aCoeEnv);
   103 	
   104 	void DrawComplexFontsL();
   105 	void GenerateEventL(TRawEvent::TType aEventType);
   106 	
   107 private:
   108     RSemaphore iSemaphore; // used to wait for font control to finish drawing
   109 	};
   110 
   111 
   112 #endif