resourcemgmt/hwresourcesmgr/common/src/hwrmuipluginhandler.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32base.h>
       
    17 #include <ecom/ecom.h>
       
    18 
       
    19 #include "hwrmuipluginhandler.h"
       
    20 #include "HWRMtrace.h"
       
    21 
       
    22 CHwrmUiPluginHandler* CHwrmUiPluginHandler::NewL()
       
    23 	{
       
    24 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler - CHwrmUiPluginHandler::NewL()" ) );    
       
    25 	
       
    26     CHwrmUiPluginHandler* self = new( ELeave ) CHwrmUiPluginHandler();    
       
    27     CleanupStack::PushL( self );
       
    28     self->ConstructL();
       
    29     CleanupStack::Pop();
       
    30     
       
    31     COMPONENT_TRACE2(_L( "CHwrmUiPluginHandler - CHwrmUiPluginHandler::NewL - return 0x%x" ), self );
       
    32     return self;    
       
    33 	}
       
    34 	
       
    35 void CHwrmUiPluginHandler::ConstructL()
       
    36     {    
       
    37     COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::ConstructL()" ));
       
    38         
       
    39     // get plugin instance
       
    40     iUiPluginService = CHwrmUiPluginService::NewL();
       
    41     
       
    42     
       
    43     COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::ConstructL - return" ));    
       
    44     }
       
    45     
       
    46     
       
    47 CHwrmUiPluginHandler::CHwrmUiPluginHandler()
       
    48 	{	
       
    49 	}
       
    50 	
       
    51 	
       
    52 CHwrmUiPluginHandler::~CHwrmUiPluginHandler()
       
    53 	{ 
       
    54 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::~CHwrmUiPluginHandler()" ));	
       
    55 	
       
    56 	delete iUiPluginService;	
       
    57 	REComSession::FinalClose();
       
    58 	
       
    59 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::~CHwrmUiPluginHandler() - return" ));
       
    60 	}
       
    61 
       
    62 
       
    63 void CHwrmUiPluginHandler::AddForegroundObserverL(MHwrmForegroundObserver* aObserver)
       
    64 	{
       
    65 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::AddForegroundObserverL()" ));
       
    66 		
       
    67 	iUiPluginService->AddForegroundObserverL(aObserver);	
       
    68 	
       
    69 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::AddForegroundObserverL() - return" ));
       
    70 	}  
       
    71 
       
    72 
       
    73 TBool CHwrmUiPluginHandler::InForeground() const
       
    74 	{
       
    75 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::InForeground()" ));
       
    76 	
       
    77 	COMPONENT_TRACE1(_L( "CHwrmUiPluginHandler::InForeground() - return" ));
       
    78 		
       
    79 	return iUiPluginService->InForeground();					
       
    80 	}