multimediacommsengine/mmcesrv/mmcemediamanager/inc/mcemedianegotiated.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef TMCEMEDIANEGOTIATED_H
       
    22 #define TMCEMEDIANEGOTIATED_H
       
    23 
       
    24 #include "mcemediastate.h"
       
    25 
       
    26 
       
    27 /**
       
    28 *  Represents MM negotiated state 
       
    29 *
       
    30 */
       
    31 
       
    32 class TMceMediaNegotiated : public TMceMediaState
       
    33     {
       
    34 
       
    35 
       
    36 private: // substates
       
    37 
       
    38 
       
    39     /**
       
    40     *  Represents MM negotiated sub state idle
       
    41     *
       
    42     */
       
    43     class TMceEndState : public TMceMediaState
       
    44         {
       
    45         public:
       
    46         
       
    47             static void SetAsCurrentStateL( CMceComSession& aSession );
       
    48         
       
    49             void Callback();
       
    50         
       
    51             TBool NeedToNegotiate( CSdpDocument* aSdpDocument );
       
    52     
       
    53             CSdpDocument* EncodeL();
       
    54 
       
    55             void UpdateL();
       
    56 
       
    57             inline TMceMMState Id() 
       
    58                 {
       
    59                 return KMceMediaNegotiated;
       
    60                 }
       
    61 
       
    62             TMceSipWarningCode DecodeL( CSdpDocument& aSdpDocument );
       
    63             
       
    64             TMceMediaState* CloneL( CMceComSession& aSession ) const;
       
    65             
       
    66                         
       
    67         protected:            
       
    68         
       
    69             TMceEndState( CMceComSession& aSession );
       
    70         
       
    71         };
       
    72 
       
    73 
       
    74     /**
       
    75     *  Represents negotiated sub state where answer is ready to be encoded
       
    76     *
       
    77     */
       
    78     class TMceAnswererWaitingAnswerState : public TMceEndState
       
    79         {
       
    80         public:
       
    81         
       
    82             static void SetAsCurrentStateL( CMceComSession& aSession );
       
    83             
       
    84             CSdpDocument* EncodeL();
       
    85             
       
    86             TBool NeedToNegotiate( CSdpDocument* aSdpDocument );
       
    87 
       
    88         protected:            
       
    89         
       
    90             TMceAnswererWaitingAnswerState( CMceComSession& aSession );
       
    91             
       
    92         };
       
    93 
       
    94     /**
       
    95     *  Represents negotiated sub state where answer is ready to be encoded
       
    96     *
       
    97     */
       
    98     class TMceAnswererEndState : public TMceEndState
       
    99         {
       
   100         public:
       
   101         
       
   102             static void SetAsCurrentStateL( CMceComSession& aSession );
       
   103             
       
   104             TMceSipWarningCode DecodeL( CSdpDocument& aSdpDocument );
       
   105             
       
   106             void UpdateL();
       
   107             
       
   108         protected:            
       
   109         
       
   110             TMceAnswererEndState( CMceComSession& aSession );
       
   111             
       
   112         };
       
   113 
       
   114     
       
   115 public: // Constructors
       
   116 
       
   117 
       
   118     static void SetAsCurrentStateL( CMceComSession& aSession,
       
   119                                     TMceNegotiationRole aRole );
       
   120 
       
   121     /**
       
   122     * Consructor
       
   123     */
       
   124     TMceMediaNegotiated( CMceComSession& aSession );
       
   125 
       
   126 
       
   127 public: // from TMceMediaState
       
   128 
       
   129     inline TMceMMState Id() 
       
   130         {
       
   131         return KMceMediaNegotiated;
       
   132         }
       
   133 
       
   134 public: // from TMceMediaState
       
   135 
       
   136     TMceSipWarningCode DecodeL( CSdpDocument& aSdpDocument );
       
   137 
       
   138     void UpdateL();
       
   139     
       
   140 private: 
       
   141 
       
   142     void OfferL();
       
   143 
       
   144     void AnswerL();
       
   145 
       
   146 
       
   147 private: 
       
   148     	MCEMM_UT_DEFINITIONS
       
   149     	friend class UT_CMceSdpSession;
       
   150     
       
   151     };
       
   152 
       
   153 #endif//TMCEMEDIANEGOTIATED_H
       
   154 
       
   155 // End of File