multimediacommsengine/mmcesrv/mmcemediamanager/inc/mceofferingmedia.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 
       
    22 #ifndef TMCEOFFERINGMEDIA_H
       
    23 #define TMCEOFFERINGMEDIA_H
       
    24 
       
    25 #include "mcemediastate.h"
       
    26 #include "mcesdpsession.h"
       
    27 
       
    28 class CMCCCodecInformationFactory;
       
    29 
       
    30 const TBool KFromSubstate = ETrue;
       
    31 
       
    32 /**
       
    33 *  Represents MM offering state 
       
    34 *
       
    35 */
       
    36 class TMceOfferingMedia : public TMceMediaState
       
    37     {
       
    38 
       
    39 public: // substates
       
    40 
       
    41     /**
       
    42     *  Represents MM offering sub state where media is ready for offer
       
    43     *
       
    44     */
       
    45     class TMceMediaReady : public TMceMediaState
       
    46         {
       
    47         public:
       
    48         
       
    49             static void SetAsCurrentStateL( 
       
    50                     CMceComSession& aSession );
       
    51                     
       
    52         
       
    53             inline TMceMMState Id() 
       
    54                 {
       
    55                 return KMceOfferingMedia;
       
    56                 }
       
    57             
       
    58             void Callback();
       
    59 
       
    60             CSdpDocument* EncodeL();
       
    61             
       
    62         protected:            
       
    63         
       
    64             TMceMediaReady( CMceComSession& aSession );
       
    65                 
       
    66         };
       
    67 
       
    68     /**
       
    69     *  Represents MM offering sub state where media update is ready for offer
       
    70     *
       
    71     */
       
    72     class TMceMediaUpdateReady : public TMceMediaReady
       
    73         {
       
    74         public:
       
    75         
       
    76             static void SetAsCurrentStateL( CMceComSession& aSession );
       
    77         
       
    78             CSdpDocument* EncodeL();
       
    79             
       
    80             TBool NeedToNegotiate( CSdpDocument* aSdpDocument = NULL );
       
    81         protected:            
       
    82         
       
    83             TMceMediaUpdateReady( CMceComSession& aSession );
       
    84         
       
    85         };
       
    86 
       
    87 
       
    88     /**
       
    89     *  Represents MM offering sub state where media waiting answer
       
    90     *
       
    91     */
       
    92     class TMceWaitingAnswer : public TMceMediaState
       
    93         {
       
    94         public:
       
    95         
       
    96             static void SetAsCurrentStateL( CMceComSession& aSession );
       
    97             
       
    98             inline TMceMMState Id() 
       
    99                 {
       
   100                 return KMceOfferingMedia;
       
   101                 }
       
   102         
       
   103             TMceMediaState* CloneL( CMceComSession& aSession ) const;
       
   104     
       
   105             TMceSipWarningCode DecodeL( CSdpDocument& aSdpDocument );
       
   106             
       
   107             TBool NeedToNegotiate( CSdpDocument* aSdpDocument = NULL );
       
   108         protected:            
       
   109         
       
   110             TMceWaitingAnswer( CMceComSession& aSession );
       
   111             
       
   112         };
       
   113 
       
   114     
       
   115 public: // Constructors
       
   116 
       
   117 
       
   118     static void SetAsCurrentStateL( CMceComSession& aSession, TBool aFromSubstate = EFalse );
       
   119 
       
   120 
       
   121 public: // from TMceMediaState
       
   122 
       
   123     inline TMceMMState Id() 
       
   124         {
       
   125         return KMceOfferingMedia;
       
   126         }
       
   127 
       
   128 
       
   129 public: // from TMceMediaState
       
   130 
       
   131     void UpdateL();
       
   132 
       
   133 protected:
       
   134 
       
   135     void SetAsCurrentStateL( TMceOfferingMedia::TMceWaitingAnswer& aSubState );
       
   136 
       
   137     /**
       
   138     * Consructor
       
   139     */
       
   140     TMceOfferingMedia( CMceComSession& aSession );
       
   141 
       
   142     
       
   143     };
       
   144 
       
   145 #endif//TMCEOFFERINGMEDIA_H
       
   146 
       
   147 // End of File