phonesrv_plat/phone_client_command_handler_api/inc/CPhCltCommandHandler.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2003-2004 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:  API for PhoneClient Command Handler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCLTCOMMANDHANDLER_H
       
    20 #define CPHCLTCOMMANDHANDLER_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <phclttypes.h> 
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RPhCltServer;
       
    30 
       
    31 /**
       
    32 * Commands.
       
    33 *
       
    34 * EPhCltCommandAtd      Dial command.
       
    35 * 
       
    36 * EPhCltCommandAta      Answer command.
       
    37 * 
       
    38 * EPhCltCommandChld     Call hold and multiparty handling command.
       
    39 * 
       
    40 * EPhCltCommandChup     Hangup command.
       
    41 * 
       
    42 * EPhCltCommandVts      DTMF sending (start and stop) command.
       
    43 * 
       
    44 * EPhCltCommandBvra     Bluetooth Voice Recognition Activation command.
       
    45 * 
       
    46 * EPhCltCommandMuteMic          Microphone mute command.
       
    47 * 
       
    48 * EPhCltCommandMuteRingingTone  Ringing tone mute command.
       
    49 */
       
    50 enum TPhCltComHandCommand
       
    51     {
       
    52     EPhCltCommandAtd  = 0,
       
    53     EPhCltCommandAta  = 1,
       
    54     EPhCltCommandChld = 2,
       
    55     EPhCltCommandChup = 3,
       
    56     EPhCltCommandVts  = 4,
       
    57     EPhCltCommandBvra    = 5,
       
    58     EPhCltCommandMuteMic = 6,
       
    59     EPhCltCommandMuteRingingTone = 7
       
    60     };
       
    61     
       
    62     
       
    63 /**
       
    64 * CHLD commands.
       
    65 *
       
    66 * EPhCltChldZero   
       
    67 *      Release held calls or set UDUB for a waiting call.
       
    68 * 
       
    69 * EPhCltChldOne
       
    70 *      Release all active calls and accept other (held or waiting) call.
       
    71 * 
       
    72 * EPhCltChldTwo 
       
    73 *      Place all active calls on hold and accept the other 
       
    74 *      (held or waiting) call.
       
    75 * 
       
    76 * EPhCltChldThree
       
    77 *      Add a held call to the conversation.
       
    78 * 
       
    79 * EPhCltChldFour
       
    80 *      Connect the two calls and disconnect the subscriber from both 
       
    81 *      calls (Explicit call transfer).
       
    82 */
       
    83 enum TPhCltChldCommand
       
    84     {
       
    85     EPhCltChldZero  = 0,
       
    86     EPhCltChldOne   = 1,
       
    87     EPhCltChldTwo   = 2,
       
    88     EPhCltChldThree = 3,
       
    89     EPhCltChldFour  = 4,
       
    90     };
       
    91     
       
    92 /** 
       
    93 * Type of DTMF tone. 
       
    94 * One tone, i.e. one character.
       
    95 */
       
    96 typedef TChar TPhCltDtmfTone;
       
    97 
       
    98 
       
    99 /**
       
   100 * DTMF actions.
       
   101 *
       
   102 * EPhCltDtmfNotUsed  
       
   103 *      Play DTMF tone default time. In this case 
       
   104 *      DTMF sending need not be stoped by the client.
       
   105 * 
       
   106 * EPhCltDtmfStart
       
   107 *      Start Dtmf sending. Remember to always stop it with EPhCltDtmfStop.
       
   108 * 
       
   109 * EPhCltDtmfStop
       
   110 *      Stop DTMF sending that was started with EPhCltDtmfStart.
       
   111 * 
       
   112 */
       
   113 enum TPhCltDtmfAction
       
   114     {
       
   115     EPhCltDtmfNotUsed = 0,
       
   116     EPhCltDtmfStart   = 1,
       
   117     EPhCltDtmfStop    = 2
       
   118     };
       
   119     
       
   120 
       
   121 /*
       
   122 * The CommandHandler command parameters defined as in one class.
       
   123 * The handler of received command handler commads must first check the
       
   124 * performed command, and then read the appropriate parameters.
       
   125 */
       
   126 class TPhCltComHandCommandParameters
       
   127     {
       
   128     public:    // Data  
       
   129 
       
   130         // The command handler command to be performed.
       
   131         TPhCltComHandCommand                iCommandHandlerCommand;
       
   132 
       
   133         // Dial command parameter.
       
   134         TPhCltTelephoneNumber               iTelNumber;
       
   135         
       
   136         // Chld command parameter.
       
   137         TPhCltChldCommand                   iChldCommand;
       
   138         // Chld command parameter.
       
   139         TUint                               iChldCallNumber;
       
   140 
       
   141         // Vts command parameter.
       
   142         TPhCltDtmfTone                      iDtmfTone;
       
   143         // Vts command parameter.
       
   144         TPhCltDtmfAction                    iDtmfAction;
       
   145 
       
   146         // Bvra command parameter.
       
   147         TBool                               iBvraActivation;
       
   148 
       
   149         // Mic Mute command parameter.
       
   150         TBool                               iMute;
       
   151         
       
   152     };
       
   153 
       
   154 
       
   155 
       
   156 // CLASS DECLARATION
       
   157 
       
   158 /**
       
   159 *  Interface for Command Handler requests.
       
   160 *  At most one asynchronous request can be ongoing at the same time!
       
   161 *
       
   162 *  @lib PhoneClient.lib
       
   163 *  @since 3.2
       
   164 */
       
   165 class CPhCltCommandHandler : public CBase
       
   166     {
       
   167     
       
   168     
       
   169     public:  // Constructors    
       
   170         /**
       
   171         * Two-phased constructor.
       
   172         */
       
   173         IMPORT_C static CPhCltCommandHandler* NewL();
       
   174         
       
   175         
       
   176     public: // New functions
       
   177 
       
   178         /**
       
   179         * Dial. Only voice call is supported.
       
   180         *
       
   181         * @param aStatus The status updated when function call is completed.
       
   182         *                KErrNone if successful, Symbian error code otherwise.
       
   183         * @param aTelephoneNumber The dial information.
       
   184         */
       
   185         IMPORT_C virtual void Atd(
       
   186             TRequestStatus& aStatus, 
       
   187             const TPhCltTelephoneNumber& aTelephoneNumber ) = 0;
       
   188 
       
   189         /**
       
   190         * Answer the call. 
       
   191         * Does not need response according to specification.
       
   192         *  
       
   193         * @param aStatus The status updated when function call is completed.
       
   194         *                KErrNone if successful, Symbian error code otherwise.
       
   195         *                KErrNotReady if there is no call to be answered.
       
   196         */
       
   197         IMPORT_C virtual void Ata(
       
   198             TRequestStatus& aStatus ) = 0;
       
   199 
       
   200 
       
   201         /**
       
   202         * Call hold and multiparty handling.
       
   203         * 
       
   204         * @param aStatus The status updated when function call is completed.
       
   205         *                KErrNone if successful, Symbian error code otherwise.
       
   206         * @param aChldCommand The command to be performed.
       
   207         * @param aCallNumber The call number where the command specified in
       
   208         *                    aChldCommand is targeted. 
       
   209         *                    Not used currently.
       
   210         */
       
   211         IMPORT_C virtual void Chld(
       
   212             TRequestStatus& aStatus, 
       
   213             const TPhCltChldCommand aChldCommand,
       
   214             const TUint aCallNumber ) = 0;
       
   215 
       
   216 
       
   217         /**
       
   218         * Hang up current call.
       
   219         * Does not need response according to specification.
       
   220         *  
       
   221         * @param aStatus The status updated when function call is completed.
       
   222         *                KErrNone if successful, Symbian error code otherwise.
       
   223         */
       
   224         IMPORT_C virtual void Chup(
       
   225             TRequestStatus& aStatus ) = 0;
       
   226 
       
   227 
       
   228         /**
       
   229         * DTMF sending, starting and stopping in same function. 
       
   230         * Does not need response according to specification.
       
   231         *
       
   232         * @param aStatus The status updated when function call is completed.
       
   233         *                KErrNone if successful, Symbian error code otherwise.
       
   234         * @param aDtmfTone The DTMF tone to be sent.
       
   235         * @param aActivation Desired DTMF action.
       
   236         */
       
   237         IMPORT_C virtual void Vts(
       
   238             TRequestStatus& aStatus, 
       
   239             const TPhCltDtmfTone aDtmfTone,
       
   240             const TPhCltDtmfAction aAction ) = 0;
       
   241 
       
   242 
       
   243         /**
       
   244         * Cancel the ongoing asynchronous request.
       
   245         *
       
   246         * @param aReqToCancel The request to be canceled.
       
   247         */
       
   248         IMPORT_C virtual void CancelAsyncRequest( 
       
   249             const TPhCltComHandCommand aReqToCancel ) = 0;
       
   250 
       
   251 
       
   252         /**
       
   253         * Mute microphone
       
   254         *
       
   255         * @since 2.8
       
   256         * @param aStatus The status updated when function call is completed.
       
   257         *                KErrNone if successful, Symbian error code otherwise.
       
   258         * @param aMute ETrue if Microphone Mute is se on.
       
   259         */
       
   260         IMPORT_C virtual void MuteMicrophone( 
       
   261             TRequestStatus& aStatus,
       
   262             const TBool aMute ) = 0;
       
   263 
       
   264 
       
   265         /**
       
   266         * Mute RingingTone
       
   267         *
       
   268         * @since 2.8
       
   269         * @param aStatus The status updated when function call is completed.
       
   270         *                KErrNone if successful, Symbian error code otherwise.
       
   271         */
       
   272         IMPORT_C virtual void MuteRingingTone( 
       
   273             TRequestStatus& aStatus ) = 0;
       
   274             
       
   275     protected:
       
   276 
       
   277         /**
       
   278         * C++ constructor.
       
   279         */
       
   280         CPhCltCommandHandler();
       
   281             
       
   282     };
       
   283 
       
   284 
       
   285 
       
   286 
       
   287 
       
   288 #endif      // CPHCLTCOMMANDHANDLER_H 
       
   289 
       
   290 // End of File