sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * TRanspEditor.h sl@0: * TTranspEditor test header file. A base set of classes, neeeded for transparent editors sl@0: * functionality testing, is declared here. sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __TTRANSPEDITOR_H__ sl@0: #define __TTRANSPEDITOR_H__ sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //Picture sl@0: //CTestPicture test class is used to check the effect of opaque drawing, applied on pictures sl@0: //inserted into the text. sl@0: sl@0: class CTestPicture : public CPicture sl@0: { sl@0: public: sl@0: static CTestPicture* NewL(); sl@0: virtual ~CTestPicture(); sl@0: void Draw(CGraphicsContext&, const TPoint&, const TRect&, MGraphicsDeviceMap*) const; sl@0: void ExternalizeL(RWriteStream&) const; sl@0: void GetOriginalSizeInTwips(TSize& aSize) const; sl@0: TInt ScaleFactorWidth() const; sl@0: TInt ScaleFactorHeight() const; sl@0: sl@0: private: sl@0: CTestPicture(); sl@0: void ConstructL(); sl@0: sl@0: private: sl@0: CFbsBitmap* iBitmap; sl@0: sl@0: }; sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //Application sl@0: sl@0: class CTranspEditorApp : public CEikApplication sl@0: { sl@0: public: sl@0: CApaDocument* CreateDocumentL(); sl@0: TUid AppDllUid() const; sl@0: sl@0: }; sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //Document sl@0: sl@0: class CTranspEditorDoc : public CEikDocument sl@0: { sl@0: public: sl@0: CTranspEditorDoc(CEikApplication& aApp); sl@0: sl@0: private: sl@0: CEikAppUi* CreateAppUiL(); sl@0: sl@0: }; sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //View1 sl@0: //CTranspEditorView1 class is used for displaying a bitmap, which occupies the whole screen sl@0: //and is used as a background for a transparent text view, displayed on top of it. sl@0: sl@0: class CTranspEditorView1 : public CCoeControl sl@0: { sl@0: public: sl@0: static CTranspEditorView1* NewL(); sl@0: ~CTranspEditorView1(); sl@0: sl@0: private: sl@0: void ContructL(); sl@0: void Draw(const TRect&) const; sl@0: sl@0: private: sl@0: CFbsBitmap* iBitmap; sl@0: sl@0: }; sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //View2 sl@0: //CTranspEditorView2 class is used for displaying a transparent text view on top of a sl@0: //background bitmap. The class offers functions for inserting texts, pictures, switching sl@0: //on/off text selection and opaque drawing mode. sl@0: sl@0: class CTranspEditorView2 : public CCoeControl sl@0: { sl@0: public: sl@0: static CTranspEditorView2* NewL(); sl@0: ~CTranspEditorView2(); sl@0: void InsertTextL(); sl@0: void SwitchOpaque(); sl@0: void SwitchSelectL(); sl@0: void InsertPictureL(); sl@0: void SetCharFormatL(); sl@0: sl@0: private: sl@0: void ContructL(); sl@0: void Draw(const TRect&) const; sl@0: sl@0: private: sl@0: CRichText* iRichText; sl@0: CTextLayout* iLayout; sl@0: CTextView* iTextView; sl@0: TBool iOpaque; sl@0: TBool iSelect; sl@0: sl@0: }; sl@0: sl@0: ///////////////////////////////////////////////////////////////////////////////////////////// sl@0: //UI sl@0: sl@0: class CTranspEditorUi : public CEikAppUi sl@0: { sl@0: public: sl@0: void ConstructL(); sl@0: ~CTranspEditorUi(); sl@0: sl@0: private: sl@0: void HandleCommandL(TInt aCommand); sl@0: sl@0: private: sl@0: CTranspEditorView1* iTranspEditorView1; sl@0: CTranspEditorView2* iTranspEditorView2; sl@0: sl@0: }; sl@0: sl@0: #endif//__TTRANSPEDITOR_H__