multimediacommsengine/tsrc/testdriver/testclient/ui/src/CTcContainer.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:  See class definition below.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CTCCONTAINER_H__
       
    19 #define __CTCCONTAINER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <coecntrl.h>
       
    23 
       
    24 #ifdef __SERIES60_
       
    25 #include <aknutils.h>
       
    26 #endif
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CEikLabel;
       
    30 
       
    31 // CLASS DEFINITION
       
    32 /**
       
    33  * CTcContainer implements the application main view control.
       
    34  * It is responsible for displaying application state information
       
    35  * (e.g. test case name and CTRL request).
       
    36  */
       
    37 class CTcContainer
       
    38 	: public CCoeControl
       
    39 	{
       
    40 	public:	// Constructors and destructor
       
    41 
       
    42 		/**
       
    43 		 * Static constructor.
       
    44 		 *
       
    45 		 * @param aRect View area for this control.
       
    46 		 * @return An initialized instance of this class
       
    47 		 */
       
    48 		static CTcContainer* NewL( const TRect& aRect );
       
    49 
       
    50 		/// Destructor
       
    51 		~CTcContainer();
       
    52 
       
    53 	private: // Constructors
       
    54 
       
    55 		/// Default constructor
       
    56 		CTcContainer();
       
    57 
       
    58 		/**
       
    59 		 * 2nd phase constructor.
       
    60 		 *
       
    61 		 * @param aRect View area for this control.
       
    62 		 */
       
    63 		void ConstructL( const TRect& aRect );
       
    64 
       
    65 	public:  // from CCoeControl
       
    66 
       
    67 		void Draw( const TRect& aRect ) const;
       
    68 
       
    69 	protected: //  from CCoeControl
       
    70 
       
    71 		TInt CountComponentControls() const;
       
    72 		CCoeControl* ComponentControl( TInt aIndex ) const;
       
    73 		
       
    74 #ifdef __SERIES60_
       
    75 
       
    76 		void SizeChanged();
       
    77 		void HandleResourceChange( TInt aType );
       
    78 #endif
       
    79 
       
    80 	public: // New methods
       
    81 
       
    82 		/**
       
    83 		 * Query state of a TestRunner instance and update status
       
    84 		 * displays accordingly.
       
    85 		 * This is called from CTcAppUi::NotifyStatusChange()
       
    86 		 *
       
    87 		 * @param aRunner TestRunner reference
       
    88 		 */
       
    89 		void Update( CTcTestRunner& aRunner );
       
    90 
       
    91 		/**
       
    92 		 * Update the Status label with the given text
       
    93 		 * This is called from CTcAppUi::SetStatus()
       
    94 		 *
       
    95 		 * @param aStatus New status text
       
    96 		 */
       
    97 		void UpdateStatus( const TDesC8& aStatus );
       
    98 
       
    99 	private: // New methods
       
   100 
       
   101 		/**
       
   102 		 * This is an internal helper function for creating and laying out
       
   103 		 * CEikLabel controls.
       
   104 		 *
       
   105 		 * @param aRect View area for the created label
       
   106 		 * @param aText Default text for the label
       
   107 		 * @return An initialized label control.
       
   108 		 */
       
   109 		CEikLabel* CreateLabelL( const TRect& aRect, const TDesC& aText );
       
   110 
       
   111 		/**
       
   112 		 * Changes the text of one of the labels in the array
       
   113 		 *
       
   114 		 * @param aLabelId Label array index
       
   115 		 * @param aText new text for the label
       
   116 		 */
       
   117 		void SetLabelText( TInt aLabelId, const TDesC8& aText );
       
   118 		
       
   119 		void CreateLabelsL( const TRect& aRect );
       
   120 		
       
   121 #ifdef __SERIES60_
       
   122 	
       
   123 	    AknLayoutUtils::SAknLayoutTextMultiline GetLabelLayout( const TRect& aRect, 
       
   124 	                                                            TInt aLabelBase, 
       
   125 	                                                            TAknLogicalFontId aFontId ) const;
       
   126 	                                                            
       
   127 	    TInt FontTotalHeightInPixels( TAknLogicalFontId aFontId ) const;
       
   128 	    
       
   129 	    void ReLayoutAllLabels( const TRect& aRect );
       
   130 	    
       
   131 #endif
       
   132 
       
   133 	private: // Data
       
   134 
       
   135 		/// Label controls. Owned.
       
   136 		CArrayPtrSeg< CEikLabel > iLabels;
       
   137 
       
   138 	};
       
   139 
       
   140 #endif // __CTCCONTAINER_H__