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