common/tools/ats/smoketest/localisation/apparchitecture/tef/ticoncaptionoverride.cpp
changeset 793 0c32c669a39d
child 872 17498133d9ad
equal deleted inserted replaced
792:893b85cda81b 793:0c32c669a39d
       
     1 // Copyright (c) 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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Symbian test code.
       
    22 */
       
    23 
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <eikstart.h>
       
    27 #include "ticoncaptionoverride.h"
       
    28 
       
    29 const TUid KIconCapOverrideAppUid = {0x2001B674}; // test application UID
       
    30 
       
    31 CIconCaptionOverrideView* CIconCaptionOverrideView::NewL( const TRect& aRect )
       
    32     {
       
    33     CIconCaptionOverrideView* self = CIconCaptionOverrideView::NewLC( aRect );
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37 
       
    38 CIconCaptionOverrideView* CIconCaptionOverrideView::NewLC( const TRect& aRect )
       
    39     {
       
    40     CIconCaptionOverrideView* self = new ( ELeave ) CIconCaptionOverrideView;
       
    41     CleanupStack::PushL( self );
       
    42     self->ConstructL( aRect );
       
    43     return self;
       
    44     }
       
    45 
       
    46 void CIconCaptionOverrideView::ConstructL( const TRect& aRect )
       
    47     {
       
    48     // Create a window for this application view
       
    49     CreateWindowL();
       
    50 
       
    51     // Set the windows size
       
    52     SetRect( aRect );
       
    53 
       
    54     // Activate the window, which makes it ready to be drawn
       
    55     ActivateL();
       
    56     }
       
    57 
       
    58 CIconCaptionOverrideView::CIconCaptionOverrideView()
       
    59     {
       
    60     // No implementation required
       
    61     }
       
    62 
       
    63 CIconCaptionOverrideView::~CIconCaptionOverrideView()
       
    64     {
       
    65     // No implementation required
       
    66     }
       
    67 
       
    68 void CIconCaptionOverrideView::Draw( const TRect& /*aRect*/ ) const
       
    69     {
       
    70     // Get the standard graphics context
       
    71     CWindowGc& gc = SystemGc();
       
    72 
       
    73     // Gets the control's extent
       
    74     TRect drawRect( Rect());
       
    75 
       
    76     // Clears the screen
       
    77     gc.Clear( drawRect );
       
    78     
       
    79   	}
       
    80 
       
    81 void CIconCaptionOverrideView::SizeChanged()
       
    82     {  
       
    83     DrawNow();
       
    84     }
       
    85 
       
    86 void CIconCaptionOverrideAppUi::ConstructL()
       
    87     {
       
    88     // Initialise app UI. Without EAknEnableSkin the dialogs do not render properly in 3.x.
       
    89     //BaseConstructL(EAknEnableSkin);
       
    90 	BaseConstructL();
       
    91 
       
    92 	// Create view object
       
    93 	iAppView = CIconCaptionOverrideView::NewL( ClientRect() );	
       
    94 	}
       
    95 
       
    96 CIconCaptionOverrideAppUi::CIconCaptionOverrideAppUi()
       
    97     {
       
    98     // No implementation required
       
    99     }
       
   100 
       
   101 CIconCaptionOverrideAppUi::~CIconCaptionOverrideAppUi()
       
   102     {
       
   103     if ( iAppView )
       
   104         {
       
   105         delete iAppView;
       
   106         iAppView = NULL;        
       
   107         }
       
   108     }
       
   109 
       
   110 void CIconCaptionOverrideAppUi::HandleCommandL( TInt aCommand )
       
   111     {
       
   112     switch( aCommand )
       
   113         {
       
   114         case EEikCmdExit:
       
   115         //case EAknSoftkeyExit:
       
   116             Exit();
       
   117             break;
       
   118         default:
       
   119             break;
       
   120         }
       
   121     }
       
   122 
       
   123 /*void CIconCaptionOverrideAppUi::HandleStatusPaneSizeChange()
       
   124 	{
       
   125 	iAppView->SetRect( ClientRect() );
       
   126 	}
       
   127 */
       
   128 CIconCaptionOverrideDocument* CIconCaptionOverrideDocument::NewL( CEikApplication&
       
   129                                                           aApp )
       
   130     {
       
   131     CIconCaptionOverrideDocument* self = NewLC( aApp );
       
   132     CleanupStack::Pop( self );
       
   133     return self;
       
   134     }
       
   135 
       
   136 CIconCaptionOverrideDocument* CIconCaptionOverrideDocument::NewLC( CEikApplication&
       
   137                                                            aApp )
       
   138     {
       
   139     CIconCaptionOverrideDocument* self =
       
   140         new ( ELeave ) CIconCaptionOverrideDocument( aApp );
       
   141 
       
   142     CleanupStack::PushL( self );
       
   143     self->ConstructL();
       
   144     return self;
       
   145     }
       
   146 
       
   147 void CIconCaptionOverrideDocument::ConstructL()
       
   148     {
       
   149     // No implementation required
       
   150     }
       
   151 
       
   152 CIconCaptionOverrideDocument::CIconCaptionOverrideDocument( CEikApplication& aApp )
       
   153     : CEikDocument( aApp )
       
   154     {
       
   155     // No implementation required
       
   156     }
       
   157 
       
   158 CIconCaptionOverrideDocument::~CIconCaptionOverrideDocument()
       
   159     {
       
   160     // No implementation required
       
   161     }
       
   162     
       
   163 CEikAppUi* CIconCaptionOverrideDocument::CreateAppUiL()
       
   164     {
       
   165     // Create the application user interface, and return a pointer to it;
       
   166     // the framework takes ownership of this object
       
   167     return ( static_cast <CEikAppUi*> ( new ( ELeave )
       
   168                                         CIconCaptionOverrideAppUi ) );
       
   169     }
       
   170 
       
   171 CApaDocument* CIconCaptionOverrideApplication::CreateDocumentL()
       
   172     {
       
   173     return (static_cast<CApaDocument*>
       
   174                     ( CIconCaptionOverrideDocument::NewL( *this ) ) );
       
   175     }
       
   176 
       
   177 TUid CIconCaptionOverrideApplication::AppDllUid() const
       
   178     {
       
   179     return KIconCapOverrideAppUid;
       
   180     }
       
   181 
       
   182 LOCAL_C CApaApplication* NewApplication()
       
   183 	{
       
   184 	return new CIconCaptionOverrideApplication;
       
   185 	}
       
   186 
       
   187 GLDEF_C TInt E32Main()
       
   188 	{
       
   189 	return EikStart::RunApplication( NewApplication );
       
   190 	}
       
   191 
       
   192 
       
   193