phoneapp/phoneuiview/inc/cphonedialercontroller.h
branchRCL_3
changeset 62 5266b1f337bd
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
       
     1 /*
       
     2 * Copyright (c) 2009, 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:  Handles the updating dialer, toolbar buttons.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONEDIALERCONTROLLER_H
       
    20 #define CPHONEDIALERCONTROLLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mphonedialercontroller.h"
       
    24 #include "mphonenumberentrychangedhandler.h"
       
    25 
       
    26 class CPhoneBubbleWrapper;
       
    27 class CCoeEnv;
       
    28 class MAknsSkinInstance;
       
    29 class TPhoneCommandParam;
       
    30 class CPhoneEasyDialingController;
       
    31 
       
    32 /**
       
    33  *  Dialer controller, provides toolbar button data for the normal mode dialer
       
    34  *
       
    35  *  @lib PhoneUIView.lib
       
    36  *  @since S60 v5.0
       
    37  */
       
    38 class CPhoneDialerController : 
       
    39     public CBase,
       
    40     public MPhoneDialerController
       
    41     {
       
    42 public: // constructor and destructor
       
    43     /**
       
    44      * Two-phased constructor.
       
    45      * @param aBubbleWrapper    Handle to bubble wrapper. Ownership not transferred.
       
    46      *                          May be NULL, but then emergency call state can't be identified
       
    47      * @param aCoeEnv           Handle to coeenv. Ownership not transferred.
       
    48      */
       
    49     static CPhoneDialerController* NewL( CPhoneBubbleWrapper* aBubbleWrapper,
       
    50                                          CCoeEnv& aCoeEnv );
       
    51     /**
       
    52      * Destructor.
       
    53      */
       
    54     IMPORT_C virtual ~CPhoneDialerController();
       
    55     
       
    56 protected: // constructors
       
    57     
       
    58     /**
       
    59      * Constructor.
       
    60      * 
       
    61      * @param aBubbleWrapper 
       
    62      * @param aCoeEnv 
       
    63      */
       
    64     IMPORT_C CPhoneDialerController( CPhoneBubbleWrapper* aBubbleWrapper,
       
    65                                      CCoeEnv& aCoeEnv );
       
    66     /**
       
    67      * Symbian 2nd phase constructor.
       
    68      * 
       
    69      */
       
    70     IMPORT_C void ConstructL();
       
    71     
       
    72 public: // new methods
       
    73     
       
    74     /**
       
    75      * Sets state of restricted dialer.
       
    76      *
       
    77      * @since S60 v5.0
       
    78      * @param aRestricted
       
    79      */      
       
    80     void SetRestrictedDialer( TBool aRestricted );    
       
    81     
       
    82      /**
       
    83      * Sets state of service code flag.
       
    84      *
       
    85      * @since S60 v5.0
       
    86      * @param aCommandParam
       
    87      */
       
    88     void SetServiceCodeFlag( TPhoneCommandParam* aCommandParam );
       
    89 
       
    90     /**
       
    91      * Sets handle to the Easy Dialing controller.
       
    92      * 
       
    93      * @since S60 v5.2
       
    94      * @param aController   Easy Dialing controller. Ownership not transferred.
       
    95      */
       
    96     void SetEasyDialingController( CPhoneEasyDialingController* aController );
       
    97     
       
    98 public: // From MPhoneDialerController
       
    99 
       
   100     /**
       
   101      * @see MPhoneDialerController
       
   102      */
       
   103     IMPORT_C TInt CbaResourceId() const;
       
   104 
       
   105     /**
       
   106      * @see MPhoneDialerController
       
   107      */
       
   108     IMPORT_C TInt MenuResourceId() const;
       
   109 
       
   110     /**
       
   111      * @see MPhoneDialerController
       
   112      */
       
   113     IMPORT_C const TDesC& NumberEntryPromptTextL();
       
   114 
       
   115     /**
       
   116      * @see MPhoneDialerController
       
   117      */
       
   118 
       
   119     /**
       
   120      * @see MPhoneDialerController
       
   121      */
       
   122     IMPORT_C TInt GetButtonData( TButtonIndex aIndex, RPointerArray<CButtonData>& aData ) const;
       
   123     
       
   124     /**
       
   125      * @see MPhoneDialerController
       
   126      */
       
   127     IMPORT_C void SetNumberEntryIsEmpty( TBool aEmpty );
       
   128     
       
   129     /**
       
   130      * @see MPhoneDialerController
       
   131      */
       
   132     IMPORT_C TInt ButtonState( TButtonIndex aIndex ) const;
       
   133     
       
   134     /**
       
   135      * @see MPhoneDialerController
       
   136      */
       
   137     IMPORT_C TBool ButtonDimmed( TButtonIndex aIndex ) const;
       
   138     
       
   139     /**
       
   140      * @see MPhoneDialerController
       
   141      */
       
   142     IMPORT_C TBool EasyDialingAllowed() const;
       
   143 
       
   144 public: // data types
       
   145     /** 
       
   146      * Initialization data for one toolbar button state.
       
   147      */
       
   148     struct TLocalButtonData
       
   149         {
       
   150         TInt iCommandId;
       
   151         TInt iSkinItemIdMinor;
       
   152         TInt iBitmapIndex;
       
   153         TInt iBitmapMaskIndex;
       
   154         TInt iTooltipResourceId;
       
   155         };
       
   156     
       
   157 protected: // methods
       
   158     
       
   159     /**
       
   160      * Check is there an emergency call ongoing.
       
   161      * @return  ETrue   if there's an active emergency call.
       
   162      *          EFalse  otherwise.
       
   163      */
       
   164     TBool EmergencyCallActive() const;
       
   165     
       
   166     /**
       
   167      * Check if Easy Dialing contact listbox is in focus.
       
   168      * @return  ETrue   if contact list is in focus
       
   169      *          EFalse  otherwise (may be also because there's no ED
       
   170      *                  present in the device)
       
   171      */
       
   172     TBool EasyDialingFocused() const;
       
   173     
       
   174     /**
       
   175      * Create button data object from given source data.
       
   176      * @param   aSourceData Defines, where the data should be loaded.
       
   177      * @param   aSkin       Skin instance. Ownership not transferred.
       
   178      * @param   aMifFile    Full path to the MIF file holding the fallback graphics.
       
   179      * @return  New CButtonData instance. Ownership is transferred.
       
   180      */
       
   181     CButtonData* CreateButtonDataL( const TLocalButtonData& aSourceData, 
       
   182             MAknsSkinInstance* aSkin, const TDesC& aMifFile ) const;
       
   183     
       
   184 protected: // data
       
   185     /**
       
   186      * CoeEnv 
       
   187      */
       
   188     CCoeEnv& iCoeEnv;
       
   189     
       
   190     /**
       
   191      * Handle to the Bubblewrapper. May be NULL. Not owned.
       
   192      */
       
   193     CPhoneBubbleWrapper* iBubbleWrapper;
       
   194     
       
   195     /**
       
   196      * Handle to Easy Dialing controller. May be NULL. Not owned. 
       
   197      */
       
   198     CPhoneEasyDialingController* iEasyDialingController;
       
   199     
       
   200     /**
       
   201      * Used to check is the Dialer in the restricted mode.
       
   202      */
       
   203     TBool iRestrictedDialer;
       
   204     
       
   205     /**
       
   206      * Used to check is the service code flag set, meaning that number entry
       
   207      * contains a service code rather than phone number.
       
   208      */
       
   209     TBool iServiceCodeFlag;
       
   210     
       
   211     /**
       
   212      * Store availability of phone number (etc) in the number entry.
       
   213      */
       
   214     TBool iNumberAvailable;
       
   215     };
       
   216 
       
   217 #endif // CPHONEDIALERCONTROLLER_H