mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSResourceNotifyDialog.cpp
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Part of the MVS Application for TechView
       
    15 //
       
    16 
       
    17 #include "MVSResourceNotifyDialog.h"
       
    18 #include "MVSApp.hrh"
       
    19 #include "MVSAppUI.h"
       
    20 
       
    21 
       
    22 void CMVSResourceNotifyDialog::SetupDialogLD(/*TBool aNotifyFlag,*/CMVSAppUi* aAppUi)
       
    23 	{
       
    24     CMVSResourceNotifyDialog* dialog = new (ELeave) CMVSResourceNotifyDialog(aAppUi);
       
    25     dialog->ExecuteLD(R_MVS_DIALOG_REGISTER);
       
    26     //iRegisteredForNotification = aNotifyFlag;
       
    27     }
       
    28 
       
    29 
       
    30 void CMVSResourceNotifyDialog::PreLayoutDynInitL()
       
    31     {
       
    32     CEikCheckBox* registerfornotification = static_cast<CEikCheckBox*>(Control(EMVSRegisterForNotification));
       
    33 	if(registerfornotification)
       
    34     	{
       
    35     	iRegisteredForNotificationCtl = registerfornotification;
       
    36     	//iRegisteredForNotification = ETrue;
       
    37     	iRegisteredForNotificationCtl->SetObserver(this);
       
    38     	}
       
    39 	}
       
    40 
       
    41 
       
    42 CMVSResourceNotifyDialog::CMVSResourceNotifyDialog(CMVSAppUi* aAppUi)
       
    43 	{
       
    44 	iAppUi = aAppUi;
       
    45     }
       
    46 
       
    47 
       
    48 TBool CMVSResourceNotifyDialog::OkToExitL(TInt aButtonId)
       
    49 	{
       
    50 	switch(aButtonId)
       
    51     	{//to be implemented once Video agents/controller is in place
       
    52         case(EMVSButtonCancel):
       
    53         	return ETrue;	
       
    54         	
       
    55     	}
       
    56         iAppUi->RegisterForNotification(iRegisteredForNotification);
       
    57         return ETrue;	
       
    58         }
       
    59 
       
    60 void CMVSResourceNotifyDialog::HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType)
       
    61 	{
       
    62 	CEikDialog::HandleControlEventL(aControl,aEventType);
       
    63 	if(iRegisteredForNotificationCtl == aControl && aEventType == EEventStateChanged)
       
    64 		{
       
    65 		if(iRegisteredForNotification == EFalse)
       
    66 			{
       
    67 			iRegisteredForNotification = ETrue;
       
    68 			}
       
    69 		else 
       
    70 			{
       
    71 			iRegisteredForNotification = EFalse;
       
    72 			}
       
    73 		}
       
    74 	}
       
    75