commonuisupport/uikon/test/tlibs/taddlib/Taddlib.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 // Test adds a control factory function and resource file to the application.\n
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 #ifndef		__TADDLIB_H
       
    23 #define		__TADDLIB_H
       
    24 
       
    25 
       
    26 #include "appfwk_test_AppUi.h"
       
    27 
       
    28 _LIT(KTestAddLibraryStep, "TAddLibrary");
       
    29 
       
    30 //!  A CTestAddLibraryStep test class. 
       
    31 /**
       
    32  Test adds a control factory function and resource file to the application.
       
    33 */
       
    34 class CTestAddLibraryStep : public CTmsTestStep
       
    35 	{
       
    36 public:
       
    37 	CTestAddLibraryStep();
       
    38 	~CTestAddLibraryStep();
       
    39 	//virtual TVerdict doTestStepPreambleL();
       
    40 	virtual TVerdict doTestStepL();
       
    41 	void ConstructAppL(CEikonEnv* aCoe);
       
    42 private:
       
    43 	};
       
    44 
       
    45 
       
    46 //!  A CTestLabel test control class. 
       
    47 /**
       
    48  The class represents the test Label control.
       
    49 */
       
    50 class CTestLabel : public CEikLabel
       
    51 	{
       
    52 private: 
       
    53 	// framework
       
    54     void Draw(const TRect& aRect) const;
       
    55 	};
       
    56 
       
    57 
       
    58 
       
    59 //!  A CTestContainer  test control class. 
       
    60 /**
       
    61  The class represents the test Container control.
       
    62 */
       
    63 class CTestContainer : public CCoeControl
       
    64     {
       
    65 public:
       
    66 	enum
       
    67 		{
       
    68 		ECtTestLabel = 555
       
    69 		};
       
    70 public:
       
    71 	CTestContainer(CTestAppUi* aAppUi);
       
    72     ~CTestContainer();
       
    73     void ConstructL(const TRect& aRect);
       
    74 	virtual TInt CountComponentControls() const;
       
    75 	virtual CCoeControl* ComponentControl(TInt aIndex) const;
       
    76 public:
       
    77 	static SEikControlInfo CreateByTypeL(TInt aControlType);	// Control factory
       
    78 	void AddLibraryL();
       
    79 	void RemoveLibrary();
       
    80 	void RunL();
       
    81 private: 
       
    82     void Draw(const TRect& aRect) const;
       
    83 	TBool CreateControlL();
       
    84 private:
       
    85 	CTestLabel* iLabel;
       
    86 	TFileName	iResourceFile;
       
    87 	TInt		iResFileOffset;
       
    88 	CTestAppUi* iAppUi;
       
    89     };
       
    90 
       
    91 
       
    92 //!  A CTestAddLibraryAppUi test class. 
       
    93 /**
       
    94  The class handles work with resources.
       
    95 */
       
    96 class CTestAddLibraryAppUi : public CTestAppUi
       
    97 	{
       
    98 public:
       
    99 	CTestAddLibraryAppUi(CTmsTestStep*		aStep, const TDesC& aRes);
       
   100 	~CTestAddLibraryAppUi();
       
   101 	void ConstructL();
       
   102 	virtual void HandleCommandL(TInt aCommand);
       
   103 	void RunTestStepL(TInt aStepNumber);
       
   104 
       
   105 private:
       
   106     CTestContainer* iContainer;
       
   107 	};
       
   108 
       
   109 #endif
       
   110