114
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 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: Numeric key forwarding handler for Active Idle WS Plug-in.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_AIWSPLUGIN_NUMERICKEYHANDLER_H
|
|
20 |
#define C_AIWSPLUGIN_NUMERICKEYHANDLER_H
|
|
21 |
|
|
22 |
#include "eventhandler.h"
|
|
23 |
#include <cenrepnotifyhandler.h>
|
|
24 |
#include <PtiDefs.h>
|
|
25 |
|
|
26 |
class MAnimGeneralFunctionsWindowExtension;
|
|
27 |
class MAiPSPropertyObserver;
|
|
28 |
|
|
29 |
namespace AiWsPlugin {
|
|
30 |
|
|
31 |
class MUiState;
|
|
32 |
|
|
33 |
/**
|
|
34 |
* @ingroup group_wsplugin
|
|
35 |
*
|
|
36 |
* Numeric key forwarding handler for Active Idle WS Plug-in.
|
|
37 |
*
|
|
38 |
* Monitors and forwards numeric key presses that should be handled by Phone
|
|
39 |
* application.
|
|
40 |
*
|
|
41 |
* @since S60 3.2
|
|
42 |
*/
|
|
43 |
class CNumericKeyHandler :
|
|
44 |
public CEventHandler,
|
|
45 |
private MCenRepNotifyHandlerCallback
|
|
46 |
{
|
|
47 |
public:
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Creates a new instance of this class.
|
|
51 |
*
|
|
52 |
* @param aTargetWgId Window Group id of the target application where
|
|
53 |
* numeric key events are forwarded.
|
|
54 |
* @return A new object of this class. The returned object is left on the
|
|
55 |
* cleanup stack.
|
|
56 |
*/
|
|
57 |
static CNumericKeyHandler* NewLC
|
|
58 |
( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt );
|
|
59 |
|
|
60 |
~CNumericKeyHandler();
|
|
61 |
|
|
62 |
private:
|
|
63 |
// from base class CEventHandler
|
|
64 |
void SetUiStateQuery( MUiState& aUiState );
|
|
65 |
|
|
66 |
void FocusChanged( TBool aState );
|
|
67 |
|
|
68 |
TBool OfferRawEvent(const TRawEvent& aRawEvent);
|
|
69 |
|
|
70 |
// new methods
|
|
71 |
CNumericKeyHandler
|
|
72 |
( TInt aTargetWgId, MAnimGeneralFunctionsWindowExtension* aWindowExt );
|
|
73 |
|
|
74 |
void ConstructL();
|
|
75 |
|
|
76 |
TBool CheckPostToTarget( const TRawEvent& aRawEvent ) const;
|
|
77 |
|
|
78 |
void LoadInputLanguageKeyBindings( TInt aLanguage );
|
|
79 |
|
|
80 |
static TInt HandleQwertyModeChanged( TAny *aPtr );
|
|
81 |
|
|
82 |
TInt HandleInputLanguageChanged( TInt aNewValue );
|
|
83 |
|
|
84 |
void SetQwertyMode( TInt aValue );
|
|
85 |
|
|
86 |
void SetInputLanguage( TInt aValue );
|
|
87 |
|
|
88 |
TBool AllowAlphaNumericMode() const;
|
|
89 |
|
|
90 |
TBool VoIPSupported() const;
|
|
91 |
|
|
92 |
TBool EasyDialingEnabled() const;
|
|
93 |
|
|
94 |
// from base class MCenRepNotifyHandlerCallback
|
|
95 |
|
|
96 |
void HandleNotifyGeneric(TUint32 aKey);
|
|
97 |
|
|
98 |
void HandleNotifyError(TUint32 aKey, TInt aError, CCenRepNotifyHandler* aHandler);
|
|
99 |
|
|
100 |
private: // data
|
|
101 |
|
|
102 |
/// Target window group id
|
|
103 |
TInt iTargetWgId;
|
|
104 |
|
|
105 |
/// Anim extension. Not own.
|
|
106 |
MAnimGeneralFunctionsWindowExtension* iWindowExt;
|
|
107 |
|
|
108 |
/// Pointer ot state. Not own.
|
|
109 |
MUiState* iUiState;
|
|
110 |
|
|
111 |
/// Qwerty ps observer. Owned.
|
|
112 |
MAiPSPropertyObserver* iQwertyObserver;
|
|
113 |
|
|
114 |
/// Input language observer. Owned.
|
|
115 |
CCenRepNotifyHandler* iInputLanguageObserver;
|
|
116 |
|
|
117 |
/// Input language repository. Owned.
|
|
118 |
CRepository* iInputLanguageRepository;
|
|
119 |
|
|
120 |
/// Numeric keys array.
|
|
121 |
RArray<TPtiNumericKeyBinding> iNumericKeys;
|
|
122 |
|
|
123 |
/// Qwerty mode indicator.
|
|
124 |
TInt iQwertyMode;
|
|
125 |
|
|
126 |
/// Input language indicator.
|
|
127 |
TInt iInputLanguage;
|
|
128 |
|
|
129 |
private:
|
|
130 |
// friend classes
|
|
131 |
|
|
132 |
#ifdef _AIWSPLUGIN_UNIT_TEST
|
|
133 |
friend class UT_NumericKeyHandler;
|
|
134 |
#endif
|
|
135 |
};
|
|
136 |
|
|
137 |
} // namespace AiWsPlugin
|
|
138 |
|
|
139 |
|
|
140 |
#endif // C_AIWSPLUGIN_KEYLOCKHANDLER_H
|