phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp
changeset 46 bc5a64e5bc3c
parent 45 6b911d05207e
child 50 377c906a8701
child 51 f39ed5e045e0
--- a/phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp	Wed Jun 23 18:12:20 2010 +0300
+++ b/phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp	Tue Jul 06 14:15:47 2010 +0300
@@ -314,16 +314,14 @@
         }
     }
     
-    if ( -1 == pluginInd )
-        {
+    if ( -1 == pluginInd ) {
         wrapper = new PhoneCommandExtensionWrapper( pluginUid.iUid );
-        if (wrapper)
+        if (wrapper) {
             m_commandExtensions.append( wrapper );
         }
-    else
-        {
+    } else {
         wrapper = m_commandExtensions[pluginInd];
-        }
+    }
     
     m_lastCommandExtension = wrapper;
     return wrapper;
@@ -464,12 +462,34 @@
     case EPEStateConnecting: {
         if (!emergencyCall) {
             if (PhoneResourceAdapter::Instance()->buttonsController()->
-                    getButtonFlags(PhoneUIQtButtonsController::Mute)) {
-                ret.append(PhoneInCallCmdUnmute);
+                   getButtonFlags(
+                           PhoneUIQtButtonsController::IhfAsPushButton)) {
+                if (PhoneResourceAdapter::Instance()->buttonsController()->getButtonFlags(
+                        PhoneUIQtButtonsController::BluetoothAvailable)) {
+                    if (PhoneResourceAdapter::Instance()->buttonsController()->getButtonFlags(
+                            PhoneUIQtButtonsController::Btaa)) {
+                        ret.append(PhoneInCallCmdHandset);
+                    } else {
+                        ret.append(PhoneInCallCmdBtHandsfree);
+                    } 
+                } else {
+                    if (!PhoneResourceAdapter::Instance()->buttonsController()->
+                            getButtonFlags(PhoneUIQtButtonsController::Ihf)) {
+                        ret.append(PhoneInCallCmdActivateIhf);
+                    } else {
+                        ret.append(PhoneInCallCmdDeactivateIhf);
+                    }           
+                }
             } else {
-                ret.append(PhoneInCallCmdMute);
+                if (PhoneResourceAdapter::Instance()->buttonsController()->
+                        getButtonFlags(PhoneUIQtButtonsController::Mute)) {
+                    ret.append(PhoneInCallCmdUnmute);
+                } else {
+                    ret.append(PhoneInCallCmdMute);
+                }
             }
         }
+        
         ret.append(PhoneInCallCmdEndOutgoingCall);  
     }
     break;
@@ -489,10 +509,31 @@
     case EPEStateHeldConference: {
         if (!emergencyCall) {
             if (PhoneResourceAdapter::Instance()->buttonsController()->
-                    getButtonFlags(PhoneUIQtButtonsController::Mute)) {
-                ret.append(PhoneInCallCmdUnmute);
+                   getButtonFlags(
+                           PhoneUIQtButtonsController::IhfAsPushButton)) {
+                if (PhoneResourceAdapter::Instance()->buttonsController()->getButtonFlags(
+                        PhoneUIQtButtonsController::BluetoothAvailable)) {
+                    if (PhoneResourceAdapter::Instance()->buttonsController()->getButtonFlags(
+                            PhoneUIQtButtonsController::Btaa)) {
+                        ret.append(PhoneInCallCmdHandset);
+                    } else {
+                        ret.append(PhoneInCallCmdBtHandsfree);
+                    } 
+                } else {
+                    if (!PhoneResourceAdapter::Instance()->buttonsController()->
+                            getButtonFlags(PhoneUIQtButtonsController::Ihf)) {
+                        ret.append(PhoneInCallCmdActivateIhf);
+                    } else {
+                        ret.append(PhoneInCallCmdDeactivateIhf);
+                    }           
+                }
             } else {
-                ret.append(PhoneInCallCmdMute);
+                if (PhoneResourceAdapter::Instance()->buttonsController()->
+                        getButtonFlags(PhoneUIQtButtonsController::Mute)) {
+                    ret.append(PhoneInCallCmdUnmute);
+                } else {
+                    ret.append(PhoneInCallCmdMute);
+                }
             }
         }
 
@@ -656,6 +697,20 @@
         action->setCommand(EPhoneInCallCmdContacts); 
     }
     break;
+    case PhoneInCallCmdBtHandsfree: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_bluetooth_headset"));
+        action->setDisabled(disabled);
+        action->setCommand(EPhoneInCallCmdBtHandsfree); 
+    }
+    break;
+    case PhoneInCallCmdHandset: {
+        action = new PhoneAction;
+        action->setIcon(HbIcon("qtg_mono_mobile"));
+        action->setDisabled(disabled);
+        action->setCommand(EPhoneInCallCmdHandset); 
+    }
+    break;
     default:
     break;
     }