phoneapp/phoneuiqtviewadapter/inc/phonecommandextensionwrapper.h
branchRCL_3
changeset 61 41a7f70b3818
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
       
     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:  Wraps phone menu extensions.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PHONECOMMANDEXTENSIONWRAPPER_H
       
    19 #define PHONECOMMANDEXTENSIONWRAPPER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QString>
       
    23 #include <hbaction.h>
       
    24 #include <xqteluicommandextension.h>
       
    25 
       
    26 
       
    27 class PhoneCommandExtensionWrapper : public QObject
       
    28 {
       
    29     Q_OBJECT
       
    30     
       
    31 public:
       
    32 
       
    33     /*!
       
    34         \fn PhoneMenuExtensionWrapper (QObject *parent)
       
    35     */
       
    36     PhoneCommandExtensionWrapper(int pluginUid);
       
    37         
       
    38     /*!
       
    39         Destructor
       
    40      */
       
    41     virtual ~PhoneCommandExtensionWrapper();
       
    42     
       
    43     /*!
       
    44         \fn void showGlobalNote ()
       
    45         
       
    46         This method shows global note.
       
    47 
       
    48     */
       
    49     int pluginUid();
       
    50 
       
    51     /*!
       
    52         \fn void modifyMenuItemList(QList<int> &menuCmdList)
       
    53         
       
    54         Modifies menu command list. List contains current list
       
    55         of menu commands. Interface can add new commands which should be hanled
       
    56         by call handling or remove commands if list contains unsupported call
       
    57         commands.
       
    58     */
       
    59     void modifyMenuCommandList(
       
    60             const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
       
    61             QList<int> &menuCmdList);
       
    62 
       
    63     /*!
       
    64         \fn void modifyButtonCommandList(QList<int> &menuCmdList)
       
    65         
       
    66         Modifies push button command list. CallInfo contains current call 
       
    67         information and buttonCmdList contains current list of push 
       
    68         button commands. 
       
    69         Interface can remove commands if list contains unsupported call
       
    70         commands (For example if service doesn't support conference call)
       
    71         or add commads which should be handled by telephony call 
       
    72         handling (maximum amount of push button commands is two).
       
    73     */
       
    74     void modifyPushButtonCommandList(
       
    75             const QList<XQTelUiCommandExtension::CallInfo> &callInfo, 
       
    76             QList<int> &buttonCmdList);
       
    77  
       
    78     /*!
       
    79         \fn void modifyToolBarCommandList(QList<int> &menuCmdList)
       
    80         
       
    81         Modifies tool bar command list. CallInfo contains current call 
       
    82         information and toolBarCmdList contains current list of tool 
       
    83         bar commands. 
       
    84         Interface can remove/disable commands if the command list contains 
       
    85         unsupported call commands (For example if service doesn't support 
       
    86         conference call) or add commads which should be handled by telephony  
       
    87         call handling (maximum amount of tool bar commands is 4 and list
       
    88         index 0 is used for right button).
       
    89     */
       
    90     void modifyToolBarCommandList(
       
    91             const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
       
    92             QList<XQTelUiCommandExtension::ToolBarCommand> &toolBarCmdList);
       
    93     
       
    94     /*!
       
    95         \fn void addMenuActions(QList<HbAction*> &menuActions)
       
    96         
       
    97         Adds actions to menu. Interface adds own actions to the list which
       
    98         should be added to the call menu. 
       
    99         Interface is the responsible for handling action triggers.
       
   100         Ownership of the actions in not transferred.
       
   101     */
       
   102     void addMenuActions(
       
   103             const QList<XQTelUiCommandExtension::CallInfo> &callInfo,
       
   104             QList<HbAction*> &menuActions);
       
   105     
       
   106     /*!
       
   107         \fn void releaseMenu()
       
   108         
       
   109         Releases menu actions. Method is called when menu is not needed
       
   110         anymore and interface can release own menu actions.
       
   111     */
       
   112     void releaseMenu();
       
   113     
       
   114     /*!
       
   115         \fn void release()
       
   116         
       
   117         Releases plugin. Method is called when menu plugin is not needed
       
   118         anymore and interface can release all resources.
       
   119     */
       
   120     void release();
       
   121 
       
   122     /*!
       
   123         \fn void getCallInfoList()
       
   124         
       
   125         Gets call list information by call state and
       
   126         service id map.
       
   127     */
       
   128     void getCallInfoList( QList<XQTelUiCommandExtension::CallInfo> &callInfo,
       
   129                           QMap<int,int> callStates, 
       
   130                           QMap<int,int> serviceIds, 
       
   131                           int expandedCall);
       
   132     
       
   133 private:
       
   134         
       
   135     /*!
       
   136         \fn void mapCallState()
       
   137         
       
   138         Converts phoneengine call state to ui command extension
       
   139         call state.
       
   140         
       
   141         returns converted call state.
       
   142     */
       
   143     XQTelUiCommandExtension::CallState mapCallState( int callState );
       
   144     
       
   145 private:
       
   146 
       
   147     XQTelUiCommandExtension *m_plugin;
       
   148     int m_pluginUid;
       
   149     
       
   150 };
       
   151 
       
   152 #endif // PHONECOMMANDEXTENSIONWRAPPER_H