deviceencryption/DevEncUi/src/DevEncUiDecrView.cpp
changeset 0 6a9f87576119
child 14 efe289f793e7
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Implementation of CDevEncUiDecrView.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 // Class includes
       
    20 #include "DevEncUiDecrView.h"
       
    21 
       
    22 // System includes
       
    23 #include <aknViewAppUi.h>	// CAknViewAppUi
       
    24 #include <DevEncUi.rsg>
       
    25 
       
    26 // User includes
       
    27 #include "DevEncLog.h"
       
    28 #include "DevEnc.hrh"
       
    29 #include "DevEncUiDecrViewContainer.h"
       
    30 #include "DevEncUiMemoryEntity.h"
       
    31 
       
    32 // ================= MEMBER FUNCTIONS =======================
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CDevEncUiDecrView::CDevEncUiDecrView
       
    36 //
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CDevEncUiDecrView::~CDevEncUiDecrView()
       
    40 	{
       
    41 	delete iContainer;
       
    42 	}
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CDevEncUiDecrView::NewL
       
    46 //
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CDevEncUiDecrView* CDevEncUiDecrView::NewL( RArray<CDevEncUiMemoryEntity*>& aMemEntities )
       
    50 	{
       
    51 	CDevEncUiDecrView* self = CDevEncUiDecrView::NewLC( aMemEntities );
       
    52 	CleanupStack::Pop( self );
       
    53 	return self;
       
    54 	}
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CDevEncUiDecrView::NewLC
       
    58 //
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 CDevEncUiDecrView* CDevEncUiDecrView::NewLC( RArray<CDevEncUiMemoryEntity*>& aMemEntities )
       
    62 	{
       
    63 	CDevEncUiDecrView* self = new ( ELeave ) CDevEncUiDecrView( aMemEntities );
       
    64 	CleanupStack::PushL( self );
       
    65 	self->ConstructL();
       
    66 	return self;
       
    67 	}
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CDevEncUiDecrView::CDevEncUiDecrView
       
    71 //
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CDevEncUiDecrView::CDevEncUiDecrView( RArray<CDevEncUiMemoryEntity*>& aMemEntities )
       
    75     : iMemEntities( aMemEntities )
       
    76 	{
       
    77 	}
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CDevEncUiDecrView::Container
       
    81 //
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 CDevEncUiDecrViewContainer* CDevEncUiDecrView::Container()
       
    85 	{
       
    86 	return iContainer;
       
    87 	}
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CDevEncUiDecrView::GetAppUi
       
    91 //
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 CDevEncUiAppUi& CDevEncUiDecrView::GetAppUi()
       
    95     {
       
    96     CAknViewAppUi* aknViewAppUi = AppUi();
       
    97     CDevEncUiAppUi* appUi = reinterpret_cast<CDevEncUiAppUi*>( aknViewAppUi );
       
    98     return ( *appUi );
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CDevEncUiDecrView::ConstructL
       
   103 //
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 void CDevEncUiDecrView::ConstructL()
       
   107 	{
       
   108 	BaseConstructL( R_DEVENCUI_DECRVIEW );
       
   109 	}
       
   110 
       
   111 // -----------------------------------------------------------------------------
       
   112 // CDevEncUiDecrView::Id
       
   113 //
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 TUid CDevEncUiDecrView::Id() const
       
   117 	{
       
   118 	return TUid::Uid( EDevEncUiDecrViewId );
       
   119 	}
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122 // CDevEncUiDecrView::DoActivateL
       
   123 //
       
   124 // -----------------------------------------------------------------------------
       
   125 //
       
   126 void CDevEncUiDecrView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
       
   127 									 TUid /*aCustomMessageId*/,
       
   128 									 const TDesC8& /*aCustomMessage*/ )
       
   129 	{
       
   130 	if ( !iContainer )
       
   131 		{
       
   132 		iContainer = CDevEncUiDecrViewContainer::NewL( AppUi()->ClientRect(),
       
   133                                                        *this );
       
   134 		iContainer->SetMopParent( this );
       
   135 		AppUi()->AddToStackL( *this, iContainer );
       
   136 		}
       
   137 	}
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // CDevEncUiDecrView::DoDeactivate
       
   141 //
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 void CDevEncUiDecrView::DoDeactivate()
       
   145 	{
       
   146 	if (iContainer)
       
   147 		{
       
   148 		AppUi()->RemoveFromStack( iContainer );
       
   149 		delete iContainer;
       
   150 		iContainer = NULL;
       
   151 		}
       
   152 	}
       
   153 
       
   154 // -----------------------------------------------------------------------------
       
   155 // CDevEncUiDecrView::HandleCommandL
       
   156 //
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 void CDevEncUiDecrView::HandleCommandL( TInt aCommand )
       
   160 	{
       
   161 
       
   162 	switch ( aCommand )
       
   163 		{
       
   164 
       
   165 		case EAknSoftkeyBack:
       
   166 			{
       
   167 			AppUi()->HandleCommandL( EAknSoftkeyBack );
       
   168 			break;
       
   169 			}
       
   170 		default:
       
   171 			{
       
   172 			AppUi()->HandleCommandL( aCommand );
       
   173 			}
       
   174 		}
       
   175 	}
       
   176 
       
   177 // --------------------------------------------------------------------------
       
   178 //  Called by the framework when the application status pane
       
   179 //  size is changed.  Passes the new client rectangle to the container.
       
   180 // --------------------------------------------------------------------------
       
   181 void CDevEncUiDecrView::HandleStatusPaneSizeChange()
       
   182     {
       
   183     if ( iContainer )
       
   184         {
       
   185         iContainer->SetRect( ClientRect() );
       
   186         }
       
   187     }
       
   188 
       
   189 void CDevEncUiDecrView::HandleResourceChangeL( TInt aType )
       
   190     {
       
   191     if  ( aType == KEikDynamicLayoutVariantSwitch )
       
   192         {
       
   193         // do re-layout
       
   194         if ( iContainer )
       
   195             {
       
   196             iContainer->SetRect( ClientRect() );
       
   197             iContainer->HandleResourceChange( aType );
       
   198             }
       
   199         }
       
   200     }
       
   201 
       
   202 
       
   203 // End of File