lafagnosticuifoundation/cone/tef/TCone7Step.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef __TCONE7STEP_H__
       
    23 #define __TCONE7STEP_H__
       
    24 
       
    25 #include <test/testexecutestepbase.h>
       
    26 
       
    27 #include <coecntrl.h>
       
    28 #include <coeaui.h>
       
    29 #include <coemain.h>
       
    30 #include <coedef.h>
       
    31 #include <coesndpy.h>
       
    32 #include <basched.h>
       
    33 #include <bassnd.h>
       
    34 #include <ecom/ecom.h>
       
    35 #include <gdi.h>
       
    36 #include <eikenv.h>
       
    37 
       
    38 #include "TConeTestServer.h"
       
    39 #include "appfwk_test_AppUi.h"
       
    40 
       
    41 
       
    42 #define KRgbInherited KRgbRed
       
    43 
       
    44 _LIT( KInheritedTextDrawerText, "Inherited TD" );
       
    45 _LIT( KLocalTextDrawerText, "Local TD"  );
       
    46 
       
    47 _LIT(KMultipleLineText, "Test multi-lines\nTODO block\nimplemented as part of\nDEF091556 defect fix");
       
    48 _LIT(KMultipleLineText1, "Test multi-lines\nTODO block\nimplemented as part of\nINC122592 defect fix");
       
    49 
       
    50 
       
    51 //
       
    52 // class CCtlBase641
       
    53 //
       
    54 
       
    55 class CCtlBase641 : public CCoeControl
       
    56 	{
       
    57 public :
       
    58 	~CCtlBase641();
       
    59 protected :
       
    60 	CCtlBase641();
       
    61 	void WriteName( CWindowGc& aGc, const TDesC& aText ) const;
       
    62 	void ConstructL();
       
    63 	void DoDraw( CWindowGc& aGc, TRect aRect ) const;	
       
    64 protected :
       
    65 	HBufC* iName;
       
    66 private :
       
    67     CFont* iFont;
       
    68 	};
       
    69 
       
    70 //
       
    71 // class CCtlSuperContainer641
       
    72 //
       
    73 
       
    74 class CCtlSubContainer641;
       
    75 class CCtlSuperContainer641 : public CCtlBase641
       
    76 	{
       
    77 public:
       
    78 	CCtlSuperContainer641();
       
    79 	~CCtlSuperContainer641();
       
    80 	void ConstructL( const TDesC& aName );
       
    81 
       
    82 	void ApplyText() const;	
       
    83 	void Draw(CWindowGc& /*aGc*/, const CCoeControl& /*aControl*/, const TRect& /*aRect*/) const{}
       
    84 public:
       
    85 	CCtlSubContainer641* iSubContainer;	
       
    86 private:
       
    87 	virtual void SizeChanged();
       
    88 	void Draw(const TRect& aRect) const;
       
    89 	void GetTextDrawer( CCoeTextDrawerBase*& aTextDrawer, const CCoeControl* aDrawingControl, TInt aInt ) const;
       
    90 private:
       
    91 	enum
       
    92 		{
       
    93 		KChildOneID,
       
    94 		KChildTwoID,
       
    95 		KChildThreeID,
       
    96 		KChildFourID
       
    97 		};
       
    98 	};
       
    99 
       
   100 
       
   101 //
       
   102 // class 
       
   103 //
       
   104 
       
   105 class CCtlContainee641;
       
   106 class CCtlSubContainer641 : public CCtlBase641
       
   107 	{
       
   108 public:
       
   109 	CCtlSubContainer641();
       
   110 	~CCtlSubContainer641();
       
   111 	void ConstructL( const TDesC& aName );
       
   112 
       
   113 	void ApplyText() const;	
       
   114 	void Draw(CWindowGc& /*aGc*/, const CCoeControl& /*aControl*/, const TRect& /*aRect*/) const{}
       
   115 public:
       
   116 	CCtlContainee641* iContainee;	
       
   117 private:
       
   118 	virtual void SizeChanged();
       
   119 	void Draw(const TRect& aRect) const;
       
   120 	void GetTextDrawer( CCoeTextDrawerBase*& aTextDrawer, const CCoeControl* aDrawingControl, TInt aInt ) const;
       
   121 private:
       
   122 	enum
       
   123 		{
       
   124 		KChildOneID,
       
   125 		KChildTwoID,
       
   126 		KChildThreeID,
       
   127 		KChildFourID
       
   128 		};
       
   129 	};
       
   130 
       
   131 //
       
   132 // class CCtlContainer641
       
   133 //
       
   134 
       
   135 class CCtlContainee641;
       
   136 class CCtlContainer641 : public CCtlBase641//, MCoeControlBackground
       
   137 	{
       
   138 public:
       
   139 	CCtlContainer641();
       
   140 	~CCtlContainer641();
       
   141 	void ConstructL( const TDesC& aName );
       
   142 
       
   143 	void ApplyText() const;	
       
   144 	void Draw(CWindowGc& /*aGc*/, const CCoeControl& /*aControl*/, const TRect& /*aRect*/) const{}
       
   145 public:
       
   146 	CCtlContainee641* iContainee;
       
   147 private:
       
   148 	virtual void SizeChanged();
       
   149 	void Draw(const TRect& aRect) const;
       
   150 	void GetTextDrawer( CCoeTextDrawerBase*& aTextDrawer, const CCoeControl* aDrawingControl, TInt aInt ) const;
       
   151 private:
       
   152 	enum
       
   153 		{
       
   154 		KChildOneID,
       
   155 		KChildTwoID,
       
   156 		KChildThreeID,
       
   157 		KChildFourID
       
   158 		};
       
   159 	};
       
   160 
       
   161 //
       
   162 // class CCtlContainee641
       
   163 //
       
   164 
       
   165 class CCtlContainee641 : public CCtlBase641
       
   166 	{
       
   167 public:
       
   168 	CCtlContainee641();
       
   169 	~CCtlContainee641();
       
   170 	void ConstructL( const TDesC& aName );
       
   171 	
       
   172 	const TDesC& WhoAmI() const;
       
   173 	TBool TestContainerTextDrawer();
       
   174 	void ApplyText() const;
       
   175 private:
       
   176 	void Draw(const TRect& aRect) const;
       
   177 	};
       
   178 
       
   179 //
       
   180 // class CCtlTestTextDrawer 
       
   181 //
       
   182 
       
   183 class CCtlTestTextDrawer : public CCoeControl
       
   184 	{
       
   185 public:
       
   186 	CCtlTestTextDrawer();
       
   187 	~CCtlTestTextDrawer();
       
   188 	void ConstructL();
       
   189 	TBool TestTextDrawer(TInt aTextIndex, TBool aHorizontal, TRect *aClipRect = NULL, TRgb* aTextCol = NULL, TBool aCleanBackground = ETrue, TBool aUp = ETrue);
       
   190 	void WidthOfText(const TInt aLine, TInt& aWidthInPixels) const;
       
   191 	const CFont& FontUsed() const;
       
   192 private:
       
   193 	CFont* iFont;
       
   194 	};
       
   195 
       
   196 //
       
   197 // class CTCone7Step 
       
   198 //
       
   199 
       
   200 class CTCone7Step : public CTmsTestStep
       
   201 	{
       
   202 public:
       
   203 	CTCone7Step();
       
   204 	~CTCone7Step();
       
   205 	virtual TVerdict doTestStepL();
       
   206 	void ConstructAppL(CCoeEnv* aCoe);
       
   207 	};
       
   208 
       
   209 //
       
   210 // class CCone7TestAppUi 
       
   211 //
       
   212 
       
   213 class CCone7TestAppUi : public CTestCoeAppUi
       
   214     {
       
   215 public:
       
   216 	CCone7TestAppUi(CTmsTestStep* aStep);
       
   217 	~CCone7TestAppUi();
       
   218 	void ConstructL();
       
   219 private: // from CCoeAppUi
       
   220 	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   221 private: // utility
       
   222 	void RunTestStepL(TInt aStepNum);
       
   223 	TBool TestTextDrawer_1L(); // test case PREQ641.1
       
   224 	TBool TestTextDrawer_2L(); // test case PREQ641.2
       
   225 	TBool TestTextDrawer_3L();
       
   226 	TBool TestTextDrawer_4L();
       
   227 	TBool TestTextDrawer_5L(); //test for INC122592
       
   228 	TBool TestWindowPositionL();
       
   229 	TBool TestExtentNotSetL();
       
   230 	TBool TestBackedUpExtentNotSetL();
       
   231 private:
       
   232     };
       
   233 
       
   234 
       
   235 _LIT(KTCone7Step,"TCone7");
       
   236 
       
   237 #endif	// __TCONE7STEP_H__
       
   238 
       
   239