iaupdate/IAD/ui/src/iaupdatenavipanehandler.cpp
changeset 29 26b6f0522fd8
parent 25 98b66e4fb0be
child 30 398876c4ffa7
child 33 8110bf1194d1
equal deleted inserted replaced
25:98b66e4fb0be 29:26b6f0522fd8
     1 /*
       
     2 * Copyright (c) 2007-2008 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "iaupdatenavipanehandler.h"
       
    23 #include "iaupdatedebug.h"
       
    24 #include <aknnavilabel.h>
       
    25 #include <eikspane.h>
       
    26 #include <avkon.hrh>
       
    27 
       
    28 /*******************************************************************************
       
    29  * class CIAUpdateNaviPaneHandler
       
    30  *******************************************************************************/
       
    31 
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // Destructor
       
    35 //
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CIAUpdateNaviPaneHandler::~CIAUpdateNaviPaneHandler()
       
    39     {
       
    40    	if (iNaviDecorator)
       
    41 		{
       
    42 		if (iNaviPane && iNavidecoratorPushed)
       
    43 			{
       
    44 			iNaviPane->Pop(iNaviDecorator);
       
    45 			}
       
    46 	
       
    47 		delete iNaviDecorator;
       
    48 		}
       
    49 		
       
    50 	if (iNaviPane && iNavipanePushed)
       
    51 		{
       
    52 		iNaviPane->Pop(); // restore previous navi pane
       
    53 		}
       
    54     }
       
    55 
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CIAUpdateNaviPaneHandler::CIAUpdateNaviPaneHandler
       
    59 //
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CIAUpdateNaviPaneHandler::CIAUpdateNaviPaneHandler(CEikStatusPane* aStatusPane) 
       
    63     : iStatusPane(aStatusPane)
       
    64 	{
       
    65 	iNavidecoratorPushed = EFalse;
       
    66 	iNavipanePushed = EFalse;
       
    67 	
       
    68 	if (iStatusPane)
       
    69 		{
       
    70 		TRAP_IGNORE( 
       
    71 		 iNaviPane = (CAknNavigationControlContainer*)iStatusPane->ControlL( 
       
    72 		                                 TUid::Uid(EEikStatusPaneUidNavi) ) );
       
    73 		}
       
    74 	}
       
    75 
       
    76 
       
    77 // ----------------------------------------------------------------------------
       
    78 // CIAUpdateNaviPaneHandler::SetNaviPaneTitleL
       
    79 // 
       
    80 // ----------------------------------------------------------------------------
       
    81 //
       
    82 void CIAUpdateNaviPaneHandler::SetNaviPaneTitleL(const TDesC& aTitle)
       
    83 	{
       
    84 	if (!iStatusPane || !iNaviPane)
       
    85 		{
       
    86 		return;
       
    87 		}
       
    88 
       
    89     if (iNaviDecorator)
       
    90         {
       
    91         CAknNaviLabel* naviLabel = static_cast<CAknNaviLabel*>(iNaviDecorator->DecoratedControl());
       
    92         if (naviLabel)
       
    93         	{
       
    94         	naviLabel->SetTextL(aTitle);
       
    95         	iNaviDecorator->DrawDeferred();
       
    96         	}
       
    97         }
       
    98      else
       
    99     	{
       
   100     	iNaviDecorator = iNaviPane->CreateNavigationLabelL(aTitle);
       
   101     	iNaviPane->PushL(*iNaviDecorator); // activate navi label in navi pane
       
   102     	iNavidecoratorPushed = ETrue;
       
   103     	}
       
   104 	}
       
   105 
       
   106 
       
   107     
       
   108 //  End of File