phoneapp/phoneuiqtviewadapter/src/phoneuicommandcontroller.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 18:12:20 +0300
changeset 45 6b911d05207e
parent 37 ba76fc04e6c2
child 46 bc5a64e5bc3c
permissions -rw-r--r--
Revision: 201023 Kit: 2010125
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*!
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  Handles phone ui commands.
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*/
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
#include "phoneuicommandcontroller.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
#include "phoneresourceadapter.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include "phoneuiqtbuttonscontroller.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include "qtphonelog.h"
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <hbaction.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <spsettings.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <spentry.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <spproperty.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <xqphoneappcommands.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <phoneappcommands.hrh>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <phoneappvoipcommands.hrh>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <pevirtualengine.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <xqteluicommandextension.h>
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
  
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
PhoneUiCommandController::PhoneUiCommandController(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
        PhoneUIQtViewIF &view, QObject *parent) 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
: QObject (parent), m_view(view), m_lastCommandExtension(0)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
    PHONE_DEBUG("PhoneMenuController::PhoneMenuController");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
PhoneUiCommandController::~PhoneUiCommandController()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
    PHONE_DEBUG("PhoneMenuController::~PhoneMenuController");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
    for (int i=0;i<m_commandExtensions.count();++i) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
        m_commandExtensions.at(i)->release();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
void PhoneUiCommandController::setCallMenuActions(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
        QMap<int,int> callStates, QMap<int,int> serviceIds, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
        int serviceId, int expandedCallId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
    PHONE_DEBUG("PhoneMenuController::setCallMenuActions");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
    releaseMenu();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
    PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
    QList<int> menuCmdList = menuCommands(callStates, serviceIds);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
    if (extension) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
        QList<XQTelUiCommandExtension::CallInfo> callInfo;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
        extension->getCallInfoList(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
                callInfo,callStates,serviceIds,expandedCallId);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
        //Modify command list by extension
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
        extension->modifyMenuCommandList(callInfo,menuCmdList);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
        addMenuItems(menuCmdList);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
        extension->addMenuActions(callInfo,m_customMenuActions);        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
        for (int i=0;i<m_customMenuActions.count();++i) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
            m_view.menuReference().addAction(m_customMenuActions.at(i));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
    } else {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
        addMenuItems(menuCmdList);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
void PhoneUiCommandController::setDialpadMenuActions()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
    PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
    releaseMenu();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    QList<PhoneAction*> values;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
    m_view.setMenuActions(values);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
    qDeleteAll(values);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
QMap<PhoneAction::ActionType, PhoneAction *> 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    PhoneUiCommandController::pushButtonActionsForCall( 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
        int callState,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
        bool emergencyCall,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
        QMap<int,int> callStates,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
        QMap<int,int> serviceIds,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
        int serviceId,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
        int callId)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
    QMap<PhoneAction::ActionType, PhoneAction *> translatedActions;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    QList<int> commands = buttonCommandList(
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
    97
            callState, emergencyCall, callStates.values());
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    if (extension) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
        QList<XQTelUiCommandExtension::CallInfo> callInfo;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
        extension->getCallInfoList(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
                callInfo,callStates,serviceIds,callId);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
        //Modify command list by extension
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
        extension->modifyPushButtonCommandList(callInfo,commands);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    if (1 == commands.count()) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
        PhoneAction *action = mapCommandToAction(commands.at(0));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
        if (action) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
            translatedActions[PhoneAction::LeftButton] = action;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    } else if (1 < commands.count()){
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
        PhoneAction *action = mapCommandToAction(commands.at(0));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
        PhoneAction *action2 = mapCommandToAction(commands.at(1));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
        if (action) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
            translatedActions[PhoneAction::LeftButton] = action;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
        if (action2) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
            translatedActions[PhoneAction::RightButton] = action2;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
    return translatedActions;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   129
QList<PhoneAction *> PhoneUiCommandController::toolBarActions( 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   130
        int resourceId,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   131
        QMap<int,int> callStates,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   132
        QMap<int,int> serviceIds,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   133
        int serviceId,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   134
        int callId)
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   135
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   136
    QList<PhoneAction *> actions;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   137
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   138
    //Set tool bar button flags
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   139
    setJoinFlag(callStates, serviceIds);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   140
    setConferenceFlag(callStates.values());
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   141
    setHoldFlag(callStates.value(callId));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   142
    setMultiCallFlag(callStates.values());
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   143
    setOutgoingFlag(callStates.values());
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   144
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   145
    //Get tool bar item list by resource id.
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   146
    QList<PhoneAction::ToolBarItem> commands = PhoneResourceAdapter::Instance()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   147
            convertToToolBarCommandList(resourceId);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   148
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   149
    if (serviceId != -1) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   150
        PhoneCommandExtensionWrapper *extension = commandExtension(serviceId);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   151
        
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   152
        if (extension) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   153
            QList<XQTelUiCommandExtension::CallInfo> callInfo;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   154
            extension->getCallInfoList(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   155
                    callInfo,callStates,serviceIds,callId);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   156
            
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   157
            QList<XQTelUiCommandExtension::ToolBarCommand> toolBarCmdList;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   158
            
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   159
            mapToExtensionToolBarItems(commands,toolBarCmdList);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   160
            //Modify tool bar command list by extension
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   161
            extension->modifyToolBarCommandList(callInfo,toolBarCmdList);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   162
            // Map tool bar item list back to the phone action tool bar item list.
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   163
            mapToPhoneActionToolBarItems(toolBarCmdList,commands);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   164
        }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   165
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   166
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   167
    for ( int i=0; i < commands.count(); ++i) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   168
        PhoneAction *action = mapCommandToAction(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   169
                commands.at(i).mCommandId, !commands.at(i).mEnabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   170
        if (action) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   171
            actions.append(action);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   172
        }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   173
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   174
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   175
    return actions;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   176
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   177
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
QList<int> PhoneUiCommandController::menuCommands(
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   179
        QMap<int,int> callStates, QMap<int,int> serviceIds ) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    PHONE_DEBUG("PhoneMenuController::menuCommands");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
    QList<int> commands;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
    bool sameServices = areServicesSame(callStates,serviceIds);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
    switch(callStates.values().count()) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
    case 1: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
        // No logical string for switch to video option	
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
        /*if (callStates.values().contains(EPEStateConnected)) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
            commands.append(PhoneInCallCmdSwitchToVideo);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
        }*/
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
    case 2: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
        if (!callStates.values().contains(EPEStateRinging) &&
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
            !callStates.values().contains(EPEStateDisconnecting) &&
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
            !callStates.values().contains(EPEStateDialing)) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
            commands.append(PhoneInCallCmdEndAllCalls);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
        if (callStates.values().contains(EPEStateConnected) &&
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
            callStates.values().contains(EPEStateHeld)) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
            if (sameServices) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
                commands.append(PhoneInCallCmdTransfer);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
    case 3: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
        commands.append(PhoneInCallCmdEndAllCalls);    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
    default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
        break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    return commands;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
