|
1 /* |
|
2 * Copyright (c) 2007-2009 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: Main plugin class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HSAPPKEYPLUGIN_H |
|
20 #define HSAPPKEYPLUGIN_H |
|
21 |
|
22 #include <sysapkeyhandlerplugininterface.h> |
|
23 #include <hb/hbcore/hbdevicedialogsymbian.h> |
|
24 |
|
25 class CEikonEnv; |
|
26 class CHbDeviceDialogSymbian; |
|
27 |
|
28 /** |
|
29 * CAppKeyPlugin |
|
30 * An implementation of the CSysapKeyHandlerPlugin definition. The plugin handles EKeyXXX events. |
|
31 * This is concrete class, instance of which |
|
32 * ECOM framework gives to ECOM clients. |
|
33 * @lib CAppKeyPlugin |
|
34 * @since Series 60 version 3.1 |
|
35 */ |
|
36 class CHsAppKeyPlugin : public CSysapKeyHandlerPlugin, |
|
37 public MHbDeviceDialogObserver |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 static CHsAppKeyPlugin* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CHsAppKeyPlugin(); |
|
49 public: //MHbDeviceDialogObserver interfaces |
|
50 void DataReceived(CHbSymbianVariantMap& aData); |
|
51 |
|
52 void DeviceDialogClosed(TInt aCompletionCode); |
|
53 |
|
54 public: // New functions |
|
55 /** |
|
56 * HandleKeyEventL |
|
57 * @since Series 60 Series60_version 3.0 |
|
58 * @param const TKeyEvent& aKeyEvent, TEventCode aType |
|
59 * @return TKeyResponse If key was consumed. Generally it should be, since the KEF calls the plugins only with the right key. |
|
60 */ |
|
61 virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, |
|
62 TEventCode aType ); |
|
63 |
|
64 /** |
|
65 * Provides the key events that the plugin wants to listen to. |
|
66 * Plugins should overload this method if they are of version 2 or higher. |
|
67 * iCode, iScanCode and iModifiers MUST be defined in each TKeyEvent. |
|
68 * |
|
69 * @since S60 5.1 |
|
70 * @return array of key events |
|
71 */ |
|
72 void ProvideKeyEventsL( RArray<TKeyEvent>& aKeyEventArray ); |
|
73 private: // Constructors |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CHsAppKeyPlugin(); |
|
78 |
|
79 /** |
|
80 * By default Symbian 2nd phase constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 void HandleShortPressL(); |
|
85 |
|
86 void HandleLongPressL(); |
|
87 |
|
88 private: //data |
|
89 /** Cached pointer to the CEikonEnv singelton instance */ |
|
90 CEikonEnv* iEikEnv; |
|
91 TBool iSecondEvent; |
|
92 CHbDeviceDialogSymbian* mDialog; |
|
93 }; |
|
94 |
|
95 #endif // HSAPPKEYPLUGIN_H |
|
96 |
|
97 // End of File |
|
98 |
|
99 |
|
100 |