phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp
changeset 76 cfea66083b62
parent 74 d1c62c765e48
child 78 baacf668fe89
equal deleted inserted replaced
74:d1c62c765e48 76:cfea66083b62
    47 
    47 
    48 void PhoneUiCommandController::setCallMenuActions(
    48 void PhoneUiCommandController::setCallMenuActions(
    49         QMap<int,int> callStates, QMap<int,int> serviceIds, 
    49         QMap<int,int> callStates, QMap<int,int> serviceIds, 
    50         int serviceId, int expandedCallId )
    50         int serviceId, int expandedCallId )
    51 {
    51 {
    52     PHONE_DEBUG("PhoneMenuController::setCallMenuActions");
    52     PHONE_TRACE
    53     releaseMenu();
    53     releaseMenu();
    54     
    54     
    55     PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
    55     PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
    56     QList<int> menuCmdList = menuCommands(callStates, serviceIds);
    56     QList<int> menuCmdList = menuCommands(callStates, serviceIds);
    57     
    57     
    91         QMap<int,int> callStates,
    91         QMap<int,int> callStates,
    92         QMap<int,int> serviceIds,
    92         QMap<int,int> serviceIds,
    93         int serviceId,
    93         int serviceId,
    94         int callId)
    94         int callId)
    95 {
    95 {
       
    96     PHONE_TRACE
    96     QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
    97     QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
    97     QList<int> commands = buttonCommandList(
    98     QList<int> commands = buttonCommandList(
    98             callState, emergencyCall, callStates.values());
    99             callState, emergencyCall, callStates.values());
    99 
   100 
   100     PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
   101     PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
   132         QMap<int,int> callStates,
   133         QMap<int,int> callStates,
   133         QMap<int,int> serviceIds,
   134         QMap<int,int> serviceIds,
   134         int serviceId,
   135         int serviceId,
   135         int callId)
   136         int callId)
   136 {
   137 {
       
   138     PHONE_TRACE
   137     QList<PhoneAction *> actions;
   139     QList<PhoneAction *> actions;
   138     
   140     
   139     //Set tool bar button flags
   141     //Set tool bar button flags
   140     setJoinFlag(callStates, serviceIds);
   142     setJoinFlag(callStates, serviceIds);
   141     setConferenceFlag(callStates.values());
   143     setConferenceFlag(callStates.values());
   177 }
   179 }
   178 
   180 
   179 QList<int> PhoneUiCommandController::menuCommands(
   181 QList<int> PhoneUiCommandController::menuCommands(
   180         QMap<int,int> callStates, QMap<int,int> serviceIds ) const
   182         QMap<int,int> callStates, QMap<int,int> serviceIds ) const
   181 {
   183 {
   182     PHONE_DEBUG("PhoneMenuController::menuCommands");
   184     PHONE_TRACE
   183     QList<int> commands;
   185     QList<int> commands;
   184     bool sameServices = areServicesSame(callStates,serviceIds);
   186     bool sameServices = areServicesSame(callStates,serviceIds);
   185     bool isEmergencyCall = emergencyCall(callStates);
   187     bool isEmergencyCall = emergencyCall(callStates);
   186     
   188     
   187     // No menu items if an emergency call ongoing.
   189     // No menu items if an emergency call ongoing.
   280 }
   282 }
   281 
   283 
   282 TUid PhoneUiCommandController::ResolveImplementationUidL( 
   284 TUid PhoneUiCommandController::ResolveImplementationUidL( 
   283         TUint32 aServiceId, TServicePropertyName aPropertyName ) const
   285         TUint32 aServiceId, TServicePropertyName aPropertyName ) const
   284     {
   286     {
       
   287     PHONE_TRACE
   285     TUid implUid = { 0 };
   288     TUid implUid = { 0 };
   286     CSPEntry* entry = CSPEntry::NewLC();
   289     CSPEntry* entry = CSPEntry::NewLC();
   287 
   290 
   288     CSPSettings* spSettings = CSPSettings::NewLC(); 
   291     CSPSettings* spSettings = CSPSettings::NewLC(); 
   289     
   292     
   307     }
   310     }
   308 
   311 
   309 PhoneCommandExtensionWrapper 
   312 PhoneCommandExtensionWrapper 
   310     *PhoneUiCommandController::CommandExtensionL( TUint aServiceId )
   313     *PhoneUiCommandController::CommandExtensionL( TUint aServiceId )
   311 {
   314 {
       
   315     PHONE_TRACE
   312     TUid pluginUid = ResolveImplementationUidL( aServiceId, 
   316     TUid pluginUid = ResolveImplementationUidL( aServiceId, 
   313         EPropertyCallMenuHandlerPluginId );
   317         EPropertyCallMenuHandlerPluginId );
   314     
   318     
   315     int pluginInd(-1);
   319     int pluginInd(-1);
   316     PhoneCommandExtensionWrapper* wrapper = NULL;
   320     PhoneCommandExtensionWrapper* wrapper = NULL;
   335     return wrapper;
   339     return wrapper;
   336 }
   340 }
   337 
   341 
   338 void PhoneUiCommandController::releaseMenu()
   342 void PhoneUiCommandController::releaseMenu()
   339 {
   343 {
   340     PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions");
   344     PHONE_TRACE
   341     for (int i=0;i<m_customMenuActions.count();i++) {
   345     for (int i=0;i<m_customMenuActions.count();i++) {
   342         m_view.menuReference().removeAction(m_customMenuActions.at(i));
   346         m_view.menuReference().removeAction(m_customMenuActions.at(i));
   343     }
   347     }
   344     m_customMenuActions.clear();
   348     m_customMenuActions.clear();
   345     
   349     
   456 QList<int> PhoneUiCommandController::buttonCommandList(
   460 QList<int> PhoneUiCommandController::buttonCommandList(
   457         int callState,
   461         int callState,
   458         bool emergencyCall,
   462         bool emergencyCall,
   459         QList<int> callStates) const
   463         QList<int> callStates) const
   460 {
   464 {
       
   465     PHONE_TRACE
   461     QList<int> ret;
   466     QList<int> ret;
   462     
   467     
   463     switch( callState ) {
   468     switch( callState ) {
   464     case EPEStateIdle:
   469     case EPEStateIdle:
   465     case EPEStateDisconnecting:
   470     case EPEStateDisconnecting: