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: |
|
15 * Base class for handling key events. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CPHONESYSTEMEVENTHANDLER_H |
|
21 #define __CPHONESYSTEMEVENTHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include "mphonesystemeventhandler.h" |
|
26 #include "mphonepubsubobserver.h" |
|
27 #include "mphonecenrepobserver.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPhoneStateMachine; |
|
31 |
|
32 /** |
|
33 * Transforms system events to be sent to the states |
|
34 */ |
|
35 class CPhoneSystemEventHandler : |
|
36 public CBase, |
|
37 public MPhoneSystemEventHandler, |
|
38 public MPhonePubSubObserver, |
|
39 public MPhoneCenRepObserver |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CPhoneSystemEventHandler* NewL( |
|
47 MPhoneStateMachine* aStateMachine ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CPhoneSystemEventHandler(); |
|
53 |
|
54 public: // From MPhoneSystemEvents |
|
55 |
|
56 void DynInitMenuPaneL( |
|
57 TInt aResourceId, |
|
58 CEikMenuPane* aMenuPane ); |
|
59 |
|
60 void DynInitMenuBarL( |
|
61 TInt aResourceId, |
|
62 CEikMenuBar* aMenuBar ); |
|
63 |
|
64 void HandleSystemEventL( const TWsEvent& aEvent ); |
|
65 |
|
66 void HandleForegroundEventL( TBool aForeground ); |
|
67 |
|
68 void HandlePhoneForegroundEventL(); |
|
69 |
|
70 void HandleIdleForegroundEventL(); |
|
71 |
|
72 void HandleEnvironmentChangeL( const TInt aChanges ); |
|
73 |
|
74 void HandlePhoneStartupL(); |
|
75 |
|
76 void HandlePhoneFocusLostEventL(); |
|
77 |
|
78 void HandleKeyLockEnabled( TBool aKeylockEnabled ); |
|
79 |
|
80 public: // From MPhonePubSubObserver |
|
81 |
|
82 /** |
|
83 * This function is called when there is property value change. |
|
84 * @param aCategory Category of the property |
|
85 * @param aKey Property key that is changed |
|
86 * @param aValue New property value |
|
87 */ |
|
88 virtual void HandlePropertyChangedL( |
|
89 const TUid& aCategory, |
|
90 const TUint aKey, |
|
91 const TInt aValue ); |
|
92 |
|
93 public: // From MPhoneCenRepObserver |
|
94 |
|
95 /** |
|
96 * Handle the change of the setting from Central Repository |
|
97 * @param aUid identifing the central repository UID. |
|
98 * @param aId central repository ID. |
|
99 */ |
|
100 virtual void HandleCenRepChangeL( |
|
101 const TUid& aUid, |
|
102 const TUint aId ); |
|
103 |
|
104 private: |
|
105 |
|
106 /** |
|
107 * By default EPOC constructor is private. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 /** |
|
112 * C++ default constructor. |
|
113 */ |
|
114 CPhoneSystemEventHandler( MPhoneStateMachine* aStateMachine ); |
|
115 |
|
116 private: // Data |
|
117 |
|
118 /** |
|
119 * State machine |
|
120 */ |
|
121 MPhoneStateMachine* iStateMachine; |
|
122 |
|
123 }; |
|
124 |
|
125 #endif // __CPHONESYSTEMEVENTHANDLER_H |
|
126 |
|
127 // End of File |
|