phoneapp/phoneuicontrol/inc/cphonestate.h
changeset 0 5f000ab63145
child 9 8871b09be73b
child 21 92ab7f8d0eab
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2005-2008 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:
       
    15 *     A base class for an object implementing the state.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPHONESTATE_H
       
    21 #define CPHONESTATE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <w32std.h>
       
    25 #include <remconcoreapitargetobserver.h>
       
    26 #include <MProfileEngine.h>
       
    27 #include <bmbubblemanager.h>
       
    28 
       
    29 #include "mphonestate.h"
       
    30 #include "mphoneviewcommandhandle.h"
       
    31 #include "cphonecbamanager.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class MPhoneState;
       
    35 class MPhoneStateMachine;
       
    36 class CPhoneCallHeaderManager;
       
    37 class CPhoneTimer;
       
    38 class TPhoneCmdParamCallHeaderData;
       
    39 class MPhoneCustomization;
       
    40 class CPhoneNumberEntryManager;
       
    41 
       
    42 enum TStateTransEffectType
       
    43     {
       
    44     ENoneType,
       
    45     ENumberEntryOpen,
       
    46     ENumberEntryClose,
       
    47     ENumberEntryCreate
       
    48     };
       
    49 
       
    50 // CLASS DECLARATION
       
    51 
       
    52 /**
       
    53 *  An abstract class for an object implementing the state.
       
    54 *
       
    55 */
       
    56 class CPhoneState :
       
    57     public CBase,
       
    58     public MPhoneState
       
    59     {
       
    60     public:
       
    61 
       
    62         /**
       
    63         * Constructor
       
    64         */
       
    65         IMPORT_C CPhoneState(
       
    66             MPhoneStateMachine* aStateMachine,
       
    67             MPhoneViewCommandHandle* aViewCommandHandle,
       
    68             MPhoneCustomization* aCustomization);
       
    69 
       
    70         /**
       
    71         * Creates CbaManager instance.
       
    72         */
       
    73         IMPORT_C void BaseConstructL();
       
    74 
       
    75         /**
       
    76         * Destructor.
       
    77         */
       
    78         IMPORT_C virtual ~CPhoneState();
       
    79 
       
    80         /**
       
    81         * A message handling function for Phone Engine messages
       
    82         * @param aMessage Message from Phone Engine
       
    83         * @param aCallId Call id the message concerns
       
    84         */
       
    85         IMPORT_C virtual void HandlePhoneEngineMessageL(
       
    86             const TInt aMessage,
       
    87             TInt aCallId );
       
    88 
       
    89         /**
       
    90         * HandleError
       
    91         * Implements error handling framework
       
    92         * @param aErrorInfo: the error info
       
    93         */
       
    94         IMPORT_C virtual void HandleErrorL(
       
    95             const TPEErrorInfo& aErrorInfo );
       
    96 
       
    97         /**
       
    98         * Handle processed (short, long) key messages from the key event
       
    99         * handler
       
   100         * @param aMessage a key message
       
   101         * @param aCode key event code
       
   102         */
       
   103         IMPORT_C virtual void HandleKeyMessageL(
       
   104             TPhoneKeyEventMessages aMessage,
       
   105             TKeyCode aCode );
       
   106 
       
   107         /**
       
   108         * Handles raw key events from the key event handler
       
   109         * @param aKeyEvent a key event
       
   110         * @param aEventCode key event code
       
   111         */
       
   112         IMPORT_C virtual void HandleKeyEventL(
       
   113             const TKeyEvent& aKeyEvent,
       
   114             TEventCode aEventCode );
       
   115 
       
   116         /**
       
   117         * Handles key press duration events from the key event handler
       
   118         * @param aCode key event code
       
   119         * @param aKeyPressDuration key press duration
       
   120         */
       
   121         IMPORT_C virtual void HandleKeyPressDurationL(
       
   122             TKeyCode aCode,
       
   123             TTimeIntervalMicroSeconds aKeyPressDuration );
       
   124 
       
   125         /**
       
   126         * From CAknAppUi, initialise a menupane (dynamic).
       
   127         *
       
   128         * @param aResourceId It is the resource id for the pane.
       
   129         * @param aMenuPane It is the menu pane corresponding to the resource.
       
   130         */
       
   131         IMPORT_C virtual void DynInitMenuPaneL(
       
   132             TInt aResourceId,
       
   133             CEikMenuPane* aMenuPane );
       
   134 
       
   135         /**
       
   136         * From CAknAppUi, initialise a menubar (dynamic).
       
   137         *
       
   138         * @param aResourceId It is the resource id for the bar.
       
   139         * @param aMenuBar It is the menu bar corresponding to the resource.
       
   140         */
       
   141         IMPORT_C virtual void DynInitMenuBarL(
       
   142             TInt aResourceId,
       
   143             CEikMenuBar* aMenuBar );
       
   144 
       
   145         /**
       
   146         * From CEikAppUi. For Idle indicator
       
   147         */
       
   148         IMPORT_C virtual void HandleSystemEventL(
       
   149             const TWsEvent& aEvent );
       
   150 
       
   151         /**
       
   152         * From CAknAppUi, indicates when app ui is on the foreground.
       
   153         * @param aForeground It is true if app is on the foreground.
       
   154         */
       
   155         IMPORT_C virtual void HandleForegroundEventL( TBool aForeground );
       
   156 
       
   157         /**
       
   158         * Indicates when the Phone app is in the foreground.
       
   159         */
       
   160         IMPORT_C virtual void HandlePhoneForegroundEventL();
       
   161 
       
   162         /**
       
   163         * Indicates when the Phone app is losing focus.
       
   164         */
       
   165         IMPORT_C virtual void HandlePhoneFocusLostEventL();
       
   166 
       
   167         /**
       
   168         * Indicates when the Idle app is in the foreground.
       
   169         */
       
   170         IMPORT_C virtual void HandleIdleForegroundEventL();
       
   171 
       
   172         /**
       
   173         * Indicates when the keylock events
       
   174         */
       
   175         IMPORT_C virtual void HandleKeyLockEnabled( TBool aKeylockEnabled );
       
   176         
       
   177         /**
       
   178         * Handle environment changes.
       
   179         * @param aChanges environment changes which may be reported by
       
   180         *  a change notifier through the RChangeNotifier interface.
       
   181         */
       
   182         IMPORT_C void HandleEnvironmentChangeL( const TInt aChanges );
       
   183 
       
   184         /**
       
   185         * Handles startup of the phone application
       
   186         */
       
   187         IMPORT_C virtual void HandlePhoneStartupL();
       
   188 
       
   189         /**
       
   190         * This function is called when there is property value change.
       
   191         * @param aCategory Category of the property
       
   192         * @param aKey Property key that is changed
       
   193         * @param aValue New property value
       
   194         */
       
   195         IMPORT_C virtual void HandlePropertyChangedL(
       
   196             const TUid& aCategory,
       
   197             const TUint aKey,
       
   198             const TInt aValue );
       
   199 
       
   200         /**
       
   201         * Handle the change of the setting from Central Repository
       
   202         * @param aUid identifing the central repository UID.
       
   203         * @param aId central repository ID.
       
   204         */
       
   205         IMPORT_C virtual void HandleCenRepChangeL(
       
   206             const TUid& aUid,
       
   207             const TUint aId );
       
   208 
       
   209         /**
       
   210         * Handles commands.
       
   211         * @param aCommand It is the code of the command to be handled.
       
   212         * @returns boolean value was the command handled by the state
       
   213         *          (ETrue) or not (EFalse)
       
   214         */
       
   215         IMPORT_C virtual TBool HandleCommandL( TInt aCommand );
       
   216 
       
   217         /**
       
   218         * Processes command.
       
   219         * @param aCommand It is the code of the command to be handled.
       
   220         * @returns boolean value was the command handled by the state
       
   221         *          (ETrue) or not (EFalse)
       
   222         */
       
   223         IMPORT_C virtual TBool ProcessCommandL( TInt aCommand );
       
   224 
       
   225         /**
       
   226         * Handles commands from the Remote Control framework.
       
   227         * @param aOperationId The operation ID of the command.
       
   228         * @param aButtonAct The button action associated with the command.
       
   229         * @return ETrue if the event was handled, EFalse otherwise.
       
   230         */
       
   231         IMPORT_C virtual TBool HandleRemConCommandL(
       
   232             TRemConCoreApiOperationId aOperationId,
       
   233             TRemConCoreApiButtonAction aButtonAct);
       
   234 
       
   235         /**
       
   236         * Setter for divert indication showing in bubble.
       
   237         * @param aDivertIndication ETrue to show divert indication,
       
   238         *          EFalse to not. Usually setting EFalse isn't necessary
       
   239         *         as it's a default value in bubble creation.
       
   240         */
       
   241         IMPORT_C virtual void SetDivertIndication(
       
   242             const TBool aDivertIndication );
       
   243 
       
   244         /**
       
   245         * Handles Long hash key press
       
   246         */
       
   247         IMPORT_C void HandleLongHashL();
       
   248 
       
   249         /**
       
   250         * Informs view to start Transition effect
       
   251         * @param aType a transition effect, default none
       
   252         * EndTransEffect() must be called when update is done.
       
   253         */
       
   254         IMPORT_C void BeginTransEffectLC( TStateTransEffectType aType = ENoneType );
       
   255 
       
   256         /**
       
   257         * Informs view to complete Transition effect
       
   258         */
       
   259         IMPORT_C void EndTransEffect();
       
   260 
       
   261         /**
       
   262         * Checks whether customized dialer view is active,
       
   263         * @return ETrue if customized dialer is active
       
   264         */
       
   265         IMPORT_C TBool IsCustomizedDialerVisibleL() const;
       
   266 
       
   267         /**
       
   268         * Closes customized dialer view
       
   269         */
       
   270         IMPORT_C void CloseCustomizedDialerL();
       
   271 
       
   272         /**
       
   273          * Plays DTMF tone for key event
       
   274          * */
       
   275         IMPORT_C void HandleDtmfKeyToneL( const TKeyEvent& aKeyEvent,
       
   276                 TEventCode aEventCode );
       
   277 
       
   278         /**
       
   279         * Show global InfoNote
       
   280         * @param aResourceId resource id to be resolved
       
   281         */
       
   282         IMPORT_C void SendGlobalInfoNoteL( TInt aResourceId );
       
   283 
       
   284         /**
       
   285         * Show global ErrorNote
       
   286         * @param aResourceId resource id to be resolved
       
   287         */
       
   288         IMPORT_C void SendGlobalErrorNoteL( TInt aResourceId );
       
   289 
       
   290         /**
       
   291          * Get blocked key list
       
   292          * @returns RArray<TInt>& lsit of blocked keys 
       
   293          */
       
   294         IMPORT_C const RArray<TInt>& GetBlockedKeyList() const;
       
   295 
       
   296         /**
       
   297          * Disable HW Keys if needed
       
   298          */
       
   299         IMPORT_C void DisableHWKeysL();
       
   300 
       
   301         /**
       
   302          * Disable Call UI
       
   303          */
       
   304         IMPORT_C void DisableCallUIL();
       
   305 
       
   306         /**
       
   307          * Enable Call UI
       
   308          */
       
   309         IMPORT_C void EnableCallUIL();
       
   310 
       
   311         /**
       
   312          * Disable HW Keys and Call UI if needed
       
   313          */
       
   314         IMPORT_C void CheckDisableHWKeysAndCallUIL();
       
   315 
       
   316         /**
       
   317          * Handle hold switch key event when there is an incoming or waiting call
       
   318          */
       
   319         IMPORT_C void HandleHoldSwitchL();
       
   320         
       
   321         /**
       
   322          * Enable HW Keys and Call UI if needed
       
   323          */
       
   324         IMPORT_C void CheckEnableHWKeysAndCallUIL();
       
   325         
       
   326         /**
       
   327         * Fetches autolock information - is it set on or not
       
   328         * @return is autolock set on (ETrue) or off (EFalse)
       
   329         */
       
   330         IMPORT_C TBool IsAutoLockOn() const;
       
   331 
       
   332         /**
       
   333         * Return is sim state ok
       
   334         * @return ETrue if is sim ok, otherwise EFalse
       
   335         **/
       
   336         IMPORT_C TBool IsSimOk();
       
   337 
       
   338         /**
       
   339         * Checks Svivel state.
       
   340         * @return ETrue if swivel is closed.
       
   341         */
       
   342         IMPORT_C TBool IsSwivelClosed() const;
       
   343 
       
   344         /**
       
   345         * Check if note, query or blockingDialog is visible
       
   346         * @return boolean value indicating that note, query or
       
   347         * blocking dialog is visible
       
   348         */
       
   349         IMPORT_C TBool IsAnyQueryActiveL();
       
   350 
       
   351         /**
       
   352         * Check if menu bar is visible
       
   353         * @return boolean value indicating that menu bar is visible
       
   354         */
       
   355         IMPORT_C TBool IsMenuBarVisibleL() const;
       
   356 
       
   357         /**
       
   358          * Sets context menu to correspond the incall options menu
       
   359          *
       
   360          */
       
   361         IMPORT_C virtual void UpdateInCallContextMenuL();
       
   362 
       
   363         /*
       
   364         * If KFeatureIdFfSimlessOfflineSupport is undefined and
       
   365         * UI shows note which will be closed by key event then
       
   366         * method return ETrue otherwise EFalse.
       
   367         */
       
   368         TBool IsNoteDismissableL();
       
   369 
       
   370         IMPORT_C void RetainPreviousKeylockStateL();
       
   371         
       
   372     public: // NumberEntry functions.
       
   373 
       
   374         /**
       
   375         * Passes create number entry command forward if NE can be created.
       
   376         */
       
   377         IMPORT_C virtual void HandleCreateNumberEntryL(
       
   378                 const TKeyEvent& aKeyEvent,
       
   379                 TEventCode aEventCode );
       
   380         /**
       
   381         * Check if number entry is used
       
   382         * @return boolean value indicating that number entry is used
       
   383         */
       
   384         IMPORT_C virtual TBool IsNumberEntryUsedL();
       
   385 
       
   386         /**
       
   387         * Check if number entry is visible
       
   388         * @return boolean value indicating that number entry is visible
       
   389         */
       
   390         IMPORT_C TBool IsNumberEntryVisibleL();
       
   391 
       
   392     protected:
       
   393 
       
   394         /**
       
   395         * Handle EPEMessageAudioMuteChanged
       
   396         */
       
   397         IMPORT_C void HandleAudioMuteChangedL();
       
   398 
       
   399         /**
       
   400         * Handle EPEMessageAudioOutputChanged
       
   401         */
       
   402         IMPORT_C void HandleAudioOutputChangedL();
       
   403 
       
   404         /**
       
   405         * Handle SideVolumeKeyInc
       
   406         */
       
   407         IMPORT_C void IncreaseAudioVolumeL();
       
   408 
       
   409         /**
       
   410         * Handle SideVolumeKeyDec
       
   411         */
       
   412         IMPORT_C void DecreaseAudioVolumeL();
       
   413 
       
   414         /**
       
   415         * Dial CS multimedia call
       
   416         */
       
   417         IMPORT_C void DialMultimediaCallL();
       
   418 
       
   419         /**
       
   420         * Dial CS voice call
       
   421         */
       
   422         IMPORT_C void DialVoiceCallL();
       
   423 
       
   424         /**
       
   425         * Disconnect call
       
   426         */
       
   427         IMPORT_C TBool DisconnectCallL();
       
   428 
       
   429         /**
       
   430         * Display idle screen
       
   431         */
       
   432         IMPORT_C void DisplayIdleScreenL();
       
   433 
       
   434         /**
       
   435         * Set up the Idle screen in the background for the cases
       
   436         * where the phone is no longer the top application (eg. end
       
   437         * call when an external app is being displayed)
       
   438         */
       
   439         IMPORT_C void SetupIdleScreenInBackgroundL();
       
   440 
       
   441         /**
       
   442         * Display call header for call coming in ( the remote info data
       
   443         * and picture is displayed immediately )
       
   444         * @param aCallid call id
       
   445         * @param aWaitingCall waiting call indication
       
   446         */
       
   447         IMPORT_C void DisplayHeaderForCallComingInL(
       
   448             TInt aCallId,
       
   449             TInt aWaitingCall );
       
   450 
       
   451 		/**
       
   452         * Sets call header texts for call coming in
       
   453         * @param aCallid call id
       
   454         * @param aWaitingCall waiting call indication
       
   455 		* @param aCallHeaderData - Call header parameter into which the text
       
   456         *                          will be set.
       
   457         */
       
   458         IMPORT_C void SetCallHeaderTextsForCallComingInL(
       
   459 			TInt aCallId,
       
   460             TBool aWaitingCall,
       
   461             TPhoneCmdParamCallHeaderData* aCallHeaderData );
       
   462 
       
   463         /**
       
   464         * Display call header for outgoing call (the phone number is initially
       
   465         * displayed)
       
   466         * @param aCallid call id
       
   467         */
       
   468         IMPORT_C void DisplayHeaderForOutgoingCallL( TInt aCallId );
       
   469 
       
   470         /**
       
   471         * Update Single Active Call
       
   472         * @param aCallid call id
       
   473         */
       
   474         IMPORT_C void UpdateSingleActiveCallL( TInt aCallId );
       
   475 
       
   476         /**
       
   477         * Update remote information data in the call header
       
   478         * @param aCallid call id
       
   479         */
       
   480         IMPORT_C void UpdateRemoteInfoDataL( TInt aCallId );
       
   481 
       
   482         /**
       
   483         * Return remote info data
       
   484         * @param aCallid call id
       
   485         * @param aData the returned remote info data
       
   486         */
       
   487         IMPORT_C void GetRemoteInfoDataL( TInt aCallId, TDes& aData );
       
   488 
       
   489         /**
       
   490          * Sets context menu
       
   491          *
       
   492          * @param aResourceId   resource
       
   493          */
       
   494         IMPORT_C virtual void SetContextMenuL( TInt aResourceId );
       
   495 
       
   496         /**
       
   497          * Sets context menu to correspond the incoming options menu
       
   498          *
       
   499          * @param aCallId   incoming call id
       
   500          */
       
   501         IMPORT_C virtual void UpdateIncomingContextMenuL( TInt aCallId );
       
   502 
       
   503 
       
   504         /**
       
   505         * Show note
       
   506         * @param aResourceId resource id to be resolved
       
   507         */
       
   508         IMPORT_C void ShowNoteL( TInt aResourceId );
       
   509 
       
   510         /**
       
   511         * Show query
       
   512         * @param aResourceId resource id to be resolved
       
   513         */
       
   514         IMPORT_C void ShowQueryL( TInt aResourceId );
       
   515 
       
   516         /**
       
   517         * Show text query
       
   518         * @param aDialogResourceId dialog's resource id
       
   519         * @param aDefaultCbaResourceId default CBA's resource id
       
   520         * @param aContentCbaResourceId content CBA's resource id
       
   521         * @param aDataText pointer to data text
       
   522         * @param aSendKeyEnabled send key enabled status for the query
       
   523         */
       
   524         IMPORT_C void ShowTextQueryL(
       
   525             TInt aDialogResourceId,
       
   526             TInt aDefaultCbaResourceId,
       
   527             TInt aContentCbaResourceId,
       
   528             TDes* aDataText,
       
   529             TBool aSendKeyEnabled = EFalse );
       
   530 
       
   531         /**
       
   532         * Check if note is visible
       
   533         * @return boolean value indicating that note is visible
       
   534         */
       
   535         IMPORT_C TBool IsNoteVisibleL();
       
   536 
       
   537         /**
       
   538         * Handle numeric key event
       
   539         */
       
   540         IMPORT_C virtual void HandleNumericKeyEventL(
       
   541             const TKeyEvent& aKeyEvent,
       
   542             TEventCode aEventCode );
       
   543 
       
   544         /**
       
   545         * Check if the application needs to be sent to the background
       
   546         * @return boolean value indicating that application needs to be
       
   547         *  sent to the background
       
   548         */
       
   549         IMPORT_C TBool NeedToSendToBackgroundL() const;
       
   550 
       
   551         /**
       
   552         * Check if the top application is currently displayed in the foreground
       
   553         * @return boolean value indicating that top app is displayed
       
   554         */
       
   555         IMPORT_C TBool TopAppIsDisplayedL() const;
       
   556 
       
   557         /**
       
   558         * Capture keys during call notifications (dialing, incoming, waiting)
       
   559         * @param aCaptured ETrue if keys are to be captured
       
   560         */
       
   561         IMPORT_C void CaptureKeysDuringCallNotificationL( TBool aCaptured );
       
   562 
       
   563         /**
       
   564         * Displays the call termination note, if required
       
   565         */
       
   566         IMPORT_C void DisplayCallTerminationNoteL();
       
   567 
       
   568         /**
       
   569         * Set the handsfree mode
       
   570         * @param aHandsfreeMode ETrue to activate IHF, EFalse to deactivate
       
   571         */
       
   572         IMPORT_C void SetHandsfreeModeL( TBool aHandsfreeMode );
       
   573 
       
   574         /**
       
   575         * Set the BT handsfree mode
       
   576         * @param aHandsfreeMode ETrue to activate BT, EFalse to deactivate
       
   577         */
       
   578         IMPORT_C void SetBTHandsfreeModeL( TBool aHandsfreeMode );
       
   579 
       
   580          /**
       
   581         * Show global WarningNote
       
   582         * @param aResourceId resource id to be resolved
       
   583         */
       
   584         IMPORT_C void SendGlobalWarningNoteL( TInt aResourceId );
       
   585 
       
   586         /**
       
   587         * Checks is the call id a video call.
       
   588         * @param aCallId - call id to be checked
       
   589         * @return ETrue if video call id, otherwise EFalse
       
   590         */
       
   591         IMPORT_C TBool IsVideoCall( const TInt aCallId );
       
   592 
       
   593         /**
       
   594         * Return SimState.
       
   595         */
       
   596         IMPORT_C TPESimState SimState() const;
       
   597 
       
   598         /**
       
   599         * Starts ALS line change timer.
       
   600         * This should be called after receiving long keypress
       
   601         * which is 0.8 seconds. ALS line change timer ticks
       
   602         * 2.2 seconds before callback is called.
       
   603         */
       
   604         IMPORT_C void StartAlsLineChangeTimerL();
       
   605 
       
   606         /**
       
   607         * Start show security note
       
   608         * This should be called in startup and idle state
       
   609         * if sim state not ok
       
   610         */
       
   611         IMPORT_C void StartShowSecurityNoteL();
       
   612 
       
   613         /**
       
   614         * Check if the sim card state is EPESimNotPresent with
       
   615         * the security mode is enabled.
       
   616         * @return ETrue if the sim card state is EPESimNotPresent and
       
   617         * the security mode is enabled, otherwise EFalse
       
   618         **/
       
   619         IMPORT_C TBool IsSimStateNotPresentWithSecurityModeEnabled();
       
   620 
       
   621         /**
       
   622         * Handle audio output availability change
       
   623         */
       
   624         void HandleAudioAvailableOutputChangedL();
       
   625 
       
   626         /**
       
   627         * Shows 'Number busy' note.
       
   628         */
       
   629         IMPORT_C void ShowNumberBusyNoteL();
       
   630 
       
   631         /**
       
   632         * Fetches keylock information - is it set on or not
       
   633         * @return is keylock set on (ETrue) or off (EFalse)
       
   634         */
       
   635         IMPORT_C TBool IsKeyLockOn() const;
       
   636 
       
   637         /**
       
   638         * Informs Phone Engine Sat request completion
       
   639         * @param aCallId a call id
       
   640         */
       
   641         IMPORT_C void CompleteSatRequestL( const TInt aCallId );
       
   642 
       
   643         /**
       
   644         * Sets the call header type used in the call bubble.
       
   645         */
       
   646         IMPORT_C void SetCallHeaderType( const CBubbleManager::TPhoneCallTypeFlags aCallHeaderType );
       
   647 
       
   648         /**
       
   649         * Handles situation when hash key has been kept down long
       
   650         * (long keypress) and the hash character is the only character
       
   651         * in number entry.
       
   652         */
       
   653         IMPORT_C virtual void OnlyHashInNumberEntryL();
       
   654 
       
   655         /**
       
   656         * Informs view that UI is being updated (call bubble or number editor).
       
   657         * EndUiUpdate() must be called when update is done.
       
   658         */
       
   659         IMPORT_C void BeginUiUpdateLC();
       
   660 
       
   661         /**
       
   662         * Informs view that UI update is completed.
       
   663         */
       
   664         IMPORT_C void EndUiUpdate();
       
   665 
       
   666         /*
       
   667         * Checks if necessary to show call termination note
       
   668         *
       
   669         * @param aCallId call id
       
   670         * @return true if note should be shown
       
   671         */
       
   672         IMPORT_C virtual TBool CheckIfShowCallTerminationNote( );
       
   673 
       
   674         /*
       
   675         * Sets used touchpane buttons.
       
   676         *
       
   677         * @param touchpane resource id.
       
   678         */
       
   679         IMPORT_C void SetTouchPaneButtons( TInt aResourceId );
       
   680 
       
   681         /*
       
   682         * Sets touchpane visibility.
       
   683         *
       
   684         * @param ETrue if visible otherwise EFalse.
       
   685         */
       
   686         IMPORT_C void SetTouchPaneVisible( TBool aVisible );
       
   687 
       
   688         /*
       
   689         * Destroys touchpane buttons.
       
   690         */
       
   691         IMPORT_C void DeleteTouchPaneButtons();
       
   692 
       
   693         /*
       
   694         * Enables touchpane button that holds given command id.
       
   695         *
       
   696         * @param aCommandId Command id.
       
   697         */
       
   698         IMPORT_C void SetTouchPaneButtonEnabled( TInt aCommandId );
       
   699 
       
   700         /*
       
   701         * Disables touchpane button that holds given command id.
       
   702         *
       
   703         * @param aCommandId Command id.
       
   704         */
       
   705         IMPORT_C void SetTouchPaneButtonDisabled( TInt aCommandId );
       
   706 
       
   707         /*
       
   708         * Checks if DTMF editor is active,
       
   709         * @return true is DTMF is active
       
   710         */
       
   711         IMPORT_C TBool IsDTMFEditorVisibleL() const;
       
   712 
       
   713         /**
       
   714         * Closes dtmf editor.
       
   715         */
       
   716         IMPORT_C void CloseDTMFEditorL();
       
   717 
       
   718         /**
       
   719         * Set default flags values.
       
   720         * No active call
       
   721         */
       
   722         IMPORT_C void SetDefaultFlagsL();
       
   723 
       
   724         /**
       
   725         * Check if contact info available and
       
   726         * shown waiting note with or without caller name
       
   727         */
       
   728         IMPORT_C void CallWaitingNoteL( TInt aCallId );
       
   729 
       
   730         /*
       
   731         * Sets ringtone playback.
       
   732         * @param aCallId call id
       
   733         */
       
   734         IMPORT_C void SetRingingTonePlaybackL( TInt aCallId );
       
   735 
       
   736         /**
       
   737         * A message handling function for message EPEMessageDisconnecting
       
   738         * @param aCallId: the call id of the call
       
   739         */
       
   740         IMPORT_C void HandleDisconnectingL( TInt aCallId );
       
   741 
       
   742         /**
       
   743         * Returns customized dialer menu resource id
       
   744         */
       
   745         IMPORT_C TInt CustomizedDialerMenuResourceIdL();
       
   746 
       
   747         /**
       
   748         * Returns customized dialer CBA resource id
       
   749         */
       
   750         IMPORT_C TInt CustomizedDialerCbaResourceIdL();
       
   751 
       
   752     protected: // NumberEntry functions.
       
   753 
       
   754         /**
       
   755         * Set Number Entry visibility.
       
   756         * @param aVisible ETrue if numberentry is wanted to be shown
       
   757         *                 (Note ETrue will set NE CBA's)
       
   758         *                 EFalse if numberentry isnt wanted to be shown
       
   759         *                 (Note EFalse doesnt affact to CBA's)
       
   760         */
       
   761         IMPORT_C void SetNumberEntryVisibilityL( const TBool aVisible );
       
   762 
       
   763         /**
       
   764         * Create call if in numberentry more that 2 number and Send key
       
   765         * Send manual control sequence
       
   766         * if 1-2 number in numberentry and Send key
       
   767         */
       
   768         IMPORT_C void CallFromNumberEntryL();
       
   769 
       
   770         /**
       
   771          * Returns phone number from the phone number entry.
       
   772          * @return  Phone number
       
   773          */
       
   774         IMPORT_C HBufC* PhoneNumberFromEntryLC();
       
   775 
       
   776         /**
       
   777         * Check if number entry content is stored
       
   778         * @return boolean value indicating that number entry content is stored
       
   779         */
       
   780         IMPORT_C TBool IsNumberEntryContentStored();
       
   781 
       
   782         /**
       
   783         * Stores the number entry content to the cache
       
   784         */
       
   785         IMPORT_C void StoreNumberEntryContentL();
       
   786 
       
   787         /**
       
   788         * Restores the number entry content from the cache
       
   789         */
       
   790         IMPORT_C void RestoreNumberEntryContentL();
       
   791 
       
   792         /**
       
   793         * Clears the number entry content cache
       
   794         */
       
   795         IMPORT_C void ClearNumberEntryContentCache();
       
   796 
       
   797         /**
       
   798         * Restores number entry content after dtmf dialer
       
   799         */
       
   800         IMPORT_C void CheckIfRestoreNEContentAfterDtmfDialer();
       
   801 
       
   802         /**
       
   803          * Checks if on screen dialer feature is supported.
       
   804          */
       
   805         IMPORT_C TBool IsOnScreenDialerSupported() const;
       
   806 
       
   807         /**
       
   808         * Informs phoneengine that phone number has been edited i.e. phonenumber parser is run
       
   809         */
       
   810         IMPORT_C virtual  void HandleNumberEntryEdited();
       
   811 
       
   812         /**
       
   813          * Returns ETrue if alphanumeric characters are supported.
       
   814          * @param aKeyEvent Key event.
       
   815          * @return ETrue if alphanumeric chars are supported.
       
   816          */
       
   817          IMPORT_C TBool IsAlphanumericSupportedAndCharInput(
       
   818                      const TKeyEvent& aKeyEvent );
       
   819 
       
   820          /**
       
   821          * Handle state-specific behaviour when number entry is cleared
       
   822          */
       
   823          IMPORT_C virtual void HandleNumberEntryClearedL();
       
   824 
       
   825          /**
       
   826          * Internal number entry handling methods.
       
   827          */
       
   828          void NumberEntryClearL();
       
   829          
       
   830 		  
       
   831          /**
       
   832          * Dims silence touch button if call is not alerting.
       
   833          * @param None
       
   834          */
       
   835          IMPORT_C void UpdateSilenceButtonDimming();
       
   836 
       
   837          /**
       
   838          * Sets toolbar dimming.
       
   839          * @param aDimmed ETrue if dimmed
       
   840          */
       
   841          IMPORT_C void SetToolbarDimming( TBool aDimmed );
       
   842 
       
   843          /**
       
   844          * Sets toolbar loudspeaker button enabled.
       
   845          */
       
   846          IMPORT_C void SetToolbarButtonLoudspeakerEnabled();
       
   847 
       
   848     protected:
       
   849 
       
   850        /**
       
   851        * Returns updated remote information data.
       
   852        * NOTE: This metohed is used when state receives
       
   853        * EPEMessageRemotePartyInfoChanged from PhoneEngine.
       
   854        * @param aCallId - Call Id.
       
   855        */
       
   856        TPhoneCmdParamCallHeaderData UpdateCallHeaderInfoL( TInt aCallId );
       
   857 
       
   858        /**
       
   859        * Checks if call is waiting, returns ETrue if call is waiting
       
   860        * otherwise EFalse.
       
   861        * @param aCallId, call id.
       
   862        */
       
   863        TBool IsWaitingCallL( const TInt aCallId );
       
   864 
       
   865        /**
       
   866        * Shows dtmf dialer
       
   867        */
       
   868        void ShowDtmfDialerL();
       
   869 
       
   870        /**
       
   871        * Checks status of KFeatureIdSideVolumeKeys and KTelephonyLVFlagScrollVolumeKeys
       
   872        * keys. If KTelephonyLVFlagScrollVolumeKeys is false and KFeatureIdSideVolumeKeys is true
       
   873        * then side volume keys are only supported and method returns true, otherwise false.
       
   874        */
       
   875        TBool OnlySideVolumeKeySupported();
       
   876 
       
   877        /**
       
   878        * Checks if device has connected call ongoing.
       
   879        * List of connected call states: EPEStateConnected
       
   880        *                                EPEStateConnectedConference
       
   881        *                                EPEStateConnecting
       
   882        */
       
   883        TBool IsAnyConnectedCalls();
       
   884 
       
   885     private:
       
   886 
       
   887         /**
       
   888         * Update incall indicator
       
   889         * @param aCallState a call state
       
   890         */
       
   891         void UpdateIncallIndicatorL( TInt aCallState );
       
   892 
       
   893         /**
       
   894         * Handle EPEMessageChangedCallDuration
       
   895         * @param aCallId call id of the message
       
   896         */
       
   897         void HandleChangedCallDurationL( TInt aCallId );
       
   898 
       
   899         /**
       
   900         * Update profile display
       
   901         */
       
   902         void UpdateProfileDisplayL();
       
   903 
       
   904         /**
       
   905         * Update operator display
       
   906         */
       
   907         void UpdateOperatorDisplayL();
       
   908 
       
   909         /**
       
   910         * Sends key down event to the phone engine
       
   911         * @param aKeyEvent a key event
       
   912         * @param aEventCode key event code
       
   913         */
       
   914         void SendKeyPressL(
       
   915             const TKeyEvent& aKeyEvent,
       
   916             TEventCode aEventCode );
       
   917 
       
   918         /**
       
   919         * Sends key events to the phone engine
       
   920         * @param aKeyEvent a key event
       
   921         * @param aEventCode key event code
       
   922         */
       
   923         void SendKeyEventL(
       
   924             const TKeyEvent& aKeyEvent,
       
   925             TEventCode aEventCode );
       
   926 
       
   927         /**
       
   928         * ETrue if title pane is visible
       
   929         */
       
   930         TBool TitlePaneIsVisibleL() const;
       
   931 
       
   932         /**
       
   933         * Change Audio volume level
       
   934         * @param aLevel New volume level.
       
   935         * @param aUpdateControl Set ETrue if volume ui control
       
   936         *                       needs to be updated.
       
   937         */
       
   938         void ChangeAudioVolumeL( TInt aLevel,
       
   939                                  TBool aUpdateControl = ETrue );
       
   940 
       
   941         /**
       
   942         * Handles EPEMessageInitiatedEmergency call message from Phone Engine.
       
   943         * @param aCallId - Caller id.
       
   944         */
       
   945         void HandleInitiatedEmergencyCallL( TInt aCallId );
       
   946 
       
   947         /**
       
   948          *  Handles EPEMessageInitiatedEmergencyWhileActiveVideo message from
       
   949          * Phone Engine.
       
   950          */
       
   951         void HandleInitiatedEmergencyWhileActiveVideoL();
       
   952 
       
   953         /**
       
   954         * Shows IMEI note
       
   955         */
       
   956         void HandleShowImeiL();
       
   957 
       
   958         /**
       
   959         * Handles network ciphering info changes
       
   960         */
       
   961         void HandleCallSecureStatusChangeL( TInt aCallId );
       
   962 
       
   963         /**
       
   964         * Shows Life time note
       
   965         */
       
   966         void HandleShowLifeTimerL();
       
   967 
       
   968         /**
       
   969         * Handles change als line command
       
   970         */
       
   971         void ChangeAlsLineL();
       
   972 
       
   973         /**
       
   974         * Active call id
       
   975         */
       
   976         TInt GetActiveCallIdL();
       
   977 
       
   978         /**
       
   979         * Callback function for launching ALS line change dialog
       
   980         * This is called when Als line change timer timeout is
       
   981         * reached which means user has pushed the #-key long enough.
       
   982         * @param aAny - not used
       
   983         */
       
   984         static TInt AlsLineChangeTimerCallbackL( TAny* aAny );
       
   985 
       
   986         /**
       
   987         * Shows WLAN MAC address note
       
   988         */
       
   989         void ShowWlanMacAddressL();
       
   990 
       
   991 
       
   992         /**
       
   993         * Check if ALS line change is possible
       
   994         */
       
   995         TBool IsAlsLineChangePossible();
       
   996 
       
   997         /**
       
   998         * A message handling function for message EPEMessageRemoteBusy
       
   999         * @param aCallId a call id
       
  1000         */
       
  1001         void HandleRemoteBusyL( const TInt aCallId );
       
  1002 
       
  1003         /**
       
  1004         * Creates caller information. Sets CNAP, phone number, thumbnail image
       
  1005         * etc. into the call header parameter.
       
  1006         * @param aCallId - Call Id.
       
  1007         * @param aCallHeaderData - Call header parameter where modifications
       
  1008         *                          are made.
       
  1009         */
       
  1010         void CreateCallerInfoL( const TInt aCallId,
       
  1011             TPhoneCmdParamCallHeaderData* aCallHeaderData );
       
  1012 
       
  1013         /**
       
  1014         * TCleanupOperation to call EndUiUpdate(), if leave occurs
       
  1015         * after BeginUiUpdate().
       
  1016         */
       
  1017         static void UiUpdateCleanup(TAny* aThis );
       
  1018 
       
  1019         /**
       
  1020         * TCleanupOperation to call EndTransEffect, if leave occurs
       
  1021         * after BeginTransEffect().
       
  1022         */
       
  1023         static void EffectCleanup(TAny* aThis );
       
  1024 
       
  1025         /**
       
  1026         * Gets volume level from ui control.
       
  1027         */
       
  1028         TInt GetVolumeLevel();
       
  1029 
       
  1030         /**
       
  1031         * Shows video call specific out of memory note.
       
  1032         */
       
  1033         void ShowVideoCallOutOfMemoryNoteL();
       
  1034 
       
  1035         /**
       
  1036         * Returns sim security status:
       
  1037         * Rejected or UnAccepted.
       
  1038         */
       
  1039         TInt SimSecurityStatus() const;
       
  1040 
       
  1041         /**
       
  1042         * Show CUG in use note
       
  1043         */
       
  1044         void HandleCugInUseNoteL();
       
  1045 
       
  1046         /**
       
  1047          * Handles changes in the SIM card state.
       
  1048          */
       
  1049         void HandleSimStateChangedL();
       
  1050 
       
  1051         /**
       
  1052          * Checks if key events are allowed to be redirected for further handling
       
  1053          */
       
  1054         TBool IsKeyEventFurtherProcessedL( const TKeyEvent& aKeyEvent ) const;
       
  1055 
       
  1056         /*
       
  1057          * Checks is given key contains numeric charaters or if customization is used
       
  1058          * alphanumeir letters
       
  1059         */
       
  1060         TBool IsValidAlphaNumericKey( const TKeyEvent& aKeyEvent,
       
  1061                 TEventCode aEventCode );
       
  1062 
       
  1063         /*
       
  1064          * Updates CBA using either customization or resource resolver
       
  1065          */
       
  1066         void CustomizeCbaForPhoneNumberL();
       
  1067 
       
  1068         /*
       
  1069          * Checks if Touch dialer is on in DTMF mode.
       
  1070          */
       
  1071         TBool IsTouchDTmfDialerOn() const;
       
  1072 
       
  1073         /*
       
  1074          * Checks if keyevent is from dtmf key and sends it to phone-engine
       
  1075          */
       
  1076         void SendDtmfKeyEventL( const TKeyEvent& aKeyEvent,
       
  1077                 TEventCode aEventCode  );
       
  1078 
       
  1079         /*
       
  1080          * Creates call header manager if needed.
       
  1081         */
       
  1082         CPhoneCallHeaderManager* CallheaderManagerL();
       
  1083 
       
  1084         /*
       
  1085         * Creates number entry content if needed.
       
  1086         */
       
  1087         CPhoneNumberEntryManager* NumberEntryManagerL();
       
  1088 
       
  1089         /*
       
  1090         * Updated Cba when Swivel state changes.
       
  1091         */
       
  1092         void UpdateCbaSwivelStateChangedL();
       
  1093 
       
  1094         /**
       
  1095         * Loads data commonengine stringloader.
       
  1096         * @param aData - The returned data including needed text.
       
  1097         * @param aResourceId - Resource id for text.
       
  1098         */
       
  1099         void LoadResource( TDes& aData, const TInt aResource ) const;
       
  1100 
       
  1101         /**
       
  1102         * Opens virtual keyboard.
       
  1103         */
       
  1104         void OpenVkbL();
       
  1105 
       
  1106     private: // NumberEntry functions.
       
  1107 
       
  1108         /**
       
  1109         * Handles key events in situations when there exists a number entry.
       
  1110         * In this case number entry may be visible or hidden.
       
  1111         * @param aKeyEvent - key event
       
  1112         * @param aEventCode - event code
       
  1113         */
       
  1114         void KeyEventForExistingNumberEntryL(
       
  1115             const TKeyEvent& aKeyEvent,
       
  1116             TEventCode aEventCode );
       
  1117 
       
  1118     protected:  // Data
       
  1119 
       
  1120         /**
       
  1121         * Reference to State machine
       
  1122         */
       
  1123         MPhoneStateMachine* iStateMachine;
       
  1124 
       
  1125         /**
       
  1126         * Reference to the Phone UI View command handle
       
  1127         */
       
  1128         MPhoneViewCommandHandle* iViewCommandHandle;
       
  1129 
       
  1130     protected:
       
  1131 
       
  1132         //Indicates whether onscreen dialer is defined
       
  1133         TBool iOnScreenDialer;
       
  1134 
       
  1135         /**
       
  1136         * Customization of functionality according to e.g.
       
  1137         * call type specific needs.
       
  1138         * Not own.
       
  1139         */
       
  1140         MPhoneCustomization* iCustomization;
       
  1141 
       
  1142         // CBA key manager. Own.
       
  1143         CPhoneCbaManager* iCbaManager;
       
  1144 
       
  1145     private:
       
  1146 
       
  1147         /**
       
  1148          * Previously handled SIM card state.
       
  1149          */
       
  1150         TPESimState iPreviousSimState;
       
  1151 
       
  1152         // Bitmap redraw counter
       
  1153         TInt iBitmapRedrawCounter;
       
  1154 
       
  1155         /**
       
  1156         * Timer for ALS line change.
       
  1157         */
       
  1158         CPhoneTimer* iAlsLineChangeKeyPressTimer;
       
  1159 
       
  1160         // Internal variable for EikonEnv to avoid
       
  1161         // use of static system calls
       
  1162         CEikonEnv& iEnv;
       
  1163 
       
  1164         // Call header manager.
       
  1165         CPhoneCallHeaderManager* iCallHeaderManager;
       
  1166 
       
  1167         // Number entry manager
       
  1168         CPhoneNumberEntryManager* iNumberEntryManager;
       
  1169 
       
  1170         // RingtoneSilenced flag.
       
  1171         // This is used to determine if the ringtone
       
  1172         // for incoming call is silenced. The information
       
  1173         // is used while updating softkeys in method
       
  1174         // UpdateIncomingCbaL only
       
  1175         TBool iRingtoneSilenced;
       
  1176 
       
  1177         /**
       
  1178          * Handle to the Operator logo resource.
       
  1179          */
       
  1180         TInt iLogoHandle;
       
  1181         };
       
  1182 
       
  1183 #endif // CPHONESTATE_H
       
  1184 
       
  1185 // End of File