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