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 "MVSResourceNotifyDialog.h" sl@0: #include "MVSApp.hrh" sl@0: #include "MVSAppUI.h" sl@0: sl@0: sl@0: void CMVSResourceNotifyDialog::SetupDialogLD(/*TBool aNotifyFlag,*/CMVSAppUi* aAppUi) sl@0: { sl@0: CMVSResourceNotifyDialog* dialog = new (ELeave) CMVSResourceNotifyDialog(aAppUi); sl@0: dialog->ExecuteLD(R_MVS_DIALOG_REGISTER); sl@0: //iRegisteredForNotification = aNotifyFlag; sl@0: } sl@0: sl@0: sl@0: void CMVSResourceNotifyDialog::PreLayoutDynInitL() sl@0: { sl@0: CEikCheckBox* registerfornotification = static_cast(Control(EMVSRegisterForNotification)); sl@0: if(registerfornotification) sl@0: { sl@0: iRegisteredForNotificationCtl = registerfornotification; sl@0: //iRegisteredForNotification = ETrue; sl@0: iRegisteredForNotificationCtl->SetObserver(this); sl@0: } sl@0: } sl@0: sl@0: sl@0: CMVSResourceNotifyDialog::CMVSResourceNotifyDialog(CMVSAppUi* aAppUi) sl@0: { sl@0: iAppUi = aAppUi; sl@0: } sl@0: sl@0: sl@0: TBool CMVSResourceNotifyDialog::OkToExitL(TInt aButtonId) sl@0: { sl@0: switch(aButtonId) sl@0: {//to be implemented once Video agents/controller is in place sl@0: case(EMVSButtonCancel): sl@0: return ETrue; sl@0: sl@0: } sl@0: iAppUi->RegisterForNotification(iRegisteredForNotification); sl@0: return ETrue; sl@0: } sl@0: sl@0: void CMVSResourceNotifyDialog::HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType) sl@0: { sl@0: CEikDialog::HandleControlEventL(aControl,aEventType); sl@0: if(iRegisteredForNotificationCtl == aControl && aEventType == EEventStateChanged) sl@0: { sl@0: if(iRegisteredForNotification == EFalse) sl@0: { sl@0: iRegisteredForNotification = ETrue; sl@0: } sl@0: else sl@0: { sl@0: iRegisteredForNotification = EFalse; sl@0: } sl@0: } sl@0: } sl@0: