os/textandloc/textrendering/textformatting/test/src/TTranspEditor.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
/*
sl@0
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
* TRanspEditor.h
sl@0
    16
* TTranspEditor test header file. A base set of classes, neeeded for transparent editors
sl@0
    17
* functionality testing, is declared here.
sl@0
    18
*
sl@0
    19
*/
sl@0
    20
sl@0
    21
sl@0
    22
#ifndef __TTRANSPEDITOR_H__
sl@0
    23
#define __TTRANSPEDITOR_H__
sl@0
    24
sl@0
    25
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
    26
//Picture
sl@0
    27
//CTestPicture test class is used to check the effect of opaque drawing, applied on pictures
sl@0
    28
//inserted into the text.
sl@0
    29
sl@0
    30
class CTestPicture : public CPicture
sl@0
    31
	{
sl@0
    32
public:
sl@0
    33
	static CTestPicture* NewL();
sl@0
    34
	virtual ~CTestPicture();
sl@0
    35
	void Draw(CGraphicsContext&, const TPoint&, const TRect&, MGraphicsDeviceMap*) const;
sl@0
    36
	void ExternalizeL(RWriteStream&) const;
sl@0
    37
	void GetOriginalSizeInTwips(TSize& aSize) const;
sl@0
    38
	TInt ScaleFactorWidth() const;
sl@0
    39
	TInt ScaleFactorHeight() const;
sl@0
    40
sl@0
    41
private:
sl@0
    42
	CTestPicture();
sl@0
    43
	void ConstructL();
sl@0
    44
sl@0
    45
private:
sl@0
    46
	CFbsBitmap* iBitmap;
sl@0
    47
sl@0
    48
	};
sl@0
    49
sl@0
    50
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
    51
//Application 
sl@0
    52
sl@0
    53
class CTranspEditorApp : public CEikApplication
sl@0
    54
	{
sl@0
    55
public:
sl@0
    56
	CApaDocument* CreateDocumentL();
sl@0
    57
	TUid AppDllUid() const;
sl@0
    58
sl@0
    59
	};
sl@0
    60
sl@0
    61
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
    62
//Document
sl@0
    63
sl@0
    64
class CTranspEditorDoc : public CEikDocument
sl@0
    65
	{
sl@0
    66
public:
sl@0
    67
	CTranspEditorDoc(CEikApplication& aApp);
sl@0
    68
sl@0
    69
private:
sl@0
    70
	CEikAppUi* CreateAppUiL();
sl@0
    71
sl@0
    72
	};
sl@0
    73
sl@0
    74
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
    75
//View1
sl@0
    76
//CTranspEditorView1 class is used for displaying a bitmap, which occupies the whole screen
sl@0
    77
//and is used as a background for a transparent text view, displayed on top of it.
sl@0
    78
sl@0
    79
class CTranspEditorView1 : public CCoeControl
sl@0
    80
	{
sl@0
    81
public:
sl@0
    82
	static CTranspEditorView1* NewL();
sl@0
    83
	~CTranspEditorView1();
sl@0
    84
sl@0
    85
private:
sl@0
    86
	void ContructL();
sl@0
    87
	void Draw(const TRect&) const;
sl@0
    88
sl@0
    89
private:
sl@0
    90
	CFbsBitmap* iBitmap;
sl@0
    91
sl@0
    92
	};
sl@0
    93
sl@0
    94
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
    95
//View2
sl@0
    96
//CTranspEditorView2 class is used for displaying a transparent text view on top of a 
sl@0
    97
//background bitmap. The class offers functions for inserting texts, pictures, switching
sl@0
    98
//on/off text selection and opaque drawing mode.
sl@0
    99
sl@0
   100
class CTranspEditorView2 : public CCoeControl
sl@0
   101
	{
sl@0
   102
public:
sl@0
   103
	static CTranspEditorView2* NewL();
sl@0
   104
	~CTranspEditorView2();
sl@0
   105
	void InsertTextL();
sl@0
   106
	void SwitchOpaque();
sl@0
   107
	void SwitchSelectL();
sl@0
   108
	void InsertPictureL();
sl@0
   109
	void SetCharFormatL();
sl@0
   110
sl@0
   111
private:
sl@0
   112
	void ContructL();
sl@0
   113
	void Draw(const TRect&) const;
sl@0
   114
sl@0
   115
private:
sl@0
   116
	CRichText*			iRichText;
sl@0
   117
	CTextLayout*		iLayout;
sl@0
   118
	CTextView*			iTextView;
sl@0
   119
	TBool				iOpaque;
sl@0
   120
	TBool				iSelect;
sl@0
   121
sl@0
   122
	};
sl@0
   123
sl@0
   124
/////////////////////////////////////////////////////////////////////////////////////////////
sl@0
   125
//UI
sl@0
   126
sl@0
   127
class CTranspEditorUi : public CEikAppUi
sl@0
   128
	{
sl@0
   129
public:
sl@0
   130
	void ConstructL();
sl@0
   131
	~CTranspEditorUi();
sl@0
   132
sl@0
   133
private:
sl@0
   134
	void HandleCommandL(TInt aCommand);
sl@0
   135
sl@0
   136
private: 
sl@0
   137
	CTranspEditorView1* iTranspEditorView1;
sl@0
   138
	CTranspEditorView2* iTranspEditorView2;
sl@0
   139
	
sl@0
   140
	};
sl@0
   141
sl@0
   142
#endif//__TTRANSPEDITOR_H__