commonuisupport/uilaf/inc/lafshut.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 1997-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 #ifndef __LAFSHUT_H__
       
    17 #define __LAFSHUT_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <savenotf.h>
       
    21 #include <shutdownsrv.h>
       
    22 
       
    23 
       
    24 class CLafShutdownManagerBase : public CBase
       
    25 /** Base class for a LAF shutdown manager.
       
    26 
       
    27 A LAF implements a derived class to implement a policy on when to shutdown 
       
    28 the device. The policy can involve listening for events, timers, etc.
       
    29 
       
    30 @see LafShutdown 
       
    31 @publishedPartner 
       
    32 @released */
       
    33 	{
       
    34 protected:
       
    35 	inline CLafShutdownManagerBase(MShutdownEventObserver& aObserver);
       
    36 protected:
       
    37 	/** Kernel's shutdown observer, initialised by the constructor. */
       
    38 	MShutdownEventObserver& iObserver;
       
    39 	};
       
    40 
       
    41 
       
    42 class LafShutdown
       
    43 /** Device shutdown LAF support.
       
    44 
       
    45 @publishedPartner 
       
    46 @released */
       
    47 	{
       
    48 public:
       
    49 	/** Creates a shutdown manager.
       
    50 	
       
    51 	@param aObserver Provides a means for the LAF to notify the kernel of shutdown-related 
       
    52 	events.
       
    53 	@return Shutdown manager */
       
    54 	IMPORT_C static CLafShutdownManagerBase* CreateShutdownManager(MShutdownEventObserver& aObserver);
       
    55 	/** Tests if the current application should be asked to save when a view change 
       
    56 	occurs.
       
    57 	
       
    58 	This is called when a view change occurs.
       
    59 	
       
    60 	@return Type of save (including none) that the application should perform
       
    61 	@see CCoeAppUi::ActivateViewL()
       
    62 	@see CEikDocument::SaveL() */
       
    63 	IMPORT_C static MSaveObserver::TSaveType SaveFromViewSwitch();
       
    64 	/** Tests if the current application should be asked to save when an application 
       
    65 	switch occurs.
       
    66 	
       
    67 	This is called when an application switch occurs.
       
    68 	
       
    69 	@return Type of save (including none) that the application should perform */
       
    70 	IMPORT_C static MSaveObserver::TSaveType SaveFromAppSwitch();
       
    71 	};
       
    72 
       
    73 
       
    74 inline CLafShutdownManagerBase::CLafShutdownManagerBase(MShutdownEventObserver& aObserver)
       
    75 	: iObserver(aObserver)
       
    76 /** Constructor.
       
    77 
       
    78 @param aObserver Kernel's shutdown observer. The LAF can call this interface 
       
    79 to notify the kernel of device shutdown, so that the kernel can take appropriate 
       
    80 power management steps. */
       
    81 	{}
       
    82 
       
    83 
       
    84 #endif