sl@0: sl@0: // ECamObserverTest.cpp sl@0: 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: // sl@0: sl@0: #include sl@0: sl@0: #include "ECamObserverTest.h" sl@0: sl@0: sl@0: void RECamObserverTest::HandleEvent(const TECAMEvent& aEvent) sl@0: { sl@0: TBool eventEncapsulation = TECAMEvent2::IsEventEncapsulationValid(aEvent); sl@0: sl@0: if(eventEncapsulation) sl@0: { sl@0: TECAMEvent2 ecamEvent = static_cast(aEvent); sl@0: sl@0: iEventUid = ecamEvent.iEventType; sl@0: iParam = ecamEvent.iParam; sl@0: iError = ecamEvent.iErrorCode; sl@0: return; sl@0: } sl@0: sl@0: iEventUidTwo = iEventUid; sl@0: iEventUid = aEvent.iEventType; sl@0: iError = aEvent.iErrorCode; sl@0: } sl@0: sl@0: void RECamObserverTest::ViewFinderReady(MCameraBuffer& /*aCameraBuffer*/,TInt aError) sl@0: { sl@0: iError = aError; sl@0: } sl@0: sl@0: void RECamObserverTest::ImageBufferReady(MCameraBuffer& /*aCameraBuffer*/,TInt aError) sl@0: { sl@0: iError = aError; sl@0: } sl@0: sl@0: void RECamObserverTest::VideoBufferReady(MCameraBuffer& /*aCameraBuffer*/,TInt aError) sl@0: { sl@0: iError = aError; sl@0: } sl@0: sl@0: void RECamObserverTest::CheckNotification(const TUid& aEventUid, TVerdict& aResult) sl@0: { sl@0: INFO_PRINTF4(_L("Expected event %x, received event %x. Error %d."), aEventUid.iUid, iEventUid.iUid, iError); sl@0: if (aEventUid != iEventUid || iError != KErrNone) sl@0: { sl@0: aResult = EFail; sl@0: } sl@0: } sl@0: sl@0: void RECamObserverTest::CheckNotificationTwo(const TUid& aEventUid, TVerdict& aResult) sl@0: { sl@0: INFO_PRINTF4(_L("Expected event %x, received event %x. Error %d."), aEventUid.iUid, iEventUid.iUid, iError); sl@0: if (aEventUid != iEventUidTwo || iError != KErrNone) sl@0: { sl@0: aResult = EFail; sl@0: } sl@0: } sl@0: sl@0: void RECamObserverTest::CheckNotificationNeg(const TUid& aEventUid, TVerdict& aResult) sl@0: { sl@0: INFO_PRINTF4(_L("Expected event %x, received event %x. Error %d."), aEventUid.iUid, iEventUid.iUid, iError); sl@0: if (aEventUid != iEventUid || iError == KErrNone) sl@0: { sl@0: aResult = EFail; sl@0: } sl@0: } sl@0: sl@0: void RECamObserverTest::CheckNotificationImgProc(const TUid& aEventUid, TInt aParam, TVerdict& aResult) sl@0: { sl@0: INFO_PRINTF3(_L("Expected event %x, received event %x."), aEventUid.iUid, iEventUid.iUid); sl@0: INFO_PRINTF3(_L("Expected param %d, received param %d."), aParam, iParam); sl@0: INFO_PRINTF2(_L("Error %d."), iError); sl@0: if (aEventUid != iEventUid || aParam != iParam || iError != KErrNone) sl@0: { sl@0: aResult = EFail; sl@0: } sl@0: } sl@0: sl@0: sl@0: sl@0: void RECamContinousZoomObserverTest::ContinuousZoomProgress(CCamera::CCameraContinuousZoom& /*aContinuousZoomHandle*/, TInt aZoomFactor, TInt aError) sl@0: { sl@0: INFO_PRINTF3(_L("ContinuousZoomProgress: New zoom factor achieved = %d, error %d"), aZoomFactor, aError); sl@0: } sl@0: sl@0: void RECamContinousZoomObserverTest::ContinuousZoomCompleted(CCamera::CCameraContinuousZoom& /*aContinuousZoomHandle*/, TInt aFinalZoomFactor, TInt aError) sl@0: { sl@0: INFO_PRINTF3(_L("ContinuousZoomCompleted: Target zoom factor %d reached. Completed with error %d"), aFinalZoomFactor, aError); sl@0: } sl@0: sl@0: TInt RECamContinousZoomObserverTest::CustomInterface(TUid /*aInterface*/, TAny*& /*aPtrInterface*/) sl@0: { sl@0: return KErrNone; sl@0: }