textinput/peninputcommonctrls/inc/peninputbuttons/peninputbutton.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     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_CAKNFEPCTRLBUTTON_H
       
    20 #define C_CAKNFEPCTRLBUTTON_H
       
    21 
       
    22 // system includes
       
    23 #include <peninputlayoutbasecontrol.h>
       
    24 #include <peninputlayoutbutton.h>
       
    25 
       
    26 // forward declarations
       
    27 class TResourceReader;
       
    28 
       
    29 // class declarations
       
    30 /**
       
    31  *  Basic functionality for graphic buttons
       
    32  *  It provides creation from resource and can react according to SizeChanged Msg
       
    33  *
       
    34  *  @lib fepcommonctrls.lib
       
    35  *  @since S60 v3.2
       
    36  */
       
    37 class CAknFepCtrlButton : public CButtonBase
       
    38     {
       
    39 public: 
       
    40         
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      *
       
    44      * @since S60 v3.2
       
    45      * @param aUiLayout An instance of CFepUiLayout
       
    46      * @param aControlId The control id of input range button
       
    47      * @return The pointer point to CAknFepCtrlButton type object
       
    48      */
       
    49     IMPORT_C static CAknFepCtrlButton* NewL(CFepUiLayout* aUiLayout, TInt aControlId);
       
    50         
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @param aUiLayout An instance of CFepUiLayout
       
    56      * @param aControlId The control id of input range button
       
    57      * @return The pointer point to CAknFepCtrlButton type object
       
    58      */
       
    59     IMPORT_C static CAknFepCtrlButton* NewLC(CFepUiLayout* aUiLayout, TInt aControlId);
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      *
       
    64      * @since S60 v3.2
       
    65      */
       
    66     IMPORT_C virtual ~CAknFepCtrlButton();
       
    67 
       
    68     /**
       
    69      * This function creates the input range button from resource.
       
    70      *
       
    71      * @since S60 v3.2
       
    72      * @param aReader A Reader which is created against the AKN_FEP_BUTTON resource type
       
    73      * @return None
       
    74      */
       
    75     IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
       
    76     
       
    77     /**
       
    78      * This function creates the input range button from resource,
       
    79      * before calling this function, caller should set resource id of 
       
    80      * range button first
       
    81      * 
       
    82      * @since S60 v3.2
       
    83      * @return None
       
    84      */
       
    85     IMPORT_C void ConstructFromResourceL();
       
    86 
       
    87     /**
       
    88      * This function handles the SizeChanged event, it resizes all images and rects
       
    89      *
       
    90      * @since S60 v3.2
       
    91      * @param aRect New button extent
       
    92      * @param aIsReloadImages Whether resize images as well, 
       
    93      * if only the position of the button changed, no need to reset the images as well
       
    94      * @return Nothing
       
    95      */
       
    96     IMPORT_C void SizeChanged(TRect aRect, TBool aIsReloadImages = EFalse);
       
    97 
       
    98     /**
       
    99      * Draws UI
       
   100      *
       
   101      * @since S60 v3.2
       
   102      * @return None
       
   103      */
       
   104     IMPORT_C void Draw();
       
   105 
       
   106     /**
       
   107      * Set active for this button
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @param aActiveFlag active the button or desactive it
       
   111      * @return None
       
   112      */
       
   113     IMPORT_C void SetActive(TBool aActiveFlag);
       
   114 
       
   115     /**
       
   116      * Set high light for the button
       
   117      *
       
   118      * @since S60 v3.2
       
   119      * @param aIsHighlight highlight the button or cancel high light it
       
   120      * @return None
       
   121      */
       
   122     IMPORT_C void SetHighlight(TBool aIsHighlight);
       
   123     
       
   124      /**
       
   125      * From CFepUiBaseCtrl
       
   126      * Handle pointer levae event. 
       
   127      * This will be called only when it's got pointer down event before and 
       
   128      * now pointer leaves without pointer up event
       
   129      *
       
   130      * @since S60 V4.0
       
   131      * @param aPoint current pointer position
       
   132      */
       
   133     virtual void HandlePointerLeave(const TPoint& aPoint);        
       
   134 
       
   135 protected:
       
   136 
       
   137     /**
       
   138      * C++ default constructor.
       
   139      *
       
   140      * @since S60 v3.2
       
   141      * @param aUiLayout An instance of CFepUiLayout
       
   142      * @param aControlId The control id of input range button
       
   143      */
       
   144     IMPORT_C CAknFepCtrlButton(CFepUiLayout* aUiLayout, TInt aControlId);
       
   145     
       
   146     void ResizeBitmaps(TSize aSize);
       
   147     
       
   148 protected:
       
   149 
       
   150     /**
       
   151      * The first time construct flag of button
       
   152      */
       
   153     TBool iFirstTimeConstruct;
       
   154 
       
   155 private:
       
   156 
       
   157     /**
       
   158      * Array of background bmp (not own)
       
   159      */
       
   160     RPointerArray<CFbsBitmap> iBmpList;
       
   161     
       
   162     /**
       
   163      * Array of background mask bmp (not own)
       
   164      */
       
   165     RPointerArray<CFbsBitmap> iMaskBmpList;
       
   166 
       
   167     /**
       
   168      * The highlight flag of the button
       
   169      */
       
   170     TBool iHighlight;
       
   171     };    
       
   172 
       
   173 #endif // C_CAKNFEPCTRLBUTTON_H
       
   174             
       
   175 // End Of File