|
1 /* |
|
2 * Copyright (c) 2002-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: Implementation of vkb ui standby state |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // System includes |
|
20 #include <peninputcmd.h> |
|
21 #include <aknfeppeninputenums.h> |
|
22 #include <peninputdataprovider.h> |
|
23 #include <peninputlayoutcontext.h> |
|
24 #include <peninputdataconverter.h> |
|
25 #include <peninputlayoutbasecontrol.h> |
|
26 #include <peninputcommonlayoutglobalenum.h> |
|
27 |
|
28 // User includes |
|
29 #include "peninputgenericvkb.hrh" |
|
30 #include "peninputgenericvkbuistatestandby.h" |
|
31 #include "peninputgenericvkbenum.h" |
|
32 |
|
33 |
|
34 // ======== MEMBER FUNCTIONS ======== |
|
35 |
|
36 // -------------------------------------------------------------------------- |
|
37 // CPeninputUiStateVkbStandby::CPeninputUiStateVkbStandby |
|
38 // (other items were commented in a header) |
|
39 // -------------------------------------------------------------------------- |
|
40 // |
|
41 CPeninputUiStateVkbStandby::CPeninputUiStateVkbStandby( |
|
42 MPeninputUiStateMgr* aUiStateMgr, MPeninputLayoutContext* aContext ) |
|
43 : CPeninputUiStateBase( aUiStateMgr, aContext ) |
|
44 { |
|
45 } |
|
46 |
|
47 // -------------------------------------------------------------------------- |
|
48 // CPeninputUiStateVkbStandby::NewL |
|
49 // (other items were commented in a header) |
|
50 // -------------------------------------------------------------------------- |
|
51 // |
|
52 CPeninputUiStateVkbStandby* CPeninputUiStateVkbStandby::NewL( |
|
53 MPeninputUiStateMgr* aUiStateMgr, MPeninputLayoutContext* aContext ) |
|
54 { |
|
55 CPeninputUiStateVkbStandby* self = |
|
56 new ( ELeave ) CPeninputUiStateVkbStandby( aUiStateMgr, aContext ); |
|
57 CleanupStack::PushL( self ); |
|
58 self->Construct(); |
|
59 CleanupStack::Pop( self ); |
|
60 |
|
61 return self; |
|
62 } |
|
63 |
|
64 // -------------------------------------------------------------------------- |
|
65 // CPeninputUiStateVkbStandby::~CPeninputUiStateVkbStandby |
|
66 // (other items were commented in a header) |
|
67 // -------------------------------------------------------------------------- |
|
68 // |
|
69 CPeninputUiStateVkbStandby::~CPeninputUiStateVkbStandby() |
|
70 { |
|
71 } |
|
72 |
|
73 // -------------------------------------------------------------------------- |
|
74 // CPeninputUiStateVkbStandby::HandleKeyEventL |
|
75 // (other items were commented in a header) |
|
76 // -------------------------------------------------------------------------- |
|
77 // |
|
78 TBool CPeninputUiStateVkbStandby::HandleKeyEventL( |
|
79 const TRawEvent& /*aData*/ ) |
|
80 { |
|
81 return EFalse; |
|
82 } |
|
83 |
|
84 // -------------------------------------------------------------------------- |
|
85 // CPeninputUiStateVkbStandby::HandleControlEvent |
|
86 // (other items were commented in a header) |
|
87 // -------------------------------------------------------------------------- |
|
88 // |
|
89 TBool CPeninputUiStateVkbStandby::HandleControlEvent( TInt aEventType, |
|
90 const TDesC& aEventData ) |
|
91 { |
|
92 switch ( aEventType ) |
|
93 { |
|
94 case EEventVirtualKeyUp: |
|
95 { |
|
96 return HandleVkbEvent( aEventType, aEventData ); |
|
97 } |
|
98 case EPeninputLayoutEventBack: |
|
99 { |
|
100 return HandleBackEvent( aEventType, aEventData ); |
|
101 } |
|
102 |
|
103 case EPeninputLayoutEventLeftArrow: |
|
104 case EPeninputLayoutEventRightArrow: |
|
105 { |
|
106 SendKey( aEventData ); |
|
107 return EFalse; |
|
108 } |
|
109 case EPeninputLayoutEventTab: |
|
110 { |
|
111 return HandleTabEvent( aEventType, aEventData ); |
|
112 } |
|
113 case EPeninputLayoutEventEnter: |
|
114 case EPeninputLayoutEventSpace: |
|
115 { |
|
116 return HandleEnterSpaceEvent( aEventType, aEventData ); |
|
117 } |
|
118 default: |
|
119 return EFalse; |
|
120 } |
|
121 } |
|
122 |
|
123 // -------------------------------------------------------------------------- |
|
124 // CPeninputUiStateVkbStandby::HandleVkbEvent |
|
125 // (other items were commented in a header) |
|
126 // -------------------------------------------------------------------------- |
|
127 // |
|
128 TBool CPeninputUiStateVkbStandby::HandleVkbEvent( TInt /*aEventType*/, |
|
129 const TDesC& aEventData ) |
|
130 { |
|
131 return SendKey( aEventData ); |
|
132 } |
|
133 |
|
134 // -------------------------------------------------------------------------- |
|
135 // CPeninputUiStateVkbStandby::HandleBackEvent |
|
136 // (other items were commented in a header) |
|
137 // -------------------------------------------------------------------------- |
|
138 // |
|
139 TBool CPeninputUiStateVkbStandby::HandleBackEvent( TInt /*aEventType*/, |
|
140 const TDesC& aEventData ) |
|
141 { |
|
142 TInt latchedFlag = CPeninputDataConverter::AnyToInt |
|
143 (iContext->RequestData(EAkninputDataTypeLatchedSet)); |
|
144 if(!latchedFlag) |
|
145 { |
|
146 SendKey( aEventData ); |
|
147 } |
|
148 return EFalse; |
|
149 } |
|
150 |
|
151 // -------------------------------------------------------------------------- |
|
152 // CPeninputUiStateVkbStandby::HandleEnterSpaceEvent |
|
153 // (other items were commented in a header) |
|
154 // -------------------------------------------------------------------------- |
|
155 // |
|
156 TBool CPeninputUiStateVkbStandby::HandleEnterSpaceEvent( |
|
157 TInt /*aEventType*/, const TDesC& aEventData ) |
|
158 { |
|
159 TInt latchedFlag = CPeninputDataConverter::AnyToInt |
|
160 (iContext->RequestData(EAkninputDataTypeLatchedSet)); |
|
161 if(!latchedFlag) |
|
162 { |
|
163 SendKey( aEventData ); |
|
164 } |
|
165 |
|
166 return EFalse; |
|
167 } |
|
168 |
|
169 // -------------------------------------------------------------------------- |
|
170 // CPeninputUiStateVkbStandby::HandleTabEvent |
|
171 // (other items were commented in a header) |
|
172 // -------------------------------------------------------------------------- |
|
173 // |
|
174 TBool CPeninputUiStateVkbStandby::HandleTabEvent( |
|
175 TInt /*aEventType*/, const TDesC& aEventData ) |
|
176 { |
|
177 SendKey( aEventData ); |
|
178 return EFalse; |
|
179 } |
|
180 |