void PhoneUiCommandController::addMenuItems(QList<int> menuCmdList)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
    QList<PhoneAction*> values;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
    for (int i=0;i<menuCmdList.count();++i) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
        int command = mapCommand(menuCmdList.at(i));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
        if (-1 != command) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
            PhoneAction* phoneAction = new PhoneAction();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
            phoneAction->setCommand(command);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
            phoneAction->setText(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
                    PhoneResourceAdapter::Instance()->
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
                        convertCommandToString(command));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
            values.append(phoneAction);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
    m_view.setMenuActions(values);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
    qDeleteAll(values);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   239
int PhoneUiCommandController::mapCommand(int command) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
    int ret(-1);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
    switch(command) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    case PhoneInCallCmdEndAllCalls:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
        ret = EPhoneInCallCmdEndAllCalls;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
        break;     
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
    case PhoneInCallCmdTransfer:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
        ret = EPhoneInCallCmdTransfer;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
        break;    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
    case PhoneInCallCmdSwitchToVideo:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
        ret = EPhoneInCallCmdSwitchToVideo;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
        break;  
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    case PhoneInCallCmdHandoverToWlan:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
        ret = EPhoneCmdHandoverToWlan;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
        break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
    case PhoneInCallCmdHandoverToGsm:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        ret = EPhoneCmdHandoverToGsm;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
        break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
    default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
        break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
    return ret;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
