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