phone_plat/telephony_menu_extension_api/inc/xqteluicommandextension.h
changeset 21 92ab7f8d0eab
child 45 6b911d05207e
equal deleted inserted replaced
4:c84cf270c54f 21:92ab7f8d0eab
       
     1 /*!
       
     2 * Copyright (c) 2010 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: Defines interface for manipulating telephony call menus.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef XQTELUICOMMANDEXTENSION_H
       
    19 #define XQTELUICOMMANDEXTENSION_H
       
    20 
       
    21 #include <qobject>
       
    22 #include <hbaction.h>
       
    23 
       
    24 
       
    25 #ifdef BUILD_DLL
       
    26 #define DLL_EXPORT Q_DECL_EXPORT
       
    27 #else
       
    28 #define DLL_EXPORT Q_DECL_IMPORT
       
    29 #endif
       
    30 
       
    31 /*!
       
    32     XQTelUiCommandExtension
       
    33     Defines interface for manipulating telephony call menus.
       
    34     
       
    35 */
       
    36 class DLL_EXPORT XQTelUiCommandExtension 
       
    37 {
       
    38     
       
    39 public:
       
    40         
       
    41     /*!
       
    42        Specifies call states.
       
    43     */
       
    44     enum CallState
       
    45         {
       
    46         None = 0,
       
    47         Disconnecting = 1, // Call is disconnecting
       
    48         Active = 2, // Call is active
       
    49         OnHold = 3, // Call is on hold
       
    50         Incoming = 4, // Call is ringing
       
    51         Outgoing = 5 // Call is dialling or connecting
       
    52         };
       
    53         
       
    54     /*!
       
    55        Capsulates call info.
       
    56     */
       
    57     class CallInfo
       
    58         {
       
    59     public:
       
    60         
       
    61         // Service provider settings item Id
       
    62         int mServiceId;
       
    63         
       
    64         // Calls state
       
    65         int mCallState;
       
    66         
       
    67         // Is call header expanded
       
    68         bool mIsExpanded;
       
    69 
       
    70         };
       
    71     
       
    72     /*!
       
    73         \fn void modifyMenuItemList(QList<int> &menuCmdList)
       
    74         
       
    75         Modifies menu command list. CallInfo contains current call information and 
       
    76         menuCmdList contains current list of menu commands. 
       
    77         Interface can add new commands which should be hanled by telephony
       
    78         call handling or remove commands if list contains unsupported call
       
    79         commands.
       
    80     */
       
    81     virtual void modifyMenuCommandList(const QList<CallInfo> &callInfo,
       
    82                                        QList<int> &menuCmdList) = 0;
       
    83                                        
       
    84     /*!
       
    85         \fn void modifyButtonCommandList(QList<int> &menuCmdList)
       
    86         
       
    87         Modifies push button command list. CallInfo contains current call 
       
    88         information and buttonCmdList contains current list of push 
       
    89         button commands. 
       
    90         Interface can remove commands if list contains unsupported call
       
    91         commands (For example if service doesn't support conference call)
       
    92         or add commads which should be handled by telephony call 
       
    93         handling (maximum amount of push button commands is 2 and list
       
    94         index 0 is used for right button).
       
    95     */
       
    96     virtual void modifyPushButtonCommandList(const QList<CallInfo> &callInfo,
       
    97                                              QList<int> &buttonCmdList) = 0;
       
    98     
       
    99     /*!
       
   100         \fn void addMenuActions(QList<HbAction*> &menuActions)
       
   101         
       
   102         Adds custom actions to the call menu. CallInfo contains current call 
       
   103         information. Interface could add own actions to the menu actions 
       
   104         list and actions will be added to the call menu. 
       
   105         Interface is the responsible for handling action triggers.
       
   106         Ownership of the actions in not transferred.
       
   107     */
       
   108     virtual void addMenuActions(const QList<CallInfo> &callInfo,
       
   109                                 QList<HbAction*> &menuActions) = 0;
       
   110     
       
   111     /*!
       
   112         \fn void releaseMenu()
       
   113         
       
   114         Releases menu actions. Method is called when menu is not needed
       
   115         anymore and interface can release own menu actions.
       
   116     */
       
   117     virtual void releaseMenu() = 0;
       
   118     
       
   119     /*!
       
   120         \fn void release()
       
   121         
       
   122         Releases plugin. Method is called when menu extension plugin is 
       
   123         not needed anymore and interface can release all resources and
       
   124         plugin itself.
       
   125     */
       
   126     virtual void release() = 0;
       
   127     
       
   128 };
       
   129 
       
   130 Q_DECLARE_INTERFACE(XQTelUiCommandExtension, "com.nokia.telephony.XQTelUiCommandExtension/1.0" );
       
   131 
       
   132 #endif // XQTELUICOMMANDEXTENSION_H
       
   133