multimediacommsengine/tsrc/MCETestUI/src/create2wayvideosessiondialog.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDES
       
    22 #include "create2wayvideosessiondialog.h"
       
    23 
       
    24 // CONSTANTS
       
    25 const TInt KBufLength = 300;
       
    26 
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ==============================
       
    29 
       
    30 // ----------------------------------------------------------------------------
       
    31 // CCreate2WayVideoSessionDialog::CCreate2WayVideoSessionDialog( CRtpEngine::TSessionType* )
       
    32 // .
       
    33 // ----------------------------------------------------------------------------
       
    34 //
       
    35 CCreate2WayVideoSessionDialog::CCreate2WayVideoSessionDialog( TSessionParams* aParams ) :
       
    36     iParams( aParams )
       
    37     {
       
    38     // No implementation required
       
    39     }
       
    40 
       
    41 // ----------------------------------------------------------------------------
       
    42 // CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
       
    43 // .
       
    44 // ----------------------------------------------------------------------------
       
    45 //
       
    46 void CCreate2WayVideoSessionDialog::PreLayoutDynInitL()
       
    47     {
       
    48     CEikEdwin* edwinPoCAddress = static_cast<CEikEdwin*>(
       
    49                                Control( ESessionDialog2WayVideoRecipientAddress ) );
       
    50       
       
    51     TBuf<KBufLength> defaultAddress;
       
    52     defaultAddress.Copy(iParams->iRecipentAddress);
       
    53     edwinPoCAddress->SetTextL(&defaultAddress);
       
    54     edwinPoCAddress->SetCursorPosL(defaultAddress.Length(),EFalse);
       
    55     
       
    56     CAknPopupFieldText* popupFieldText = 
       
    57         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoVideoCodec));
       
    58         
       
    59     popupFieldText->SetCurrentValueIndex(0);
       
    60     
       
    61     popupFieldText = 
       
    62         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoAudioCodec));
       
    63         
       
    64     popupFieldText->SetCurrentValueIndex(0);
       
    65     
       
    66     popupFieldText = 
       
    67         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoViewFinder));
       
    68         
       
    69     popupFieldText->SetCurrentValueIndex(0);
       
    70     
       
    71     popupFieldText = 
       
    72         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoCamera));
       
    73         
       
    74     popupFieldText->SetCurrentValueIndex(0);
       
    75     
       
    76     CAknForm::PreLayoutDynInitL();
       
    77     }
       
    78 
       
    79 // ----------------------------------------------------------------------------
       
    80 // CCreate2WayVideoSessionDialog::OkToExitL( TInt )
       
    81 // .
       
    82 // ----------------------------------------------------------------------------
       
    83 //
       
    84 
       
    85 TBool CCreate2WayVideoSessionDialog::OkToExitL( TInt aKey )
       
    86     {
       
    87     if ( aKey == EEikCmdCanceled )
       
    88         {
       
    89         // Cancel pressed. Just exit.
       
    90         return ETrue;
       
    91         }
       
    92     
       
    93     CEikEdwin* edwinRecipientAddress = static_cast<CEikEdwin*>(
       
    94                                Control( ESessionDialog2WayVideoRecipientAddress ) );
       
    95     TBuf<KBufLength> buffer;  
       
    96     edwinRecipientAddress->GetText(buffer);
       
    97     iParams->iRecipentAddress  = buffer;  
       
    98         
       
    99     CAknPopupFieldText* popupFieldText = 
       
   100         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoVideoCodec));
       
   101     TInt index = popupFieldText->CurrentValueIndex();
       
   102     if(index == 0)
       
   103     	{
       
   104     	iParams->iVideoCodec = TSessionParams::EMceCodecSingle;
       
   105     	}
       
   106     else if ( index == 1 )
       
   107         {
       
   108         iParams->iVideoCodec = TSessionParams::EMceCodecAll;
       
   109         }
       
   110     else
       
   111     	{
       
   112     	iParams->iVideoCodec = TSessionParams::EMceCodecMultipleModes;
       
   113        	}
       
   114 
       
   115     popupFieldText = 
       
   116         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoAudioCodec));
       
   117     index = popupFieldText->CurrentValueIndex();
       
   118     if(index == 0)
       
   119     	{
       
   120     	iParams->iAudioCodec = TSessionParams::EMceCodecSingle;
       
   121     	}
       
   122     else if (index == 1)
       
   123     	{
       
   124     	iParams->iAudioCodec = TSessionParams::EMceCodecAll;
       
   125        	}
       
   126      else
       
   127         {
       
   128         iParams->iAudioCodec = TSessionParams::EMceCodecNone;
       
   129         }
       
   130     
       
   131     popupFieldText = 
       
   132         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoViewFinder));
       
   133     index = popupFieldText->CurrentValueIndex();
       
   134     if(index == 0)
       
   135     	{
       
   136     	iParams->videoSinkDisplay = TSessionParams::EMceViewFinderDisabled;
       
   137     	}
       
   138      else
       
   139         {
       
   140         iParams->videoSinkDisplay = TSessionParams::EMceViewFinderEnabled;
       
   141         }
       
   142         
       
   143     popupFieldText = 
       
   144         static_cast <CAknPopupFieldText*> (Control(ESessionDialog2WayVideoCamera));
       
   145     index = popupFieldText->CurrentValueIndex();
       
   146     if(index == 0)
       
   147     	{
       
   148     	iParams->iCameraSetting = TSessionParams::EMceCameraPrimary;
       
   149     	}
       
   150      else
       
   151         {
       
   152         iParams->iCameraSetting = TSessionParams::EMceCameraSecondary;
       
   153         }    
       
   154     
       
   155     return ETrue;
       
   156     }
       
   157 
       
   158 // ----------------------------------------------------------------------------
       
   159 // CCreate2WayVideoSessionDialog::~CCreate2WayVideoSessionDialog()
       
   160 // .
       
   161 // ----------------------------------------------------------------------------
       
   162 //
       
   163 CCreate2WayVideoSessionDialog::~CCreate2WayVideoSessionDialog()
       
   164     {
       
   165     } 
       
   166 
       
   167 // End of File