sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Part of the MVS Application for TechView sl@0: // sl@0: sl@0: #include "MVSRepeatDialog.h" sl@0: #include "MVSApp.hrh" sl@0: sl@0: sl@0: void CMVSRepeatDialog::SetupDialogLD(TInt aNoRepeats, sl@0: TTimeIntervalMicroSeconds aTrailingSilence, sl@0: CMVSAppUi* aAppUi) sl@0: { sl@0: CMVSRepeatDialog* dialog = new (ELeave) CMVSRepeatDialog(aNoRepeats, sl@0: aTrailingSilence, sl@0: aAppUi); sl@0: dialog->ExecuteLD(R_MVS_DIALOG_SETREPEATS); sl@0: } sl@0: sl@0: sl@0: void CMVSRepeatDialog::PreLayoutDynInitL() sl@0: { sl@0: // Get a downcasted pointer to the controls sl@0: CEikNumberEditor* myRepeatControl = static_cast(Control(EMVSCmdSetRepeats)); sl@0: CEikNumberEditor* myTrSilenceControl = static_cast(Control(EMVSCmdSetTrailingSilence)); sl@0: sl@0: //Now seed the controls with appropriate values sl@0: if(myRepeatControl) sl@0: { sl@0: myRepeatControl->SetNumber(iNoRepeats); sl@0: } sl@0: if(myTrSilenceControl) sl@0: { sl@0: myTrSilenceControl->SetNumber(I64INT(iTrailingSilence.Int64()/1000000)); sl@0: } sl@0: } sl@0: sl@0: sl@0: CMVSRepeatDialog::CMVSRepeatDialog(TInt aNoRepeats, sl@0: TTimeIntervalMicroSeconds aTrailingSilence, sl@0: CMVSAppUi* aAppUi) sl@0: : iNoRepeats(aNoRepeats), iAppUi(aAppUi) sl@0: { sl@0: iTrailingSilence = aTrailingSilence.Int64(); sl@0: } sl@0: sl@0: sl@0: TBool CMVSRepeatDialog::OkToExitL(TInt aButtonId) sl@0: { sl@0: if(aButtonId == EMVSButtonCancel) sl@0: { sl@0: return ETrue; sl@0: } sl@0: sl@0: //Update number of repeats from the control. sl@0: iNoRepeats = static_cast sl@0: (Control(EMVSCmdSetRepeats))->Number(); sl@0: sl@0: //Update the trailing silence from the control. sl@0: TInt64 silence64 = (static_cast sl@0: (Control(EMVSCmdSetTrailingSilence))->Number()); sl@0: TInt silence = I64INT(silence64*1000000); sl@0: TTimeIntervalMicroSeconds theSilence(silence); sl@0: iAppUi->SetRepeats(iNoRepeats, theSilence); sl@0: return ETrue; sl@0: }