os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSRepeatDialog.cpp
First public contribution.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Part of the MVS Application for TechView
17 #include "MVSRepeatDialog.h"
21 void CMVSRepeatDialog::SetupDialogLD(TInt aNoRepeats,
22 TTimeIntervalMicroSeconds aTrailingSilence,
25 CMVSRepeatDialog* dialog = new (ELeave) CMVSRepeatDialog(aNoRepeats,
28 dialog->ExecuteLD(R_MVS_DIALOG_SETREPEATS);
32 void CMVSRepeatDialog::PreLayoutDynInitL()
34 // Get a downcasted pointer to the controls
35 CEikNumberEditor* myRepeatControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetRepeats));
36 CEikNumberEditor* myTrSilenceControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdSetTrailingSilence));
38 //Now seed the controls with appropriate values
41 myRepeatControl->SetNumber(iNoRepeats);
43 if(myTrSilenceControl)
45 myTrSilenceControl->SetNumber(I64INT(iTrailingSilence.Int64()/1000000));
50 CMVSRepeatDialog::CMVSRepeatDialog(TInt aNoRepeats,
51 TTimeIntervalMicroSeconds aTrailingSilence,
53 : iNoRepeats(aNoRepeats), iAppUi(aAppUi)
55 iTrailingSilence = aTrailingSilence.Int64();
59 TBool CMVSRepeatDialog::OkToExitL(TInt aButtonId)
61 if(aButtonId == EMVSButtonCancel)
66 //Update number of repeats from the control.
67 iNoRepeats = static_cast<CEikNumberEditor*>
68 (Control(EMVSCmdSetRepeats))->Number();
70 //Update the trailing silence from the control.
71 TInt64 silence64 = (static_cast<CEikNumberEditor*>
72 (Control(EMVSCmdSetTrailingSilence))->Number());
73 TInt silence = I64INT(silence64*1000000);
74 TTimeIntervalMicroSeconds theSilence(silence);
75 iAppUi->SetRepeats(iNoRepeats, theSilence);