stifui/uitestserverstarter/src/UITestServerStarterAppView.cpp
changeset 0 d6fe6244b863
child 3 2703485a934c
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     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 * Description: This module contains the 
       
    14 * implementation of CUITestServerStarterAppView class member 
       
    15 * functions.
       
    16 *
       
    17 */
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <coemain.h>
       
    21 #include <aknviewappui.h> 
       
    22 #include "UITestServerStarterAppView.h"
       
    23 #include "UITestServerStarterApplication.h"
       
    24 #include "UITestServerStarterAppContainer.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: CUITestServerStarterAppView
       
    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: None
       
    65      
       
    66      Return Values: Pointer to new CUITestServerStarterAppView object.
       
    67 
       
    68      Errors/Exceptions: Leave if one of the called functions leaves.
       
    69 
       
    70      Status: Draft
       
    71     
       
    72 -------------------------------------------------------------------------------
       
    73 */
       
    74 CUITestServerStarterAppView* CUITestServerStarterAppView::NewL()
       
    75 	{
       
    76 	CUITestServerStarterAppView* self = CUITestServerStarterAppView::NewLC();
       
    77 	CleanupStack::Pop( self );
       
    78 	return self;
       
    79 	}
       
    80 
       
    81 /*
       
    82 -------------------------------------------------------------------------------
       
    83 
       
    84      Class: CUITestServerStarterAppView
       
    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: None
       
    93      
       
    94      Return Values: Pointer to new CUITestServerStarterAppView object.
       
    95 
       
    96      Errors/Exceptions: Leave if one of the called functions leaves.
       
    97 
       
    98      Status: Draft
       
    99     
       
   100 -------------------------------------------------------------------------------
       
   101 */
       
   102 CUITestServerStarterAppView* CUITestServerStarterAppView::NewLC()
       
   103 	{
       
   104 	CUITestServerStarterAppView* self = new ( ELeave ) CUITestServerStarterAppView;
       
   105 	CleanupStack::PushL( self );
       
   106 	self->ConstructL();
       
   107 	return self;
       
   108 	}
       
   109 
       
   110 /*
       
   111 -------------------------------------------------------------------------------
       
   112 
       
   113      Class: CUITestServerStarterAppView
       
   114 
       
   115      Method: ConstructL
       
   116 
       
   117      Description: ConstructL is second phase of two-phased constructor.
       
   118 
       
   119      ConstructL is second phase of two-phased constructor.
       
   120 
       
   121      Parameters: None
       
   122      
       
   123      Return Values: None
       
   124 
       
   125      Errors/Exceptions: Leave if one of the called functions leaves.
       
   126 
       
   127      Status: Draft
       
   128     
       
   129 -------------------------------------------------------------------------------
       
   130 */
       
   131 void CUITestServerStarterAppView::ConstructL()
       
   132 	{
       
   133 	BaseConstructL( 0 );
       
   134 	}
       
   135 
       
   136 /*
       
   137 -------------------------------------------------------------------------------
       
   138 
       
   139      Class: CUITestServerStarterAppView
       
   140 
       
   141      Method: CUITestServerStarterAppView
       
   142 
       
   143      Description: C++ constructor.
       
   144 
       
   145      C++ constructor.
       
   146 
       
   147      Parameters: None
       
   148      
       
   149      Return Values: None
       
   150 
       
   151      Errors/Exceptions: None
       
   152 
       
   153      Status: Draft
       
   154     
       
   155 -------------------------------------------------------------------------------
       
   156 */
       
   157 CUITestServerStarterAppView::CUITestServerStarterAppView()
       
   158 	{
       
   159 	// No implementation required
       
   160 	}
       
   161 
       
   162 /*
       
   163 -------------------------------------------------------------------------------
       
   164 
       
   165      Class: CUITestServerStarterAppView
       
   166 
       
   167      Method: CUITestServerStarterAppView
       
   168 
       
   169      Description: C++ destructor.
       
   170 
       
   171      C++ destructor.
       
   172 
       
   173      Parameters: None
       
   174      
       
   175      Return Values: None
       
   176 
       
   177      Errors/Exceptions: None
       
   178 
       
   179      Status: Draft
       
   180     
       
   181 -------------------------------------------------------------------------------
       
   182 */
       
   183 CUITestServerStarterAppView::~CUITestServerStarterAppView()
       
   184 	{
       
   185     if ( iContainer )
       
   186         {
       
   187         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   188         }
       
   189 
       
   190     delete iContainer;
       
   191 	}
       
   192 
       
   193 /*
       
   194 -------------------------------------------------------------------------------
       
   195 
       
   196      Class: CUITestServerStarterAppView
       
   197 
       
   198      Method: Id
       
   199 
       
   200      Description: Returns view Uid.
       
   201 
       
   202      Returns view Uid.
       
   203 
       
   204      Parameters: None
       
   205      
       
   206      Return Values: View Uid
       
   207 
       
   208      Errors/Exceptions: None
       
   209 
       
   210      Status: Draft
       
   211     
       
   212 -------------------------------------------------------------------------------
       
   213 */
       
   214 TUid CUITestServerStarterAppView::Id() const
       
   215 	{
       
   216 	return KMainViewId;	
       
   217 	}
       
   218 
       
   219 /*
       
   220 -------------------------------------------------------------------------------
       
   221 
       
   222      Class: CUITestServerStarterAppView
       
   223 
       
   224      Method: HandleCommandL
       
   225 
       
   226      Description: Handle Commands.
       
   227 
       
   228      Handle Commands.
       
   229 
       
   230      Parameters: TInt aCommand: command id
       
   231      
       
   232      Return Values: None
       
   233 
       
   234      Errors/Exceptions: None
       
   235 
       
   236      Status: Draft
       
   237     
       
   238 -------------------------------------------------------------------------------
       
   239 */
       
   240 void CUITestServerStarterAppView::HandleCommandL( TInt aCommand )
       
   241     {   
       
   242     AppUi()->HandleCommandL( aCommand );
       
   243     }
       
   244 
       
   245 /*
       
   246 -------------------------------------------------------------------------------
       
   247 
       
   248      Class: CUITestServerStarterAppView
       
   249 
       
   250      Method: HandleClientRectChange
       
   251 
       
   252      Description: Handle size changes.
       
   253 
       
   254      Handle size changes.
       
   255 
       
   256      Parameters: None
       
   257      
       
   258      Return Values: None
       
   259 
       
   260      Errors/Exceptions: None
       
   261 
       
   262      Status: Draft
       
   263     
       
   264 -------------------------------------------------------------------------------
       
   265 */
       
   266 void CUITestServerStarterAppView::HandleClientRectChange()
       
   267     {
       
   268     if ( iContainer )
       
   269         {
       
   270         iContainer->SetRect( ClientRect() );
       
   271         }
       
   272     }
       
   273 
       
   274 /*
       
   275 -------------------------------------------------------------------------------
       
   276 
       
   277      Class: CUITestServerStarterAppView
       
   278 
       
   279      Method: DoActivateL
       
   280 
       
   281      Description: From AknView, Activates view.
       
   282 
       
   283      From AknView, Activates view.
       
   284 
       
   285      Parameters: const TVwsViewId& aPrevViewId: previouse view id
       
   286      			 TUid aCustomMessageId: custom message id
       
   287    				 const TDesC8& aCustomMessage: custom message data
       
   288      
       
   289      Return Values: None
       
   290 
       
   291      Errors/Exceptions: None
       
   292 
       
   293      Status: Draft
       
   294     
       
   295 -------------------------------------------------------------------------------
       
   296 */
       
   297 void CUITestServerStarterAppView::DoActivateL(
       
   298    const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/,
       
   299    const TDesC8& /*aCustomMessage*/)
       
   300     {
       
   301     if ( !iContainer )
       
   302         {
       
   303         // Create view container
       
   304         iContainer = CUITestServerStarterAppContainer::NewL( ClientRect() );
       
   305         iContainer->SetMopParent( this );
       
   306         // Add container to view stack
       
   307         AppUi()->AddToStackL( *this, iContainer );
       
   308         } 
       
   309    }
       
   310 
       
   311 /*
       
   312 -------------------------------------------------------------------------------
       
   313 
       
   314      Class: CUITestServerStarterAppView
       
   315 
       
   316      Method: DoDeactivate
       
   317 
       
   318      Description: From AknView, Deactivates view.
       
   319 
       
   320      From AknView, Deactivates view.
       
   321 
       
   322      Parameters: None
       
   323      
       
   324      Return Values: None
       
   325 
       
   326      Errors/Exceptions: None
       
   327 
       
   328      Status: Draft
       
   329     
       
   330 -------------------------------------------------------------------------------
       
   331 */
       
   332 void CUITestServerStarterAppView::DoDeactivate()
       
   333     {
       
   334     if ( iContainer )
       
   335         {
       
   336         // Remove container from view stack
       
   337         AppUi()->RemoveFromViewStack( *this, iContainer );
       
   338         }
       
   339     
       
   340     // Delete container since it's not longer needed.
       
   341     delete iContainer;
       
   342     iContainer = NULL;
       
   343     }
       
   344 
       
   345 // End of File