phoneapp/phoneuiview/inc/cphonebuttonscontroller.h
changeset 0 5f000ab63145
child 44 3c221667e687
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Handles the updating of touch buttons
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONEBUTTONSCONTROLLER_H
       
    20 #define CPHONEBUTTONSCONTROLLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <bmtouchpaneinterface.h>
       
    24 #include "mphonebuttoncustomization.h"
       
    25 
       
    26 class TPhoneCommandParam;
       
    27 
       
    28 /**
       
    29  *  Updates touch buttons
       
    30  *
       
    31  *  @lib PhoneUIView.lib
       
    32  *  @since S60 v5.0
       
    33  */
       
    34 NONSHARABLE_CLASS( CPhoneButtonsController ): 
       
    35     public CBase, MBubbleTouchPaneIconProvider
       
    36     {
       
    37 public:
       
    38 
       
    39     static CPhoneButtonsController* NewL(
       
    40         MBubbleTouchPaneInterface& aTouchPane );
       
    41 
       
    42     virtual ~CPhoneButtonsController();
       
    43     
       
    44     /**
       
    45      * Loads buttons form given resouce.
       
    46      *
       
    47      * @since S60 v5.0
       
    48      * @param aCommandParam Mute information
       
    49      */
       
    50     void SetButtonSet( TPhoneCommandParam* aCommandParam );
       
    51     
       
    52     /**
       
    53      * SetMuteFlag
       
    54      *
       
    55      * @since S60 v5.0
       
    56      * @param aCommandParam 
       
    57      */
       
    58     void SetMuteFlag( TPhoneCommandParam* aCommandParam );
       
    59     
       
    60     /**
       
    61      * SetHoldFlag
       
    62      *
       
    63      * @since S60 v5.0
       
    64      * @param aCommandParam 
       
    65      */
       
    66     void SetHoldFlag( TPhoneCommandParam* aCommandParam );
       
    67    
       
    68     /**
       
    69      * Handles IHF change event.
       
    70      *
       
    71      * @since S60 v5.0
       
    72      * @param aCommandParam IHF information.
       
    73      */
       
    74     void SetIhfFlag( TPhoneCommandParam* aCommandParam );
       
    75 
       
    76     /**
       
    77      * Handles BT accessory output change event.
       
    78      *
       
    79      * @since S60 v5.0
       
    80      * @param aCommandParam BTA information.
       
    81      */    
       
    82     void SetBTAccFlag( TPhoneCommandParam* aCommandParam );
       
    83 
       
    84     /**
       
    85      * Handles Wired accessory output change event.
       
    86      *
       
    87      * @since S60 v5.0
       
    88      * @param aCommandParam wired information.
       
    89      */    
       
    90     void SetWiredAccFlag( TPhoneCommandParam* aCommandParam );
       
    91     
       
    92     /**
       
    93      * Handles BT accessory availability change event.
       
    94      *
       
    95      * @since S60 v5.0
       
    96      * @param aCommandParam BTA availability 
       
    97      */    
       
    98     void SetBTAccAvailableFlag( TPhoneCommandParam* aCommandParam );
       
    99 
       
   100     /**
       
   101      * Handles switch to video change event.
       
   102      *
       
   103      * @since S60 v5.0
       
   104      * @param aCommandParam  
       
   105      */    
       
   106     void SetVideoCallFlag( TPhoneCommandParam* aCommandParam );
       
   107     
       
   108     /**
       
   109      * Handles conference join availability change event.
       
   110      *
       
   111      * @since S60 v5.0
       
   112      * @param aCommandParam Add to conference availability 
       
   113      */    
       
   114     void SetInCallJoinEnabled( TPhoneCommandParam* aCommandParam );
       
   115  
       
   116     /**
       
   117      * Replace Audio Button
       
   118      *
       
   119      * @since S60 v5.0
       
   120      */
       
   121     void ReplaceAudioButton(); 
       
   122     
       
   123     /**
       
   124      * Sets buttons to correct states.
       
   125      *
       
   126      * @since S60 v5.0
       
   127      */
       
   128      void SetToggleButtons();
       
   129      
       
   130     /**
       
   131      * Set button dimming.
       
   132      *
       
   133      * @since S60 v5.0
       
   134      */
       
   135     void SetButtonDimming();
       
   136     
       
   137     /**
       
   138      * Set button enabled.
       
   139      *
       
   140      * @since S60 v5.0
       
   141      */
       
   142     void SetButtonEnabled( TPhoneCommandParam* aCommandParam );
       
   143     
       
   144     /**
       
   145      * Set button disabled.
       
   146      *
       
   147      * @since S60 v5.0
       
   148      */
       
   149     void SetButtonDisabled( TPhoneCommandParam* aCommandParam );
       
   150 
       
   151     /**
       
   152      * Set customization.
       
   153      *
       
   154      * @since S60 v5.0
       
   155      */
       
   156     void SetCustomization( MPhoneButtonCustomization* aCustomization );
       
   157 
       
   158 private: // From MBubbleTouchPaneIconProvider
       
   159     CGulIcon* GetIconForCommandL( TInt aCommandId );
       
   160     
       
   161     // From MBubbleTouchPaneIconProvider
       
   162     TAknsItemID GetButtonForCommandL( TInt aCommandId );
       
   163     
       
   164 
       
   165 private:
       
   166 
       
   167     CPhoneButtonsController( MBubbleTouchPaneInterface& aTouchPane );
       
   168     
       
   169     void ConstructL();
       
   170     
       
   171 private: // data
       
   172     MBubbleTouchPaneInterface& iTouchPane;
       
   173 
       
   174     // Tool bar button customization
       
   175     MPhoneButtonCustomization* iCustomization;
       
   176 
       
   177     // Flags
       
   178     enum TPhoneButtonsFlags
       
   179         {
       
   180         EButtonsPhoneMuted = 1,
       
   181         EButtonsCallOnHold = 2,
       
   182         EButtonsIhfActive  = 4,
       
   183         EButtonsWiredAcc   = 8,
       
   184         EButtonsBTAcc      = 16,
       
   185         EButtonsBTAccAvail = 32,
       
   186         EButtonsBTAccTmpUn = 64,
       
   187         EButtonsDimAnswer  = 128,
       
   188         EButtonsDimPrivate = 256,
       
   189         EButtonsDimJoin    = 512,
       
   190         EButtonsVideoCallOngoing = 1024,
       
   191         EButtonsDimSilence  = 2048,
       
   192         EButtonsDimCreateConference = 4096  
       
   193         };
       
   194     TInt iFlags;
       
   195     };
       
   196 
       
   197 #endif // CPHONEBUTTONSCONTROLLER_H