phoneuis/dialer/inc/cdialerkeypadcontainer.h
branchRCL_3
changeset 25 5266b1f337bd
equal deleted inserted replaced
24:41a7f70b3818 25:5266b1f337bd
       
     1 /*
       
     2 * Copyright (c) 2007 - 2010 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:  CDialerKeyPadContainer class provides number keypad fuctionality 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CDIALERKEYPADCONTAINER_H
       
    21 #define CDIALERKEYPADCONTAINER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <coecntrl.h>
       
    25 #include    <coecobs.h>    // MCoeControlObserver
       
    26 #include    <coemain.h>
       
    27 
       
    28 #include    "cdialercontainerbase.h"
       
    29 #include    "cdialerkeypadlabelmanager.h"
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CDialerKeyPadButton;
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38  
       
    39 /**
       
    40 *  CDialerKeyPadContainer container class
       
    41 *
       
    42 *  @lib dialer.lib
       
    43 *  @since S60 v5.0
       
    44 */
       
    45 NONSHARABLE_CLASS(CDialerKeyPadContainer) : public CDialerContainerBase, 
       
    46                                             public MCoeForegroundObserver,
       
    47                                             public MDialerKeyPadLabelManagerCallback
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * Two phase constructor
       
    53         * @param aContainer Parent container
       
    54         * @param aOperatingMode 
       
    55         * @return New instance
       
    56         */
       
    57         static CDialerKeyPadContainer* NewL( 
       
    58             const CCoeControl& aContainer,
       
    59             TDialerOperationMode aOperatingMode
       
    60              );
       
    61         
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         virtual ~CDialerKeyPadContainer();      
       
    66         
       
    67     public:
       
    68         
       
    69         /**
       
    70         * Enables or disables tactile feedback audio for keypad buttons.
       
    71         */
       
    72         
       
    73         void EnableTactileFeedback( const TBool aEnable );
       
    74         
       
    75         // moved from private to public
       
    76         /**
       
    77         * @see CCoeControl
       
    78         */        
       
    79         void MakeVisible( TBool aVisible );
       
    80         
       
    81         /**
       
    82          * Sets the operation mode. New mode takes effect once the
       
    83          * size of the component is reset.
       
    84          * @param   aOperatingMode  New operation mode.
       
    85          */
       
    86         void SetOperationMode( TDialerOperationMode aOperatingMode );
       
    87         
       
    88     private:  // Functions from base classes
       
    89         
       
    90         /**
       
    91         * From CCoeControl
       
    92         */
       
    93         TInt CountComponentControls() const;
       
    94         
       
    95         /**
       
    96         * From CCoeControl
       
    97         */
       
    98         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    99         
       
   100         /**
       
   101          * From CoeControl.
       
   102          */
       
   103         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   104         
       
   105         /**
       
   106         * @see CCoeControl
       
   107         */
       
   108         void HandleResourceChange( TInt aType );   
       
   109         
       
   110         /**
       
   111         * @see MCoeControlObserver
       
   112         */        
       
   113         void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );      
       
   114         
       
   115         /**
       
   116         * @see MCoeForegroundObserver
       
   117         */ 
       
   118         void HandleGainingForeground();
       
   119         
       
   120         /**
       
   121         * @see MCoeForegroundObserver
       
   122         */         
       
   123         void HandleLosingForeground();      
       
   124         
       
   125         /**
       
   126          * @see MDialerKeyPadLabelManagerCallback
       
   127          */
       
   128         void KeyLabelsChanged();
       
   129         
       
   130     private: // From CDialerContainerBase
       
   131     
       
   132         /**
       
   133         * @see CDialerContainerBase
       
   134         */
       
   135         void SetVariety();
       
   136         
       
   137         /**
       
   138         * @see CDialerContainerBase
       
   139         */
       
   140         void SetLayout();
       
   141 
       
   142     private:
       
   143     
       
   144 		CDialerKeyPadContainer( const CCoeControl& aContainer, 
       
   145             TDialerOperationMode aOperatingMode );
       
   146             	
       
   147         /**
       
   148         * 2nd phase constructor.
       
   149         */
       
   150         void ConstructL( );
       
   151 
       
   152         /**
       
   153         * Set layout in Phone Dialer mode
       
   154         */
       
   155         void SetPhoneLayout();
       
   156 
       
   157         /**
       
   158          * Set layout in Easy Dialing mode
       
   159          */
       
   160         void SetEasyDialingLayout();
       
   161         
       
   162         /**
       
   163         * Set layout in Video DTMF mode
       
   164         */
       
   165         void SetVideoLayout();
       
   166         
       
   167         /**
       
   168         * Create keypad buttons.
       
   169         */
       
   170         void CreateButtonsL();
       
   171         
       
   172     private:    // Data
       
   173     
       
   174         TDialerOperationMode iOperatingMode;
       
   175         
       
   176         /**
       
   177          * Keypad buttons.
       
   178          * Owned.
       
   179          */
       
   180         RPointerArray<CDialerKeyPadButton> iButtons;
       
   181         
       
   182         /**
       
   183          * True, when EEventStateChanged event reported. 
       
   184          */
       
   185         TBool iButtonPressedDown;
       
   186         
       
   187         /**
       
   188          * Stores last pointer event. 
       
   189          */
       
   190         TPointerEvent iPointerEvent;
       
   191         
       
   192         /**
       
   193          * Helper to manage keypad button labels
       
   194          */
       
   195         CDialerKeyPadLabelManager* iKeyLabelManager;
       
   196         
       
   197         /**
       
   198          * True if key up event has been simulated in order to cancel
       
   199          * long tap action due to dragging pointer outside of
       
   200          * pressed button.
       
   201          */
       
   202         TBool iKeyUpSimulatedDueToDragging;
       
   203     };
       
   204 
       
   205 #endif      // CDIALERKEYPADCONTAINER_H
       
   206 
       
   207 // End of File