|
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 #if !defined(SHUTDOWNSRV_H) |
|
17 #define SHUTDOWNSRV_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <savenotf.h> |
|
21 #include <e32power.h> |
|
22 #include <s32mem.h> |
|
23 |
|
24 class CShutdownTimer; |
|
25 |
|
26 /** |
|
27 This class describes an interface, which is used by LaF Shutdown Manager to notify the Shutdown Server of |
|
28 device shutdown, so that the server can take appropriate power management steps. The concrete implementation |
|
29 of this interface is provided by CServShutdownServer class. |
|
30 @publishedPartner |
|
31 @released |
|
32 */ |
|
33 class MShutdownEventObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 This method has to be called, when the observed object requires the Shutdown Server to notify registered |
|
38 clients about the shutdown event, such as MSaveObserver::ESaveData, MSaveObserver::ESaveAll, |
|
39 MSaveObserver::EReleaseRAM,... |
|
40 @param aAction The type of the requested action |
|
41 @param aPowerOff If it is non-zero, this is the beginning of a powerdown sequence. |
|
42 @param aEvent The type of the powerdown event |
|
43 @leave KErrNotSupported Leaves if aEvent is invalid |
|
44 */ |
|
45 virtual void HandleShutdownEventL(MSaveObserver::TSaveType aAction,TBool aPowerOff, TPowerState aEvent = EPwStandby)=0; |
|
46 /** |
|
47 This method creates an array of CArrayFix<TThreadId> type and appends to it the thread id-s of |
|
48 all the registered clients. The created CArrayFix<TThreadId> instance will be pushed on the |
|
49 cleanup stack. The caller becomes responsible for the memory allocated for this array. |
|
50 @return A pointer to a CArrayFix<TThreadId> array with the client thread id-s. |
|
51 @leave Some system-wide error codes including KErrNoMemory. |
|
52 */ |
|
53 virtual CArrayFix<TThreadId>* ClientArrayLC()=0; |
|
54 /** |
|
55 Checks if a particular client is hung in that the client has not re-registered with the |
|
56 Shutdown Server indicating it is ready for the next stage of the shutdown. |
|
57 @param aId Client's thread id. |
|
58 @return Non-zero if the client with this thread id has no pending request. |
|
59 */ |
|
60 virtual TBool IsClientHung(TThreadId aId) const=0; |
|
61 /** |
|
62 This method returns information about the shutdown status. |
|
63 @param aPowerOff An output parameter, where power-off status will be stored. |
|
64 It will be non-zero, if a powerdown sequence has been initiated. |
|
65 @param aAllSessionsHavePendingRequest An output parameter. It will be non-zero, if all clients |
|
66 have pending requests to receive further events from the Shutdown Manager. |
|
67 */ |
|
68 virtual void GetShutdownState(TBool& aPowerOff, TBool& aAllSessionsHavePendingRequest) const=0; |
|
69 }; |
|
70 |
|
71 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
72 #include "shutdownsess.h" |
|
73 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
74 |
|
75 #endif// SHUTDOWNSRV_H |