|
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: Interface of normal button and multidisplay button |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CAKNFEPCTRLREPEATBUTTONEX_H |
|
20 #define C_CAKNFEPCTRLREPEATBUTTONEX_H |
|
21 |
|
22 // system includes |
|
23 #include <AknsConstants.h> |
|
24 #include <peninputlayoutbasecontrol.h> |
|
25 #include <peninputlayoutbutton.h> |
|
26 #include <peninputpluginutils.h> |
|
27 #include <peninputcommonbutton.h> |
|
28 |
|
29 /** |
|
30 * CAknFepCtrlRepeatButtonEx |
|
31 * |
|
32 * @lib fepcommonctrls.lib |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 class CAknFepCtrlRepeatButtonEx: public CAknFepCtrlCommonButton, public MAknFepTimerHandler |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Symbian constructor. |
|
41 * |
|
42 * @since S60 v3.2 |
|
43 * @param aUiLayout The layout |
|
44 * @param aControlId The control id |
|
45 * @param aEvent An event to be repeatedly sent |
|
46 * @param aUnicode A Unicode value to be repeatedly sent |
|
47 * @return Pointer to created CAknFepCtrlRepeatButtonEx object |
|
48 */ |
|
49 static CAknFepCtrlRepeatButtonEx* NewL(CFepUiLayout* aUiLayout, |
|
50 TInt aControlId, |
|
51 TAknsItemID aNormalID, |
|
52 TAknsItemID aPressedID, |
|
53 TAknsItemID aInactiveID, |
|
54 TInt aEvent = 0xFFFF, |
|
55 TInt aUnicode = 0); |
|
56 |
|
57 /** |
|
58 * Symbian constructor. |
|
59 * |
|
60 * @since S60 v3.2 |
|
61 * @param aUiLayout The layout |
|
62 * @param aControlId The control id |
|
63 * @param aEvent An event to be repeatedly sent |
|
64 * @param aUnicode A Unicode value to be repeatedly sent |
|
65 * @return Pointer to created CAknFepCtrlRepeatButtonEx object |
|
66 */ |
|
67 static CAknFepCtrlRepeatButtonEx* NewLC(CFepUiLayout* aUiLayout, |
|
68 TInt aControlId, |
|
69 TAknsItemID aNormalID, |
|
70 TAknsItemID aPressedID, |
|
71 TAknsItemID aInactiveID, |
|
72 TInt aEvent = 0xFFFF, |
|
73 TInt aUnicode = 0); |
|
74 /** |
|
75 * destructor. |
|
76 * |
|
77 * @since S60 v3.2 |
|
78 * @return None |
|
79 */ |
|
80 virtual ~CAknFepCtrlRepeatButtonEx(); |
|
81 |
|
82 /** |
|
83 * Set the repeat interval. |
|
84 * |
|
85 * @since S60 v3.2 |
|
86 * @param aTime Interval in ms. |
|
87 * @return None |
|
88 */ |
|
89 void SetRepeatInterval(const TTimeIntervalMicroSeconds32& aTime); |
|
90 |
|
91 /** |
|
92 * Cancel key sending |
|
93 * |
|
94 * @since S60 v3.2 |
|
95 * @return None |
|
96 */ |
|
97 void CancelRepeat(); |
|
98 |
|
99 /** |
|
100 * Unicode |
|
101 * |
|
102 * @since S60 v3.2 |
|
103 * @return None |
|
104 */ |
|
105 TInt Unicode(); |
|
106 |
|
107 /** |
|
108 * Event |
|
109 * |
|
110 * @since S60 v3.2 |
|
111 * @return None |
|
112 */ |
|
113 TInt Event(); |
|
114 |
|
115 // from base class MAknFepHwrTimerHandler |
|
116 |
|
117 /** |
|
118 * from MAknFepHwrTimerHandler |
|
119 * HandleTimerOut. Handling time out event |
|
120 * |
|
121 * @since S60 v3.2 |
|
122 * @param aTimer The timer which sending the request |
|
123 * @return None |
|
124 */ |
|
125 void HandleTimerOut(const CAknFepTimer* aTimer); |
|
126 |
|
127 protected: |
|
128 |
|
129 /** |
|
130 * C++ constructor. |
|
131 * |
|
132 * @since S60 v3.2 |
|
133 * @param aUiLayout Ui Layout who contains this control |
|
134 * @param aCtrlId Control Id |
|
135 * @param aEvent An event to be repeatedly sent |
|
136 * @param aUnicode A Unicode value to be repeatedly sent |
|
137 * @return None |
|
138 */ |
|
139 CAknFepCtrlRepeatButtonEx(CFepUiLayout* aUiLayout, |
|
140 TInt aCtrlId, |
|
141 TAknsItemID aNormalID, |
|
142 TAknsItemID aPressedID, |
|
143 TAknsItemID aInactiveID, |
|
144 TInt aEvent, |
|
145 TInt aUnicode); |
|
146 |
|
147 // from base class CButtonBase |
|
148 |
|
149 /** |
|
150 * From CButtonBase |
|
151 * Handle button down event. start long press timer |
|
152 * |
|
153 * @since S60 v3.2 |
|
154 * @param aPt Point position |
|
155 * @return The control who handles the event |
|
156 */ |
|
157 CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPt); |
|
158 |
|
159 /** |
|
160 * From CButtonBase |
|
161 * Handle button up event. cancel all timers |
|
162 * |
|
163 * @since S60 v3.2 |
|
164 * @param aPt Point position |
|
165 * @return The control who handles the event |
|
166 */ |
|
167 CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPt); |
|
168 |
|
169 /** |
|
170 * From CButtonBase |
|
171 * Handle pointer levae event. |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 * @param aPoint current pointer position |
|
175 * @return Nothing |
|
176 */ |
|
177 void HandlePointerLeave(const TPoint& aPoint); |
|
178 |
|
179 /** |
|
180 * Symbian 2nd phase constructor. |
|
181 */ |
|
182 void ConstructL(); |
|
183 |
|
184 private: |
|
185 |
|
186 /** |
|
187 * interval of long press |
|
188 */ |
|
189 TTimeIntervalMicroSeconds32 iLongPressInterval; |
|
190 |
|
191 /** |
|
192 * interval of repeat |
|
193 */ |
|
194 TTimeIntervalMicroSeconds32 iRepeatInterval; |
|
195 |
|
196 /** |
|
197 * long press timer (Own) |
|
198 */ |
|
199 CAknFepTimer* iLongPressTimer; |
|
200 |
|
201 /** |
|
202 * repeat timer (Own) |
|
203 */ |
|
204 CAknFepTimer* iRepeatTimer; |
|
205 |
|
206 /** |
|
207 * Event Id |
|
208 */ |
|
209 TInt iEvent; |
|
210 |
|
211 /** |
|
212 * Unicode value |
|
213 */ |
|
214 TInt iUnicode; |
|
215 |
|
216 }; |
|
217 |
|
218 #endif // C_CAKNFEPCTRLREPEATBUTTONEX_H |
|
219 |
|
220 // End Of File |