textinput/peninputcommonctrls/inc/peninputbuttons/peninputlongpressbutton.h
branchRCL_3
changeset 12 5e18d8c489d6
equal deleted inserted replaced
11:c8fb4cf7b3ae 12:5e18d8c489d6
       
     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_CAKNFEPCTRLLONGPRESSBUTTON_H
       
    20 #define C_CAKNFEPCTRLLONGPRESSBUTTON_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  *  CAknFepCtrlLongPressButton
       
    33  *
       
    34  *  @lib fepcommonctrls.lib
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class CAknFepCtrlLongPressButton: 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 sent
       
    48      * @param aUnicode A Unicode value to be sent
       
    49      * @return Pointer to created CAknFepCtrlLongPressButton object
       
    50      */
       
    51     IMPORT_C static CAknFepCtrlLongPressButton* 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 sent
       
    66      * @param aUnicode A Unicode value to be sent
       
    67      * @return Pointer to created CAknFepCtrlLongPressButton object
       
    68      */
       
    69     IMPORT_C static CAknFepCtrlLongPressButton* 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 ~CAknFepCtrlLongPressButton();
       
    83 
       
    84     /**
       
    85      * Cancel long press timer
       
    86      *
       
    87      * @since S60 v3.2
       
    88      * @return None
       
    89      */
       
    90     IMPORT_C void CancelTimer();
       
    91 
       
    92 // from base class MAknFepHwrTimerHandler
       
    93     
       
    94     /**
       
    95      * from MAknFepHwrTimerHandler
       
    96      * HandleTimerOut. Handling time out event
       
    97      *
       
    98      * @since S60 v3.2
       
    99      * @param aTimer The timer which sending the request
       
   100      * @return None
       
   101      */                
       
   102     IMPORT_C void HandleTimerOut(const CAknFepTimer* aTimer);
       
   103 
       
   104 protected:
       
   105     
       
   106     /**
       
   107      * C++ constructor.
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @param aUiLayout Ui Layout who contains this control
       
   111      * @param aCtrlId Control Id
       
   112      * @param aEvent An event to be sent
       
   113      * @param aUnicode A Unicode value to be sent     
       
   114      * @return None 
       
   115      */
       
   116     IMPORT_C CAknFepCtrlLongPressButton(CFepUiLayout* aUiLayout, 
       
   117                                      TInt aCtrlId,
       
   118                                      TInt aEvent,
       
   119                                      TInt aUnicode,
       
   120                                      TAknsItemID aNormalID = KAknsIIDQsnFrFunctionButtonNormal,
       
   121                                      TAknsItemID aPressedID = KAknsIIDQsnFrFunctionButtonPressed,
       
   122                                      TAknsItemID aInactiveID = KAknsIIDQsnFrFunctionButtonInactive);
       
   123 
       
   124 // from base class CButtonBase
       
   125 
       
   126     /**
       
   127      * From CButtonBase
       
   128      * Handle button down event. start long press timer        
       
   129      *
       
   130      * @since S60 v3.2
       
   131      * @param aPt Point position
       
   132      * @return The control who handles the event
       
   133      */                
       
   134     IMPORT_C CFepUiBaseCtrl* HandlePointerDownEventL(const TPoint& aPt);
       
   135     
       
   136     /**
       
   137      * From CButtonBase
       
   138      * Handle button up event. cancel the timer
       
   139      *
       
   140      * @since S60 v3.2
       
   141      * @param aPt Point position
       
   142      * @return The control who handles the event
       
   143      */                
       
   144     IMPORT_C CFepUiBaseCtrl* HandlePointerUpEventL(const TPoint& aPt);
       
   145     
       
   146     /**
       
   147      * From CButtonBase
       
   148      * Handle pointer leave event. 
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @param aPoint current pointer position
       
   152      * @return Nothing
       
   153      */
       
   154     IMPORT_C void HandlePointerLeave(const TPoint& aPoint);
       
   155     
       
   156     /**
       
   157      * From CButtonBase
       
   158      * Cancel pointer down event.
       
   159      *
       
   160      * @since S60 v3.2
       
   161      * @param aPoint current pointer position
       
   162      * @return Nothing
       
   163      */
       
   164     IMPORT_C void CancelPointerDownL();
       
   165     
       
   166     /**
       
   167      * Symbian 2nd phase constructor.
       
   168      */
       
   169     IMPORT_C void ConstructL();  
       
   170     
       
   171 private:
       
   172 
       
   173     /**
       
   174      * interval of long press
       
   175      */
       
   176     TTimeIntervalMicroSeconds32 iLongPressInterval;
       
   177 
       
   178     /**
       
   179      * long press timer (Own)
       
   180      */
       
   181     CAknFepTimer* iLongPressTimer;
       
   182     
       
   183     /**
       
   184      * indicates whether long press has occurred
       
   185      */
       
   186     TBool iIsLongPress;
       
   187    
       
   188 };
       
   189 
       
   190 #endif // C_CAKNFEPCTRLLONGPRESSBUTTON_H
       
   191 
       
   192 // End Of File