os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/src/MVSResourceNotifyDialog.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/MVSResourceNotifyDialog.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,75 @@
     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 "MVSResourceNotifyDialog.h"
    1.21 +#include "MVSApp.hrh"
    1.22 +#include "MVSAppUI.h"
    1.23 +
    1.24 +
    1.25 +void CMVSResourceNotifyDialog::SetupDialogLD(/*TBool aNotifyFlag,*/CMVSAppUi* aAppUi)
    1.26 +	{
    1.27 +    CMVSResourceNotifyDialog* dialog = new (ELeave) CMVSResourceNotifyDialog(aAppUi);
    1.28 +    dialog->ExecuteLD(R_MVS_DIALOG_REGISTER);
    1.29 +    //iRegisteredForNotification = aNotifyFlag;
    1.30 +    }
    1.31 +
    1.32 +
    1.33 +void CMVSResourceNotifyDialog::PreLayoutDynInitL()
    1.34 +    {
    1.35 +    CEikCheckBox* registerfornotification = static_cast<CEikCheckBox*>(Control(EMVSRegisterForNotification));
    1.36 +	if(registerfornotification)
    1.37 +    	{
    1.38 +    	iRegisteredForNotificationCtl = registerfornotification;
    1.39 +    	//iRegisteredForNotification = ETrue;
    1.40 +    	iRegisteredForNotificationCtl->SetObserver(this);
    1.41 +    	}
    1.42 +	}
    1.43 +
    1.44 +
    1.45 +CMVSResourceNotifyDialog::CMVSResourceNotifyDialog(CMVSAppUi* aAppUi)
    1.46 +	{
    1.47 +	iAppUi = aAppUi;
    1.48 +    }
    1.49 +
    1.50 +
    1.51 +TBool CMVSResourceNotifyDialog::OkToExitL(TInt aButtonId)
    1.52 +	{
    1.53 +	switch(aButtonId)
    1.54 +    	{//to be implemented once Video agents/controller is in place
    1.55 +        case(EMVSButtonCancel):
    1.56 +        	return ETrue;	
    1.57 +        	
    1.58 +    	}
    1.59 +        iAppUi->RegisterForNotification(iRegisteredForNotification);
    1.60 +        return ETrue;	
    1.61 +        }
    1.62 +
    1.63 +void CMVSResourceNotifyDialog::HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType)
    1.64 +	{
    1.65 +	CEikDialog::HandleControlEventL(aControl,aEventType);
    1.66 +	if(iRegisteredForNotificationCtl == aControl && aEventType == EEventStateChanged)
    1.67 +		{
    1.68 +		if(iRegisteredForNotification == EFalse)
    1.69 +			{
    1.70 +			iRegisteredForNotification = ETrue;
    1.71 +			}
    1.72 +		else 
    1.73 +			{
    1.74 +			iRegisteredForNotification = EFalse;
    1.75 +			}
    1.76 +		}
    1.77 +	}
    1.78 +