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.
sl@0
     1
 // Copyright (c) 2006-2009 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
This file specifies the interface to the test of having a full
sl@0
    22
 	   screen of text within a CONE control.  
sl@0
    23
*/
sl@0
    24
sl@0
    25
sl@0
    26
#ifndef __TCOMPLEXFONTS_H__
sl@0
    27
#define __TCOMPLEXFONTS_H__
sl@0
    28
sl@0
    29
sl@0
    30
#include "te_conestepbase.h"
sl@0
    31
sl@0
    32
#include <coecntrl.h> 
sl@0
    33
#include <coeaui.h>
sl@0
    34
#include <txtrich.h>
sl@0
    35
#include <frmtlay.h> 
sl@0
    36
#include <frmtview.h> 
sl@0
    37
#include <txtfrmat.h> 
sl@0
    38
sl@0
    39
sl@0
    40
_LIT(KTComplexFonts,"tcomplexfonts");
sl@0
    41
sl@0
    42
sl@0
    43
/**
sl@0
    44
 * Cone control that contains formatted text. If the control receives
sl@0
    45
 * a pointer event it redraws itself and signals a Semaphore once it
sl@0
    46
 * has finished with formatting and redrawing the text.
sl@0
    47
 */
sl@0
    48
class CComplexFontsControl : public CCoeControl
sl@0
    49
	{
sl@0
    50
public:
sl@0
    51
    static CComplexFontsControl* NewL(const CCoeControl* aParent=NULL);
sl@0
    52
    static CComplexFontsControl* NewLC(const CCoeControl* aParent=NULL);
sl@0
    53
    ~CComplexFontsControl();
sl@0
    54
sl@0
    55
private:
sl@0
    56
    // From CCoeControl
sl@0
    57
    void Draw(const TRect& aRect) const;
sl@0
    58
    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
sl@0
    59
sl@0
    60
	CComplexFontsControl();
sl@0
    61
    void ConstructL(const CCoeControl* aParent = NULL);
sl@0
    62
    
sl@0
    63
private:
sl@0
    64
    RSemaphore iSemaphore; // handle to a Semaphore which is owned by the test step
sl@0
    65
    
sl@0
    66
	CRichText* iRichText; // text
sl@0
    67
	
sl@0
    68
	CParaFormatLayer* iParaFormatLayer;
sl@0
    69
	CCharFormatLayer* iCharFormatLayer;
sl@0
    70
	
sl@0
    71
	CTextLayout* iLayout; // text layout
sl@0
    72
	CTextView* iTextView; // text view which covers the whole screen
sl@0
    73
sl@0
    74
	CParaFormat iParaFormat;
sl@0
    75
	CWsScreenDevice* iScreen;	
sl@0
    76
	RWsSession& iWsSession;
sl@0
    77
	};
sl@0
    78
sl@0
    79
class CComplexFontsAppUi : public CEikAppUi
sl@0
    80
    {
sl@0
    81
public:
sl@0
    82
    CComplexFontsAppUi();
sl@0
    83
    virtual ~CComplexFontsAppUi();
sl@0
    84
    void ConstructL();
sl@0
    85
    
sl@0
    86
private:   
sl@0
    87
    CComplexFontsControl* iComplexFontsControl;
sl@0
    88
    };
sl@0
    89
sl@0
    90
class CTComplexFonts : public CTe_ConeStepBase
sl@0
    91
	{
sl@0
    92
public:
sl@0
    93
	CTComplexFonts();
sl@0
    94
sl@0
    95
private:
sl@0
    96
	// From CTestStep
sl@0
    97
    virtual TVerdict doTestStepPreambleL();
sl@0
    98
	virtual TVerdict doTestStepL();
sl@0
    99
	virtual TVerdict doTestStepPostambleL();
sl@0
   100
	
sl@0
   101
	// from CTe_ConeStepBase
sl@0
   102
	virtual void InitUIL(CCoeEnv* aCoeEnv);
sl@0
   103
	
sl@0
   104
	void DrawComplexFontsL();
sl@0
   105
	void GenerateEventL(TRawEvent::TType aEventType);
sl@0
   106
	
sl@0
   107
private:
sl@0
   108
    RSemaphore iSemaphore; // used to wait for font control to finish drawing
sl@0
   109
	};
sl@0
   110
sl@0
   111
sl@0
   112
#endif