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