sipvoipprovider/svphold/inc/svpholdmediahandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Pauses and resumes audio stream.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SVPHOLDMEDIAHANDLER_H
       
    20 #define SVPHOLDMEDIAHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CSVPHoldContext;
       
    25 class CMceMediaStream;
       
    26 
       
    27 
       
    28 /**
       
    29 *  Media handler class for SVP hold extension.
       
    30 *  @lib svp.dll
       
    31 *  @since S60 3.2
       
    32 */
       
    33 class CSVPHoldMediaHandler : public CBase
       
    34     {
       
    35 public:  // Constructors and destructor
       
    36     
       
    37     /**
       
    38     * Two-phased constructor.
       
    39     */
       
    40     static CSVPHoldMediaHandler* NewL();
       
    41     
       
    42     /**
       
    43     * Destructor.
       
    44     */
       
    45     virtual ~CSVPHoldMediaHandler();
       
    46 
       
    47 public:  // New functions
       
    48     
       
    49     /**
       
    50     * Disables/enables media stream based on the request.
       
    51     * @since S60 3.2
       
    52     * @param aMediaStream MCE Media stream
       
    53     * @param aRequest Request type
       
    54     */
       
    55     void PerformMediaActionL( CMceMediaStream& aMediaStream,
       
    56                               TSVPHoldRequestType aRequest );
       
    57     
       
    58     /**
       
    59     * Disables needed sinks/sources.
       
    60     * @since S60 3.2
       
    61     * @param aContext SVP Hold context
       
    62     * @param aLeaveSpeakerEnabled ETrue, when only mic source is disabled
       
    63     */
       
    64     void DisableAudioL( CSVPHoldContext& aContext,
       
    65                         TBool aLeaveSpeakerEnabled = EFalse );
       
    66     
       
    67     /**
       
    68     * Disables needed sinks/sources.
       
    69     * @since S60 3.2
       
    70     * @param aContext SVP Hold context
       
    71     */
       
    72     void EnableAudioL( CSVPHoldContext& aContext );
       
    73 
       
    74 
       
    75 private:
       
    76 
       
    77     /**
       
    78     * C++ default constructor.
       
    79     */
       
    80     CSVPHoldMediaHandler();
       
    81 
       
    82     /**
       
    83     * By default Symbian 2nd phase constructor is private.
       
    84     */
       
    85     void ConstructL() const;
       
    86 
       
    87 
       
    88 private: // New functions
       
    89 
       
    90     /**
       
    91     * Handles streams in local hold request cases.
       
    92     * @since S60 3.2
       
    93     * @param aMediaStream MCE Media stream
       
    94     * @param aBoundStream MCE Media stream
       
    95     */
       
    96     void HandleLocalHoldingL( CMceMediaStream& aMediaStream,
       
    97                               CMceMediaStream& aBoundStream );
       
    98 
       
    99     /**
       
   100     * Handles streams in local resume request cases.
       
   101     * @since S60 3.2
       
   102     * @param aMediaStream MCE Media stream
       
   103     * @param aBoundStream MCE Media stream
       
   104     * @param aRequest Request type
       
   105     */
       
   106     void HandleLocalResumingL( CMceMediaStream& aMediaStream,
       
   107                                CMceMediaStream& aBoundStream,
       
   108                                TSVPHoldRequestType aRequest );
       
   109 
       
   110     /**
       
   111     * Handles streams in remote hold request cases.
       
   112     * @since S60 3.2
       
   113     * @param aMediaStream MCE Media stream
       
   114     * @param aBoundStream MCE Media stream
       
   115     */
       
   116     void HandleRemoteHoldingL( CMceMediaStream& aMediaStream,
       
   117                                CMceMediaStream& aBoundStream,
       
   118                                TSVPHoldRequestType aRequest );
       
   119 
       
   120     /**
       
   121     * Handles streams in local resume request cases.
       
   122     * @since S60 3.2
       
   123     * @param aMediaStream MCE Media stream
       
   124     * @param aBoundStream MCE Media stream
       
   125     * @param aRequest Request type
       
   126     */
       
   127     void HandleRemoteResumingL( CMceMediaStream& aMediaStream,
       
   128                                 CMceMediaStream& aBoundStream,
       
   129                                 TSVPHoldRequestType aRequest );
       
   130     
       
   131     /**
       
   132     * Enables audio
       
   133     * @since S60 3.2
       
   134     * @param aMediaStream MCE Media stream
       
   135     * @param aContext SVP Hold context
       
   136     */
       
   137     void EnableAudioL( CMceMediaStream& aMediaStream,
       
   138                        CSVPHoldContext& aContext );
       
   139 
       
   140                                              
       
   141     /**
       
   142     * Disables used audio stream (mic & speaker)
       
   143     * @since S60 3.2
       
   144     * @param aAudioStream MCE Media stream
       
   145     */
       
   146     void DisableAudioStreamL( CMceMediaStream& aAudioStream,
       
   147                               TBool aLeaveSpeakerEnabled );
       
   148 
       
   149     /**
       
   150     * Disables used audio stream (mic & speaker)
       
   151     * @since S60 3.2
       
   152     * @param aAudioStream MCE Media stream
       
   153     * @param aAllowMicEnable Boolean value
       
   154     */
       
   155     void EnableAudioStreamL( CMceMediaStream& aAudioStream,
       
   156                              TBool aAllowMicEnable = ETrue );
       
   157 
       
   158     };
       
   159 
       
   160 #endif      // SVPHOLDMEDIAHANDLER_H  
       
   161