stifui/avkon/uitestserverstarter/src/UITestServerStarterAppContainer.cpp
branchRCL_3
changeset 20 48060abbbeaf
parent 19 d40e813b23c0
child 21 b3cee849fa46
equal deleted inserted replaced
19:d40e813b23c0 20:48060abbbeaf
     1 /*
       
     2 * Copyright (c) 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: This module contains the implementation of 
       
    15 * CUITestServerStarterAppContainer class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "UITestServerStarterAppContainer.h"
       
    21 #include <AknsDrawUtils.h>
       
    22 #include <AknsBasicBackgroundControlContext.h>
       
    23 #include <AknDef.h>
       
    24 #include <AknUtils.h> 
       
    25 
       
    26 // EXTERNAL DATA STRUCTURES
       
    27 // None
       
    28 
       
    29 // EXTERNAL FUNCTION PROTOTYPES  
       
    30 // None
       
    31 
       
    32 // CONSTANTS
       
    33 // None
       
    34 
       
    35 // MACROS
       
    36 // None
       
    37 
       
    38 // LOCAL CONSTANTS AND MACROS
       
    39 // None
       
    40 
       
    41 // MODULE DATA STRUCTURES
       
    42 // None
       
    43 
       
    44 // LOCAL FUNCTION PROTOTYPES
       
    45 // None
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 // None
       
    49 
       
    50 
       
    51 // ================= MEMBER FUNCTIONS =========================================
       
    52 
       
    53 /*
       
    54 -------------------------------------------------------------------------------
       
    55 
       
    56      Class: CUITestServerStarterAppContainer
       
    57 
       
    58      Method: NewL
       
    59 
       
    60      Description: NewL is first phase of two-phased constructor.
       
    61 
       
    62      NewL is first phase of two-phased constructor.
       
    63 
       
    64      Parameters: const TRect& aRect: container rectangle.
       
    65      
       
    66      Return Values: Pointer to new CUITestServerStarterAppContainer object.
       
    67 
       
    68      Errors/Exceptions: Leave if one of the called functions leaves.
       
    69 
       
    70      Status: Draft
       
    71     
       
    72 -------------------------------------------------------------------------------
       
    73 */
       
    74 CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewL( const TRect& aRect )
       
    75 	{
       
    76 	CUITestServerStarterAppContainer* self = NewLC( aRect );
       
    77 	CleanupStack::Pop( self );
       
    78 	return self;
       
    79 	}
       
    80 
       
    81 /*
       
    82 -------------------------------------------------------------------------------
       
    83 
       
    84      Class: CUITestServerStarterAppContainer
       
    85 
       
    86      Method: NewLC
       
    87 
       
    88      Description: NewL is first phase of two-phased constructor.
       
    89 
       
    90      NewL is first phase of two-phased constructor.
       
    91 
       
    92      Parameters: const TRect& aRect: container rect
       
    93      
       
    94      Return Values: Pointer to new CUITestServerStarterAppContainer object.
       
    95 
       
    96      Errors/Exceptions: Leave if one of the called functions leaves.
       
    97 
       
    98      Status: Draft
       
    99     
       
   100 -------------------------------------------------------------------------------
       
   101 */
       
   102 CUITestServerStarterAppContainer* CUITestServerStarterAppContainer::NewLC( const TRect& aRect )
       
   103 	{
       
   104 	CUITestServerStarterAppContainer* self = 
       
   105 		new(ELeave)CUITestServerStarterAppContainer;
       
   106 	CleanupStack::PushL( self );
       
   107 	self->ConstructL( aRect );
       
   108 	return self;
       
   109 	}
       
   110 
       
   111 /*
       
   112 -------------------------------------------------------------------------------
       
   113 
       
   114      Class: CUITestServerStarterAppContainer
       
   115 
       
   116      Method: CUITestServerStarterAppContainer
       
   117 
       
   118      Description: C++ constructor.
       
   119 
       
   120      C++ constructor.
       
   121 
       
   122      Parameters: None
       
   123      
       
   124      Return Values: None
       
   125 
       
   126      Errors/Exceptions: None
       
   127 
       
   128      Status: Draft
       
   129     
       
   130 -------------------------------------------------------------------------------
       
   131 */
       
   132 CUITestServerStarterAppContainer::CUITestServerStarterAppContainer()
       
   133 	{	
       
   134 	}
       
   135 
       
   136 /*
       
   137 -------------------------------------------------------------------------------
       
   138 
       
   139      Class: CUITestServerStarterAppContainer
       
   140 
       
   141      Method: CUITestServerStarterAppContainer
       
   142 
       
   143      Description: C++ destructor.
       
   144 
       
   145      C++ destructor.
       
   146 
       
   147      Parameters: None
       
   148      
       
   149      Return Values: None
       
   150 
       
   151      Errors/Exceptions: None
       
   152 
       
   153      Status: Draft
       
   154     
       
   155 -------------------------------------------------------------------------------
       
   156 */
       
   157 CUITestServerStarterAppContainer::~CUITestServerStarterAppContainer()
       
   158 	{
       
   159 	delete iBgContext;
       
   160 	}
       
   161 
       
   162 /*
       
   163 -------------------------------------------------------------------------------
       
   164 
       
   165      Class: CUITestServerStarterAppContainer
       
   166 
       
   167      Method: ConstructL
       
   168 
       
   169      Description: ConstructL is second phase of two-phased constructor.
       
   170 
       
   171      ConstructL is second phase of two-phased constructor.
       
   172 
       
   173      Parameters: const TRect& aRect: container rectangle.
       
   174      
       
   175      Return Values: None
       
   176 
       
   177      Errors/Exceptions: Leave if one of the called functions leaves.
       
   178 
       
   179      Status: Draft
       
   180     
       
   181 -------------------------------------------------------------------------------
       
   182 */
       
   183 void CUITestServerStarterAppContainer::ConstructL( const TRect& aRect )
       
   184 	{
       
   185 	CreateWindowL();
       
   186 	
       
   187 	iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, aRect, ETrue );	
       
   188 	
       
   189 	SetRect( aRect );
       
   190 	ActivateL();
       
   191 	}
       
   192 
       
   193 /*
       
   194 -------------------------------------------------------------------------------
       
   195 
       
   196      Class: CUITestServerStarterAppContainer
       
   197 
       
   198      Method: Draw
       
   199 
       
   200      Description: Draws the control.
       
   201 
       
   202      Draws the control.
       
   203 
       
   204      Parameters: const TRect& aRect: rectangle which should be redrawn.
       
   205      
       
   206      Return Values: None
       
   207 
       
   208      Errors/Exceptions: None
       
   209 
       
   210      Status: Draft
       
   211     
       
   212 -------------------------------------------------------------------------------
       
   213 */
       
   214 void CUITestServerStarterAppContainer::Draw( const TRect& aRect ) const
       
   215 	{
       
   216 	// Get the standard graphics context 
       
   217 	CWindowGc& gc = SystemGc();
       
   218 
       
   219 	// Redraw the background using the default skin
       
   220 	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   221 	MAknsControlContext* controlContext = AknsDrawUtils::ControlContext( this );
       
   222 	AknsDrawUtils::Background( skin, controlContext, this, gc, aRect );	
       
   223 	}
       
   224 
       
   225 /*
       
   226 -------------------------------------------------------------------------------
       
   227 
       
   228      Class: CUITestServerStarterAppContainer
       
   229 
       
   230      Method: SizeChanged
       
   231 
       
   232      Description: Responds to changes to the size and position of the contents of this control
       
   233 
       
   234      Responds to changes to the size and position of the 
       
   235      contents of this control
       
   236 
       
   237      Parameters: None
       
   238      
       
   239      Return Values: None
       
   240 
       
   241      Errors/Exceptions: None
       
   242 
       
   243      Status: Draft
       
   244     
       
   245 -------------------------------------------------------------------------------
       
   246 */
       
   247 void CUITestServerStarterAppContainer::SizeChanged()
       
   248 	{
       
   249 	if ( iBgContext )
       
   250 		{
       
   251 		iBgContext->SetRect( Rect() );
       
   252 		if ( &Window() )
       
   253 			{
       
   254 			iBgContext->SetParentPos( PositionRelativeToScreen() );
       
   255 			}
       
   256 		}
       
   257 	}
       
   258 
       
   259 /*
       
   260 -------------------------------------------------------------------------------
       
   261 
       
   262      Class: CUITestServerStarterAppContainer
       
   263 
       
   264      Method: MopSupplyObject
       
   265 
       
   266      Description: This function is used to allow controls to ask their owners for access to other objects that they own
       
   267 
       
   268      This function is used to allow controls to ask their owners 
       
   269 	 for access to other objects that they own
       
   270 	 
       
   271      Parameters: TTypeUid aId: requested object type id.
       
   272      
       
   273      Return Values: Pointer to requested object.
       
   274 
       
   275      Errors/Exceptions: None
       
   276 
       
   277      Status: Draft
       
   278     
       
   279 -------------------------------------------------------------------------------
       
   280 */
       
   281 TTypeUid::Ptr CUITestServerStarterAppContainer::MopSupplyObject( TTypeUid aId )
       
   282 	{
       
   283 	if ( iBgContext )
       
   284 		{
       
   285 		return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   286 		}
       
   287 	return CCoeControl::MopSupplyObject( aId );
       
   288 	}
       
   289 
       
   290 // End of File