PhoneCommandExtensionWrapper *PhoneUiCommandController::commandExtension(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
        int serviceId)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
    PhoneCommandExtensionWrapper *extension = 0;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
    TRAP_IGNORE( extension = CommandExtensionL(serviceId) );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
    return extension;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
TUid PhoneUiCommandController::ResolveImplementationUidL( 
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   275
        TUint32 aServiceId, TServicePropertyName aPropertyName ) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
    {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
    TUid implUid = { 0 };
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
    CSPEntry* entry = CSPEntry::NewLC();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
    CSPSettings* spSettings = CSPSettings::NewLC(); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
    User::LeaveIfError(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
        spSettings->FindEntryL( aServiceId, *entry ) ); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
    CleanupStack::PopAndDestroy( spSettings ); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
    const CSPProperty* property = NULL;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
    User::LeaveIfError( entry->GetProperty( property, aPropertyName ) );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
    if ( property ) 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
        TInt temp(0);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
        User::LeaveIfError( property->GetValue( temp ) );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
        implUid.iUid = temp;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
    CleanupStack::PopAndDestroy( entry );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
    return implUid;   
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
PhoneCommandExtensionWrapper 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
    *PhoneUiCommandController::CommandExtensionL( TUint aServiceId )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
    TUid pluginUid = ResolveImplementationUidL( aServiceId, 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
        EPropertyCallMenuHandlerPluginId );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
    int pluginInd(-1);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
    PhoneCommandExtensionWrapper* wrapper = NULL;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
    for (int i=0; i<m_commandExtensions.count();++i) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
        if (pluginUid.iUid==m_commandExtensions.at(i)->pluginUid()) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
            pluginInd = i;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
            break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
    if ( -1 == pluginInd )
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
        wrapper = new PhoneCommandExtensionWrapper( pluginUid.iUid );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
        if (wrapper)
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
            m_commandExtensions.append( wrapper );
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
    else
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
        {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
        wrapper = m_commandExtensions[pluginInd];
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
    m_lastCommandExtension = wrapper;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
    return wrapper;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
void PhoneUiCommandController::releaseMenu()
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
    PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions");
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
    for (int i=0;i<m_customMenuActions.count();i++) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
        m_view.menuReference().removeAction(m_customMenuActions.at(i));
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
    m_customMenuActions.clear();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
    if (m_lastCommandExtension) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
        m_lastCommandExtension->releaseMenu();
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
        m_lastCommandExtension = 0;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
bool PhoneUiCommandController::areServicesSame(
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   347
        QMap<int,int> callStates, QMap<int,int> serviceIds) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
    bool ret(true);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
    int serviceId(-1);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
    for(int i=0;i<callStates.count()&&ret;++i) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
        if (-1==serviceId) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
            serviceId = serviceIds.value(callStates.keys().at(i));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   354
        } else if (serviceId != serviceIds.value(callStates.keys().at(i))) {
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
            ret = false;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
    return ret;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   362
void PhoneUiCommandController::setJoinFlag(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   363
        QMap<int,int> callStates, QMap<int,int> serviceIds) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   364
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   365
    bool disable(PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   366
                    getButtonFlags(PhoneUIQtButtonsController::FullConference));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   367
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   368
    if (!disable) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   369
        disable = !areServicesSame(callStates, serviceIds);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   370
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   371
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   372
    PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   373
            setButtonFlags(PhoneUIQtButtonsController::DisableJoin, disable);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   374
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   375
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   376
void PhoneUiCommandController::setHoldFlag(int callState) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   377
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   378
    bool hold = (callState == EPEStateHeldConference ||
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   379
                 callState == EPEStateHeld );
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   380
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   381
    PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   382
            setButtonFlags(PhoneUIQtButtonsController::Hold,hold);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   383
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   384
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   385
void PhoneUiCommandController::setOutgoingFlag(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   386
        QList<int> callStates) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   387
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   388
    bool outgoing(callStates.contains(EPEStateDialing) ||
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   389
                  callStates.contains(EPEStateConnecting));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   390
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   391
    PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   392
            setButtonFlags(PhoneUIQtButtonsController::Outgoing, outgoing);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   393
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   394
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   395
void PhoneUiCommandController::setConferenceFlag(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   396
        QList<int> callStates) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   397
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   398
    bool conference(callStates.contains(EPEStateConnectedConference) ||
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   399
                    callStates.contains(EPEStateHeldConference));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   400
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   401
    PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   402
            setButtonFlags(PhoneUIQtButtonsController::Conference, conference);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   403
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   404
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   405
void PhoneUiCommandController::setMultiCallFlag(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   406
        QList<int> callStates) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   407
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   408
    bool multicall(false);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   409
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   410
    if (1<callStates.count()) {  
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   411
        if (callStates.count() == 2 && callStates.contains(EPEStateRinging)) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   412
            multicall = false;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   413
        } else {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   414
            multicall = true;   
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   415
        }        
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   416
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   417
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   418
    PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   419
            setButtonFlags(PhoneUIQtButtonsController::MultiCall, multicall);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   420
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   421
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   422
void PhoneUiCommandController::mapToExtensionToolBarItems(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   423
        const QList<PhoneAction::ToolBarItem> &sourceList, 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   424
        QList<XQTelUiCommandExtension::ToolBarCommand> &toolBarCmdList) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   425
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   426
    toolBarCmdList.clear();
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   427
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   428
    for (int i=0;i<sourceList.count();++i) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   429
        XQTelUiCommandExtension::ToolBarCommand command;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   430
        command.mCommandId = sourceList.at(i).mCommandId;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   431
        command.mIsEnabled = sourceList.at(i).mEnabled;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   432
        toolBarCmdList.append(command);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   433
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   434
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   435
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   436
void PhoneUiCommandController::mapToPhoneActionToolBarItems( 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   437
        const QList<XQTelUiCommandExtension::ToolBarCommand> &sourceList,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   438
        QList<PhoneAction::ToolBarItem> &commandList) const
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   439
{
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   440
    commandList.clear();
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   441
    
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   442
    for (int i=0;i<sourceList.count();++i) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   443
        PhoneAction::ToolBarItem command(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   444
                sourceList.at(i).mCommandId,
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   445
                sourceList.at(i).mIsEnabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   446
        commandList.append(command);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   447
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   448
}
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   449
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
QList<int> PhoneUiCommandController::buttonCommandList(
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
        int callState,
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
        bool emergencyCall,
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   453
        QList<int> callStates) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
    QList<int> ret;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
    switch( callState ) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
    case EPEStateIdle:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
    case EPEStateDisconnecting:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
    case EPEStateConferenceIdle:    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
    case EPEStateDialing:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
    case EPEStateConnecting: {
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   465
        if (!emergencyCall) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   466
            if (PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   467
                    getButtonFlags(PhoneUIQtButtonsController::Mute)) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   468
                ret.append(PhoneInCallCmdUnmute);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   469
            } else {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   470
                ret.append(PhoneInCallCmdMute);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   471
            }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   472
        }
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
        ret.append(PhoneInCallCmdEndOutgoingCall);  
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
    case EPEStateRinging: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
        if (callStates.size()<3){
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
            ret.append(PhoneInCallCmdAnswer);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
            ret.append(PhoneInCallCmdReject); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
        } else {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
            ret.append(PhoneInCallCmdReplace); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
    case EPEStateConnected:
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   487
    case EPEStateConnectedConference:     
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
    case EPEStateHeld:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
    case EPEStateHeldConference: {
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   490
        if (!emergencyCall) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   491
            if (PhoneResourceAdapter::Instance()->buttonsController()->
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   492
                    getButtonFlags(PhoneUIQtButtonsController::Mute)) {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   493
                ret.append(PhoneInCallCmdUnmute);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   494
            } else {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   495
                ret.append(PhoneInCallCmdMute);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
            }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
        }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
        ret.append(PhoneInCallCmdEndActive);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
    case EPEStateUnknown:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
    default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
    break;    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
    return ret;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
}
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   513
PhoneAction *PhoneUiCommandController::mapCommandToAction(
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   514
        int command, bool disabled) const
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
{
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
    PhoneAction *action=0;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
    switch( command ) {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
    case PhoneInCallCmdJoinToConference: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
        action->setIcon(HbIcon("qtg_mono_join_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   522
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
        action->setCommand(EPhoneInCallCmdJoin);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
    case PhoneInCallCmdCreateConference: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
        action->setIcon(HbIcon("qtg_mono_join_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   530
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
        action->setCommand(EPhoneInCallCmdCreateConference);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
        
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
    case PhoneInCallCmdAnswer: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
        action->setIcon(HbIcon("qtg_mono_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   538
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   539
        action->setCommand (EPhoneCallComingCmdAnswer);        
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
        action->setActionRole(PhoneAction::Accept);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
    case PhoneInCallCmdReject: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
        action->setIcon(HbIcon("qtg_mono_reject_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   547
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
        action->setCommand (EPhoneCallComingCmdReject);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
        action->setActionRole(PhoneAction::Decline);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
    case PhoneInCallCmdHold: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
        action->setIcon(HbIcon("qtg_mono_hold_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   556
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
        action->setCommand(EPhoneInCallCmdHold);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
    case PhoneInCallCmdUnhold: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
        action->setIcon(HbIcon("qtg_mono_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   564
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
        action->setCommand(EPhoneInCallCmdUnhold);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
    case PhoneInCallCmdEndActive: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
        action->setIcon(HbIcon("qtg_mono_end_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   572
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
        action->setCommand(EPhoneInCallCmdEndThisActiveCall);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
        action->setActionRole(PhoneAction::Decline);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
    case PhoneInCallCmdEndOutgoingCall: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
        action->setIcon(HbIcon("qtg_mono_end_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   581
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
        action->setCommand(EPhoneInCallCmdEndThisOutgoingCall);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
        action->setActionRole(PhoneAction::Decline);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
    case PhoneInCallCmdReplace: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
        action = new PhoneAction;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
        action->setIcon(HbIcon("qtg_mono_replace_call"));
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   590
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
        action->setCommand(EPhoneInCallCmdReplace);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
        action->setActionRole(PhoneAction::Accept);
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
    
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
    case PhoneInCallCmdSwap: {
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
        action = new PhoneAction;
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   598
        action->setIcon(HbIcon("qtg_mono_replace_call"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   599
        action->setDisabled(disabled);
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
        action->setCommand(EPhoneInCallCmdSwap); 
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
    break;
45
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   603
    case PhoneCallComingCmdSoftReject: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   604
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   605
        action->setIcon(HbIcon("qtg_mono_send"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   606
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   607
        action->setCommand(EPhoneCallComingCmdSoftReject); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   608
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   609
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   610
    case PhoneCallComingCmdSilent: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   611
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   612
        action->setIcon(HbIcon("qtg_mono_speaker_off"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   613
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   614
        action->setCommand(EPhoneCallComingCmdSilent); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   615
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   616
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   617
    case PhoneInCallCmdOpenDialer: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   618
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   619
        action->setIcon(HbIcon("qtg_mono_dialer"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   620
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   621
        action->setCommand(EPhoneInCallCmdDialer); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   622
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   623
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   624
    case PhoneInCallCmdMute: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   625
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   626
        action->setIcon(HbIcon("qtg_mono_mic_mute"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   627
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   628
        action->setCommand(EPhoneInCallCmdMute); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   629
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   630
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   631
    case PhoneInCallCmdUnmute: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   632
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   633
        action->setIcon(HbIcon("qtg_mono_mic_unmute"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   634
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   635
        action->setCommand(EPhoneInCallCmdUnmute); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   636
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   637
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   638
    case PhoneInCallCmdActivateIhf: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   639
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   640
        action->setIcon(HbIcon("qtg_mono_speaker"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   641
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   642
        action->setCommand(EPhoneInCallCmdActivateIhf); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   643
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   644
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   645
    case PhoneInCallCmdDeactivateIhf: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   646
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   647
        action->setIcon(HbIcon("qtg_mono_mobile"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   648
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   649
        action->setCommand(EPhoneInCallCmdDeactivateIhf); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   650
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   651
    break;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   652
    case PhoneInCallCmdOpenContacts: {
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   653
        action = new PhoneAction;
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   654
        action->setIcon(HbIcon("qtg_mono_contacts"));
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   655
        action->setDisabled(disabled);
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   656
        action->setCommand(EPhoneInCallCmdContacts); 
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   657
    }
6b911d05207e Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 37
diff changeset
   658
    break;
37
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
    default:
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
    break;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
    }
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
            
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
    return action;
ba76fc04e6c2 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
}