phoneapp/phoneuiqtviewadapter/inc/phoneuicommandcontroller.h
changeset 21 92ab7f8d0eab
child 45 6b911d05207e
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*!
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Handles phone ui commands.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PHONEUICOMMANDCONTROLLER_H
       
    19 #define PHONEUICOMMANDCONTROLLER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QString>
       
    23 #include <hbmenu.h>
       
    24 #include <spdefinitions.h>
       
    25 #include "phonecommandextensionwrapper.h"
       
    26 #include "phoneuiqtviewif.h"
       
    27 #include "phoneaction.h"
       
    28 
       
    29 // FORWARD DECLARATION
       
    30 class HbAction;
       
    31 
       
    32 class PhoneUiCommandController : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35     
       
    36 public:
       
    37 
       
    38     /*!
       
    39         \fn PhoneUiCommandController(
       
    40             PhoneUIQtViewIF &m_view, QObject *parent)
       
    41     */
       
    42     PhoneUiCommandController(PhoneUIQtViewIF &view, QObject *parent = 0);
       
    43         
       
    44     /*!
       
    45         Destructor
       
    46      */
       
    47     virtual ~PhoneUiCommandController();
       
    48     
       
    49     /*!
       
    50         \fn void showGlobalNote()
       
    51         
       
    52         Sets call menu actions.
       
    53 
       
    54     */
       
    55     void setCallMenuActions(QMap<int,int> callStates,
       
    56                             QMap<int,int> serviceIds,
       
    57                             int serviceId,
       
    58                             int expandedCallId);
       
    59 
       
    60     /*!
       
    61         \fn void setDialpadMenuActions ()
       
    62         
       
    63         Sets dialpad menu actions.
       
    64 
       
    65     */
       
    66     void setDialpadMenuActions();
       
    67     
       
    68     /*!
       
    69         \fn void pushButtonActionsForCall ()
       
    70         
       
    71         Returns push button actions actions for call.
       
    72 
       
    73     */
       
    74     QMap<PhoneAction::ActionType, PhoneAction *> pushButtonActionsForCall( 
       
    75             int callState,
       
    76             bool emergencyCall,
       
    77             QMap<int,int> callStates,
       
    78             QMap<int,int> serviceIds,
       
    79             int serviceId,
       
    80             int callId);
       
    81     
       
    82 private:
       
    83 
       
    84     /*!
       
    85         \fn QList<int> menuCommands()
       
    86         
       
    87         Returns list of current menu commands.
       
    88 
       
    89     */
       
    90     QList<int> menuCommands(
       
    91             QMap<int,int> callStates, QMap<int,int> serviceIds );
       
    92     
       
    93     /*!
       
    94         \fn void addMenuItems()
       
    95         
       
    96         Adds menu commands to menu.
       
    97     */
       
    98     void addMenuItems(QList<int> menuCmdList);
       
    99     
       
   100     /*!
       
   101         \fn int mapCommand()
       
   102         
       
   103         Maps ui command extension commands to
       
   104         phone app commands.
       
   105     */
       
   106     int mapCommand(int command);
       
   107     
       
   108     /*!
       
   109         \fn void commandExtension()
       
   110         
       
   111         Returns command extension by service id (null if
       
   112         extension not available).
       
   113     */
       
   114     PhoneCommandExtensionWrapper *commandExtension(int serviceId);
       
   115 
       
   116     /*!
       
   117         \fn void ResolveImplementationUidL()
       
   118         
       
   119         Returns service's plugin uid by service id.
       
   120     */
       
   121     TUid ResolveImplementationUidL( 
       
   122             TUint32 aServiceId, TServicePropertyName aPropertyName );
       
   123     
       
   124     /*!
       
   125         \fn void MenuExtensionL()
       
   126         
       
   127         Returns command extension by service id (null if
       
   128         extension not available).
       
   129     */
       
   130     PhoneCommandExtensionWrapper *CommandExtensionL( TUint aServiceId );
       
   131     
       
   132     /*!
       
   133         \fn void releaseMenu()
       
   134         
       
   135         Releases extensions menu.
       
   136     */
       
   137     void releaseMenu();
       
   138        
       
   139     /*!
       
   140         \fn void areServicesSame()
       
   141         
       
   142         Checks are all calls made by same service (id).
       
   143         Returns true when same service used.
       
   144     */
       
   145     bool areServicesSame(QMap<int,int> callStates, QMap<int,int> serviceIds);
       
   146     
       
   147     /*!
       
   148         \fn void buttonCommandList()
       
   149         
       
   150         Returns push button command list.
       
   151     */    
       
   152     QList<int> buttonCommandList(int callState,
       
   153             bool emergencyCall,
       
   154             bool sameServices,
       
   155             QList<int> callStates);
       
   156     
       
   157     /*!
       
   158         \fn void buttonCommandList()
       
   159         
       
   160         Maps push button command to phone action.
       
   161     */
       
   162     PhoneAction *mapCommandToAction(int callState);
       
   163     
       
   164     
       
   165     
       
   166 private:
       
   167 
       
   168     PhoneUIQtViewIF &m_view;
       
   169     QList<HbAction *> m_customMenuActions;
       
   170     QList<PhoneCommandExtensionWrapper *> m_commandExtensions;
       
   171     PhoneCommandExtensionWrapper *m_lastCommandExtension;
       
   172     
       
   173 };
       
   174 
       
   175 #endif // PHONEUICOMMANDCONTROLLER_H