os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSRepeatDialog.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSRepeatDialog.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Part of the MVS Application for TechView
    1.18 +//
    1.19 +
    1.20 +#include "MVSRepeatDialog.h"
    1.21 +#include "MVSApp.hrh"
    1.22 +
    1.23 +
    1.24 +void CMVSRepeatDialog::SetupDialogLD(TInt aNoRepeats, 
    1.25 +                                  TTimeIntervalMicroSeconds aTrailingSilence,
    1.26 +                                  CMVSAppUi* aAppUi)
    1.27 +	{
    1.28 +    CMVSRepeatDialog* dialog = new (ELeave) CMVSRepeatDialog(aNoRepeats,
    1.29 +                                                       aTrailingSilence,
    1.30 +                                                       aAppUi);
    1.31 +    dialog->ExecuteLD(R_MVS_DIALOG_SETREPEATS);
    1.32 +    }
    1.33 +
    1.34 +
    1.35 +void CMVSRepeatDialog::PreLayoutDynInitL()
    1.36 +    {
    1.37 +    // Get a downcasted pointer to the controls
    1.38 +    CEikNumberEditor* myRepeatControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetRepeats));
    1.39 +    CEikNumberEditor* myTrSilenceControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetTrailingSilence));
    1.40 +	
    1.41 +    //Now seed the controls with appropriate values
    1.42 +    if(myRepeatControl)
    1.43 +    	{
    1.44 +    	myRepeatControl->SetNumber(iNoRepeats);	
    1.45 +    	}
    1.46 +    if(myTrSilenceControl)
    1.47 +    	{
    1.48 +    	myTrSilenceControl->SetNumber(I64INT(iTrailingSilence.Int64()/1000000));	
    1.49 +    	}
    1.50 +    }
    1.51 +
    1.52 +
    1.53 +CMVSRepeatDialog::CMVSRepeatDialog(TInt aNoRepeats, 
    1.54 +                             TTimeIntervalMicroSeconds aTrailingSilence,
    1.55 +                             CMVSAppUi* aAppUi)
    1.56 +: iNoRepeats(aNoRepeats), iAppUi(aAppUi)
    1.57 +    {
    1.58 +    iTrailingSilence = aTrailingSilence.Int64();
    1.59 +    }
    1.60 +
    1.61 +
    1.62 +TBool CMVSRepeatDialog::OkToExitL(TInt aButtonId)
    1.63 +    {
    1.64 +    if(aButtonId == EMVSButtonCancel)
    1.65 +    	{
    1.66 +        return ETrue;
    1.67 +        }
    1.68 +
    1.69 +    //Update number of repeats from the control.
    1.70 +    iNoRepeats = static_cast<CEikNumberEditor*>
    1.71 +                        (Control(EMVSCmdSetRepeats))->Number();
    1.72 +
    1.73 +    //Update the trailing silence from the control.
    1.74 +    TInt64 silence64 = (static_cast<CEikNumberEditor*>
    1.75 +                        (Control(EMVSCmdSetTrailingSilence))->Number());  
    1.76 +    TInt silence = I64INT(silence64*1000000);
    1.77 +    TTimeIntervalMicroSeconds theSilence(silence);
    1.78 +    iAppUi->SetRepeats(iNoRepeats, theSilence);
    1.79 +    return ETrue;
    1.80 +    }