textinput/peninputsplititut/inc/peninputcommonbgctrl.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     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_CAKNFEPCTRLCOMMONBGCTRL_H
       
    20 #define C_CAKNFEPCTRLCOMMONBGCTRL_H
       
    21 
       
    22 // system includes
       
    23 #include <AknsConstants.h>
       
    24 #include <peninputlayoutbasecontrol.h>
       
    25 
       
    26 struct TCommonBgCtrlSubItem
       
    27 	{
       
    28 	TRect iRect;	
       
    29     TAknsItemID iFrameID;
       
    30     TAknsItemID iCenterID;
       
    31     TBool iIsShow;		
       
    32 	};
       
    33 
       
    34 // class declarations
       
    35 /**
       
    36  *  Basic functionality for background display
       
    37  *  It provides creation from Frame ID and can react according to SizeChanged Msg
       
    38  *
       
    39  *  @lib fepcommonctrls.lib
       
    40  *  @since S60 v3.2
       
    41  */
       
    42 class CAknFepCtrlCommonBgCtrl : public CFepUiBaseCtrl
       
    43     {
       
    44 public: 
       
    45         
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      *
       
    49      * @since S60 v3.2
       
    50      * @param aUiLayout An instance of CFepUiLayout
       
    51      * @param aControlId The control id of input range button
       
    52      * @return The pointer point to CAknFepCtrlCommonBgCtrl type object
       
    53      */
       
    54     static CAknFepCtrlCommonBgCtrl* NewL(CFepUiLayout* aUiLayout, 
       
    55     						TInt aControlId,
       
    56     						TAknsItemID aFrameID,
       
    57     						TAknsItemID aCenterID);
       
    58         
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      *
       
    62      * @since S60 v3.2
       
    63      * @param aUiLayout An instance of CFepUiLayout
       
    64      * @param aControlId The control id of input range button
       
    65      * @return The pointer point to CAknFepCtrlCommonBgCtrl type object
       
    66      */
       
    67     static CAknFepCtrlCommonBgCtrl* NewLC(CFepUiLayout* aUiLayout, 
       
    68     						TInt aControlId,
       
    69 							TAknsItemID aFrameID,
       
    70     						TAknsItemID aCenterID);
       
    71     /**
       
    72      * Destructor.
       
    73      *
       
    74      * @since S60 v3.2
       
    75      */
       
    76     virtual ~CAknFepCtrlCommonBgCtrl();
       
    77     
       
    78     /**
       
    79      * This function handles the SizeChanged event, it resizes all images and rects
       
    80      *
       
    81      * @since S60 v3.2
       
    82      * @param aRect New button extent
       
    83      * if only the position of the button changed, no need to reset the images as well
       
    84      * @return Nothing
       
    85      */
       
    86     void SizeChanged(const TRect& aRect);
       
    87 	
       
    88 	/**
       
    89      * Check whether this control contains the point
       
    90      *
       
    91      * @since S60 V4.0
       
    92      * @param aPoint The point to be checked
       
    93      * @return ETrue if control valid region contains the point, otherwise EFalse
       
    94      */
       
    95     virtual TBool Contains(const TPoint& aPt);
       
    96 	
       
    97 	/**
       
    98      * Redraw the defined area of background
       
    99      *
       
   100      * @since S60 V4.0
       
   101      * @param aPoint The point to be checked
       
   102      * @return ETrue if control valid region contains the point, otherwise EFalse
       
   103      */	
       
   104 	virtual void ReDrawRect(const TRect& aRect);
       
   105 		
       
   106 	/**
       
   107      * Add sub background item
       
   108      *
       
   109      * @since S60 V4.0
       
   110      * @param aSubItem sub background which will show above the background
       
   111      * @return None
       
   112      */		
       
   113     void AddSubBgItemL( const TCommonBgCtrlSubItem& aSubItem );
       
   114     
       
   115 	/**
       
   116      * Show sub background item
       
   117      *
       
   118      * @since S60 V4.0
       
   119      * @param aIndex item index
       
   120      * @param aShow  is show or hide
       
   121      * @return None
       
   122      */		
       
   123     void ShowSubBgItem( TInt aIndex, TBool aShow );
       
   124     
       
   125 	/**
       
   126      * get sub background item
       
   127      *
       
   128      * @since S60 V4.0
       
   129      * @param aIndex item index
       
   130      * @return sut item
       
   131      */		
       
   132     TCommonBgCtrlSubItem& GetSubBgItem( TInt aIndex );
       
   133     
       
   134     /**
       
   135      * Draws UI
       
   136      *
       
   137      * @since S60 v3.2
       
   138      * @return None
       
   139      */
       
   140     void Draw();
       
   141 	
       
   142 	/**
       
   143      * Set Frame ID
       
   144      *
       
   145      * @since S60 v3.2
       
   146      * @param aFrameID   The frame ID
       
   147      * @param aCenterID  Center bitmap ID
       
   148      * @return None
       
   149      */
       
   150 	void SetFrameID( TAknsItemID aFrameID, TAknsItemID aCenterID );
       
   151 	
       
   152 protected:
       
   153     /**
       
   154      * C++ default constructor.
       
   155      *
       
   156      * @since S60 v3.2
       
   157      * @param aUiLayout An instance of CFepUiLayout
       
   158      * @param aControlId The control id of input range button
       
   159      * @param aFrameID   The frame ID
       
   160      * @param aCenterID  Center bitmap ID
       
   161      */
       
   162     CAknFepCtrlCommonBgCtrl(CFepUiLayout* aUiLayout, 
       
   163     						TInt aControlId,
       
   164     						TAknsItemID aFrameID,
       
   165     						TAknsItemID aCenterID);
       
   166    
       
   167     /**
       
   168      * draw frame
       
   169      *
       
   170      * @since S60 v3.2
       
   171      * @param aGc
       
   172      * @param aRect The control rect
       
   173      * @param aFrameID   The frame ID
       
   174      * @param aCenterID  Center bitmap ID
       
   175      */
       
   176     void DrawFrame( CFbsBitGc* aGc, 
       
   177     				const TRect& aRect,
       
   178     				TAknsItemID aFrameID, 
       
   179     				TAknsItemID aCenterID );
       
   180 private: 
       
   181     /**
       
   182      * The img ID of frame
       
   183      */
       
   184     TAknsItemID iFrameID;
       
   185     TAknsItemID iCenterID;
       
   186     
       
   187     /**
       
   188      * The sub items of the background 
       
   189      */
       
   190     RArray<TCommonBgCtrlSubItem> iSubItems;
       
   191     };    
       
   192 
       
   193 #endif // C_CAKNFEPCTRLCOMMONBGCTRL_H
       
   194             
       
   195 // End Of File