multimediacommsengine/tsrc/MCETestUI/src/createpocsessiondialog.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 "CreatePoCSessionDialog.h"
       
    23 
       
    24 // CONSTANTS
       
    25 const TInt KBufLength = 300;
       
    26 
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ==============================
       
    29 
       
    30 // ----------------------------------------------------------------------------
       
    31 // CCreateSessionDialog::CCreateSessionDialog( CRtpEngine::TSessionType* )
       
    32 // .
       
    33 // ----------------------------------------------------------------------------
       
    34 //
       
    35 CCreatePoCSessionDialog::CCreatePoCSessionDialog( TSessionParams* aParams ) :
       
    36     iParams( aParams )
       
    37     {
       
    38     // No implementation required
       
    39     }
       
    40 
       
    41 // ----------------------------------------------------------------------------
       
    42 // CCreateSessionDialog::PreLayoutDynInitL()
       
    43 // .
       
    44 // ----------------------------------------------------------------------------
       
    45 //
       
    46 void CCreatePoCSessionDialog::PreLayoutDynInitL()
       
    47     {
       
    48     
       
    49    CEikEdwin* edwinPoCAddress = static_cast<CEikEdwin*>(
       
    50                                Control( ESessionPoCDialogPoCAddress ) );
       
    51       
       
    52     TBuf<KBufLength> defaultAddress;
       
    53     defaultAddress.Copy(iParams->iRecipentAddress);
       
    54     edwinPoCAddress->SetTextL(&defaultAddress);
       
    55     edwinPoCAddress->SetCursorPosL(defaultAddress.Length(),EFalse);
       
    56  //   edwinPoCAddress->SetInputCapabilitiesL(TCoeInputCapabilities::EAllText);
       
    57  
       
    58  	CAknPopupFieldText* popupFieldText = 
       
    59         static_cast <CAknPopupFieldText*> (Control(EPoCSessionDialogSessionType));
       
    60         
       
    61  //	iParams->originator.Copy(KNone);
       
    62     CEikEdwin* OriginaterAddress = static_cast<CEikEdwin*>(
       
    63                                Control( ESessionPoCOriginaterAddress ) );
       
    64     defaultAddress.Copy(iParams->originator);
       
    65     OriginaterAddress->SetTextL(&defaultAddress);
       
    66     OriginaterAddress->SetCursorPosL(defaultAddress.Length(),EFalse);
       
    67     
       
    68     
       
    69  
       
    70     CAknForm::PreLayoutDynInitL();
       
    71     }
       
    72 
       
    73 // ----------------------------------------------------------------------------
       
    74 // CCreateSessionDialog::OkToExitL( TInt )
       
    75 // .
       
    76 // ----------------------------------------------------------------------------
       
    77 //
       
    78 
       
    79 TBool CCreatePoCSessionDialog::OkToExitL( TInt aKey )
       
    80     {
       
    81     if ( aKey == EEikCmdCanceled )
       
    82         {
       
    83         // Cancel pressed. Just exit.
       
    84         return ETrue;
       
    85         }
       
    86     CEikEdwin* edwinPoCAddress = static_cast<CEikEdwin*>(
       
    87                                Control( ESessionPoCDialogPoCAddress ) );
       
    88     TBuf<KBufLength> buffer;  
       
    89     edwinPoCAddress->GetText(buffer);
       
    90     iParams->iRecipentAddress  = buffer;  
       
    91     
       
    92     CAknPopupFieldText* popupFieldText = 
       
    93         static_cast <CAknPopupFieldText*> (Control(EPoCSessionDialogSessionType));  
       
    94     if(popupFieldText->CurrentValueIndex() == 0) 
       
    95     	{
       
    96     	iParams->iPoCAdhocSessionType = ETrue;
       
    97     	}
       
    98     else
       
    99     	{
       
   100     	iParams->iPoCAdhocSessionType = EFalse;
       
   101     	}	
       
   102     
       
   103     CEikEdwin* OriginaterAddress = static_cast<CEikEdwin*>(
       
   104                                  Control( ESessionPoCOriginaterAddress ) );
       
   105     OriginaterAddress->GetText(buffer);
       
   106     iParams->originator = buffer;                           
       
   107 
       
   108      return ETrue;
       
   109     }
       
   110 
       
   111 // ----------------------------------------------------------------------------
       
   112 // CCreatePoCSessionDialog::~CCreatePoCSessionDialog()
       
   113 // .
       
   114 // ----------------------------------------------------------------------------
       
   115 //
       
   116 CCreatePoCSessionDialog::~CCreatePoCSessionDialog()
       
   117     {
       
   118     return;
       
   119     } 
       
   120 
       
   121 // End of File