os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/AdvancedSettings.cpp
First public contribution.
1 // Copyright (c) 2004-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.
17 #include <ecom/ecom.h>
18 #include <ecom/implementationproxy.h>
19 #include <ecamuids.hrh>
21 #include "ECamUnitTestPluginUids.hrh"
22 #include "AdvancedSettings.h"
23 #include <ecamerrors.h>
25 #include <ecamadvsettings.h>
26 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
27 #include <ecamadvsettingsconst.h>
28 #include <ecamadvsettingsdef.h>
29 #include <ecamimageprocessingconst.h>
30 #include <ecamconst.h>
33 const TInt KContinuousAutoFocusTimeoutValue = 20000;
34 const TInt KBrightnessAdjMinValue = -50;
35 const TInt KBrightnessAdjMaxValue = 50;
36 const TInt KDefaultShutterSpeed = 0;
37 const TInt KDefaultFocusDistance = 0;
38 const TInt KDefaultAperture = 280;
39 const TInt KBracketStartIndex = 0;
40 const TInt KBracketFrames = 2;
41 const TBool KDefaultRedEyeReduce = EFalse;
42 const TInt KFlashCompensationStep = 2;
43 const TInt KFlashCompensationInSteps = 1;
44 const TBool KExternalFlashPresentState = EFalse;
45 const TInt KManualFlashPowerLevel = 0;
46 const TInt KExposureCompensationStep = 3;
47 const TInt KExposureCompensationInSteps = 2;
48 const TBool KApertureExposureLockOn = EFalse;
49 const TBool KShootClickOn = EFalse;
50 const TInt KTimerInterval = 0;
51 const TInt KBurstImages = 0;
52 const TBool KExposureLockOn = EFalse;
53 const TBool KAutoFocusLockOn = EFalse;
54 const TBool KAutomaticSizeSelectionChangeOn = EFalse;
55 const TInt KWBColorTemperature = 6000;
56 const TBool KFlashReadyState = EFalse;
57 const TInt KSupportedISORateType = 0x1F;
58 const TBool KCapableActualISOValue = EFalse;
59 const TInt KAFAssistantLightManual = 0x01;
60 const TInt KConcurrentColorOpSupported = 0x01;
61 const TInt KDefault = 0x01;
62 const TInt KFocusRangeSupported = 0x7F;
63 const TInt KWhiteBalanceSupported = 0x0FFF;
68 CCamPresets::CCamPresets(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
70 iSupportedPresets[0] = KUidECamPresetOutdoor;
71 iSupportedPresets[1] = KUidECamPresetBeach;
72 iSupportedPresets[2] = KUidECamPresetNightPartyIndoor;
73 iSupportedPresets[3] = KUidECamPresetNone;
75 iCurrentPreset = KUidECamPresetNone;
77 iAffectedSettings[0] = KUidECamEventCameraSettingAperture;
78 iAffectedSettings[1] = KUidECamEventCameraSettingIsoRateType;
79 iAffectedSettings[2] = KUidECamEventCameraSettingIsoRate;
81 iRangeRestrictedSettings.Reset();
82 iIsPresetUnLockSupported = EFalse;
83 iIsPresetLocked = ETrue;
86 CCamPresets::~CCamPresets()
89 iRangeRestrictedSettings.Close();
92 CCamPresets* CCamPresets::NewL(CCamUnitTestPlugin& aOwner)
94 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
98 globalData = new (ELeave) CDataGlobal;
99 CleanupStack::PushL(globalData);
101 globalData->iReferenceCount = 0;
102 globalData->iCamPresets = new (ELeave) CCamPresets(aOwner);
103 globalData->iCamPresets->iRefCount = 1;
105 TInt error = Dll::SetTls(globalData);
108 delete globalData->iCamPresets;
112 CleanupStack::Pop(globalData);
114 return static_cast <CCamPresets*> (globalData->iCamPresets);
118 CCamPresets* self = globalData->iCamPresets;
120 globalData->iReferenceCount++;
121 self->iRefCount = globalData->iReferenceCount + 1;
122 if (globalData->iReferenceCount == 1 )
129 TInt error = Dll::SetTls(globalData);
132 delete globalData->iCamPresets;
136 return static_cast <CCamPresets*> (self);
140 void CCamPresets::Release()
149 void CCamPresets::GetSupportedPresetsL(RArray<TUid>& aPresets) const
152 TInt count = sizeof(iSupportedPresets)/sizeof(TUid);
154 for (TInt i = 0; i < count; i++)
156 aPresets.AppendL(iSupportedPresets[i]);
160 void CCamPresets::SetPreset(TUid aPreset)
162 TInt response = KErrECamParameterNotInRange;
164 for (TInt i = 0; i < KSupportedPresetsNumber; i++)
166 if (iSupportedPresets[i] == aPreset)
168 iCurrentPreset = aPreset;
173 case KUidECamPresetOutdoorUidValue:
175 response = iRangeRestrictedSettings.Append(KUidECamEventCameraSettingIsoRate);
176 if(iOwner.iSupportedISORates.Count() == KNumSupportedIsoRate)
178 iOwner.iSupportedISORates.Remove(KNumSupportedIsoRate-1);
179 if(iOwner.iIsoRate == KMaxIsoRate)
181 iOwner.iIsoRate = KIsoRate5;
184 iIsPresetUnLockSupported = ETrue;
190 case KUidECamPresetBeachUidValue:
191 case KUidECamPresetNightPartyIndoorUidValue:
192 case KUidECamPresetNoneUidValue:
195 if(iOwner.iSupportedISORates.Count() == KNumSupportedIsoRate-1)
197 iOwner.iSupportedISORates.AppendL(KMaxIsoRate);
199 iIsPresetUnLockSupported = EFalse;
208 iOwner.Notify(aPreset, response);
210 if(aPreset == KUidECamPresetOutdoor)
212 iOwner.Notify(KUidECamEventRangeRestricted, KErrNone);
216 TUid CCamPresets::Preset() const
218 return iCurrentPreset;
221 void CCamPresets::GetAffectedSettingsL(RArray<TUid>& aSettings) const
225 if (iCurrentPreset!=KUidECamPresetNone)
227 TInt count = sizeof(iAffectedSettings)/sizeof(TUid);
228 for (TInt i = 0; i < count; i++)
230 aSettings.AppendL(iAffectedSettings[i]);
235 void CCamPresets::GetAssociatedSettingsL(TUid aPreset, RArray<TUid>& aSettings) const
238 if (aPreset == KUidECamPresetNone)
240 User::Leave(KErrArgument);
242 TInt count = sizeof(iAffectedSettings)/sizeof(TUid);
243 for (TInt i = 0; i < count; i++)
245 aSettings.AppendL(iAffectedSettings[i]);
249 void CCamPresets::GetRangeRestrictedSettingsL(RArray<TUid>& aRangeRestrictedSettings) const
251 for(TInt index=0; index<iRangeRestrictedSettings.Count(); index++)
253 aRangeRestrictedSettings.AppendL(iRangeRestrictedSettings[index]);
257 void CCamPresets::GetFeatureRestrictedSettingsL(RArray<TUid>& aFeatureRestrictedSettings) const
259 aFeatureRestrictedSettings.Reset();
262 void CCamPresets::IsPresetUnlockSupportedL(TBool& aUnlockSupported) const
264 aUnlockSupported = iIsPresetUnLockSupported;
267 void CCamPresets::LockPreset()
269 iIsPresetLocked = ETrue;
270 iOwner.Notify(KUidECamEventPresetLocked, KErrNone);
273 void CCamPresets::UnlockPreset()
275 TInt error = KErrNotSupported;
276 if(iIsPresetUnLockSupported)
278 iIsPresetLocked = EFalse;
281 iOwner.Notify(KUidECamEventPresetUnlocked, error);
287 CCamImgProc::CCamImgProc(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
291 CCamImgProc::~CCamImgProc()
294 iActiveSequence.Close();
295 iSupportedTransformations.Close();
298 CCamImgProc* CCamImgProc::NewL(CCamUnitTestPlugin& aOwner)
300 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
304 globalData = new (ELeave) CDataGlobal;
305 CleanupStack::PushL(globalData);
307 globalData->iReferenceCount = 0;
308 globalData->iCamImgProc = new (ELeave) CCamImgProc(aOwner);
309 CleanupStack::PushL(globalData->iCamImgProc);
310 globalData->iCamImgProc->ConstructL();
311 globalData->iCamImgProc->iRefCount = 1;
312 CleanupStack::Pop(globalData->iCamImgProc);
313 TInt error = Dll::SetTls(globalData);
316 delete globalData->iCamImgProc;
319 CleanupStack::Pop(globalData);
321 return static_cast <CCamImgProc*> (globalData->iCamImgProc);
325 CCamImgProc* self = globalData->iCamImgProc;
327 globalData->iReferenceCount++;
328 self->iRefCount = globalData->iReferenceCount + 1;
329 if (globalData->iReferenceCount == 2 )
336 TInt error = Dll::SetTls(globalData);
339 delete globalData->iCamImgProc;
343 return static_cast <CCamImgProc*> (self);
347 void CCamImgProc::Release()
356 void CCamImgProc::ConstructL()
358 iSupportedTransformations.AppendL(KUidECamEventImageProcessingAdjustBrightness);
359 iSupportedTransformations.AppendL(KUidECamEventImageProcessingAdjustContrast);
360 iSupportedTransformations.AppendL(KUidECamEventImageProcessingEffect);
361 iBrightnessRange[0] = KBrightnessAdjMinValue; // min
362 iBrightnessRange[1] = KBrightnessAdjMaxValue; // max value, step assumed 1
364 iSupportedColorSwapCapabilities.iSupportedSourceRepresentation = KDefault;
365 iSupportedColorSwapCapabilities.iSupportedTargetRepresentation = KDefault;
366 iSupportedColorSwapCapabilities.iSupportedSourceRgbGroupingMode = KDefault;
367 iSupportedColorSwapCapabilities.iSupportedTargetRgbGroupingMode = KDefault;
368 iSupportedColorSwapCapabilities.iIsCapabilityUniform = ETrue;
370 iSupportedColorAccentCapabilities.iSupportedSourceRepresentation = KDefault;
371 iSupportedColorAccentCapabilities.iSupportedSourceRgbGroupingMode = KDefault;
372 iSupportedColorAccentCapabilities.iIsCapabilityUniform = ETrue;
375 void CCamImgProc::GetSupportedTransformationsL(RArray<TUid>& aTransformations) const
377 aTransformations.Reset();
378 if (iOwner.iCameras[iOwner.iCameraIndex])
380 for (TInt i=0; i<iSupportedTransformations.Count(); i++)
382 aTransformations.AppendL(iSupportedTransformations[i]);
387 void CCamImgProc::GetActiveTransformationsL(RArray<TUid>& aTransformations) const
389 aTransformations.Reset();
390 if (iOwner.iCameras[iOwner.iCameraIndex])
392 for (TInt i=0; i<iSupportedTransformations.Count(); i++)
394 aTransformations.AppendL(iSupportedTransformations[i]);
399 void CCamImgProc::GetTransformationSupportedValuesL(TUid aTransformation, RArray<TInt>& aValues, TValueInfo& aInfo) const
401 if (iSupportedTransformations.Find(aTransformation)==KErrNotFound)
408 if (aTransformation == KUidECamEventImageProcessingAdjustBrightness)
410 aValues.AppendL(iBrightnessRange[0]);
411 aValues.AppendL(iBrightnessRange[1]);
412 aInfo = EContinuousRangeMinMax;
416 if(aTransformation == KUidECamEventImageProcessingEffect)
418 aValues.AppendL(CCamera::CCameraImageProcessing::EEffectColorSwap | CCamera::CCameraImageProcessing::EEffectColorAccent);
423 aInfo = EDiscreteSteps;
424 if (aTransformation == iTransformation)
426 aValues.AppendL(iValue);
430 aValues.AppendL(KECamImageProcessingDefaultValue);
437 TInt CCamImgProc::TransformationValue(TUid aTransformation) const
439 if (iSupportedTransformations.Find(aTransformation) == KErrNotFound)
445 if (aTransformation == iTransformation)
451 return KECamImageProcessingDefaultValue;
456 TInt CCamImgProc::GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const
458 if (iSupportedTransformations.Find(aTransformation) == KErrNotFound)
464 if (aTransformation == iTransformation)
466 aTransformationValue = iValue;
470 aTransformationValue = KECamImageProcessingDefaultValue;
477 void CCamImgProc::SetTransformationValue(TUid aTransformation, TInt aValue)
481 if (iSupportedTransformations.Find(aTransformation) == KErrNotFound)
483 response = KErrECamSettingDisabled;
487 if (aTransformation == KUidECamEventImageProcessingAdjustBrightness)
489 // if outside the range
490 if (aValue < iBrightnessRange[0] || aValue > iBrightnessRange[1])
492 response = KErrECamParameterNotInRange;
502 if(aTransformation == KUidECamEventImageProcessingEffect)
504 if(aValue == CCamera::CCameraImageProcessing::EEffectColorSwap)
506 iColorSwapParameter.iEntryStatus = ENotActive;
510 if(aValue == CCamera::CCameraImageProcessing::EEffectColorAccent)
512 iColorAccentParameter.iEntryStatus = ENotActive;
516 response = KErrArgument;
522 if (response == KErrNone)
524 iTransformation = aTransformation;
528 iOwner.Notify(aTransformation, response);
531 void CCamImgProc::GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const
533 aTransformSequence.Reset();
534 if (iOwner.iCameras[iOwner.iCameraIndex])
536 for (TInt i = 0; i < iActiveSequence.Count(); i++)
538 aTransformSequence.AppendL(iActiveSequence[i]);
543 void CCamImgProc::SetActiveTransformSequenceL(RArray<TUid>& aNewTransformSequence)
545 iActiveSequence.Reset();
546 if (iOwner.iCameras[iOwner.iCameraIndex])
548 for (TInt i=0; i<aNewTransformSequence.Count(); i++)
550 iActiveSequence.AppendL(aNewTransformSequence[i]);
555 void CCamImgProc::SetSourceRect( const TRect& aRect)
559 void CCamImgProc::GetSourceRect(TRect& aRect) const
564 void CCamImgProc::GetConcurrentColorSwappingsSupportedL(TInt& aConcurrentColorSwappingSupported) const
566 aConcurrentColorSwappingSupported = KConcurrentColorOpSupported;
569 void CCamImgProc::GetColorSwapCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorSwapCapabilities) const
571 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
573 User::Leave(KErrArgument);
576 if(aColorSwapCapabilities.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationCapabilities) ||
577 aColorSwapCapabilities.Version() != KECamColorOperationCapabilitiesCurrentVersion)
579 // new app. running on old impl.
580 User::Leave(KErrNotSupported);
584 aColorSwapCapabilities = iSupportedColorSwapCapabilities;
588 void CCamImgProc::SetColorSwapEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters)
590 TInt response = KErrNone;
592 if(aColorSwapParameters.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationEntry) ||
593 aColorSwapParameters.iNumBitsIgnored.Size() != sizeof(CCamera::CCameraImageProcessing::TBitsIgnore) ||
594 aColorSwapParameters.Version() != KECamColorOperationEntryCurrentVersion ||
595 aColorSwapParameters.iNumBitsIgnored.Version() != KECamBitsIgnoreCurrentVersion
598 // new app. running on old impl.
599 iOwner.Notify2(KUidECamEvent2CIPSetColorSwapEntry, KErrNotSupported, aIndex);
603 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
605 iOwner.Notify2(KUidECamEvent2CIPSetColorSwapEntry, KErrArgument, aIndex);
609 if(!CheckColorSwapEntry(aColorSwapParameters))
611 // if color operation entry is different from what is supported....
612 iOwner.Notify2(KUidECamEvent2CIPSetColorSwapEntry, KErrArgument, aIndex);
616 iColorSwapParameter = aColorSwapParameters;
617 iColorSwapParameter.iEntryStatus = EDiscreteSteps;
619 iOwner.Notify2(KUidECamEvent2CIPSetColorSwapEntry, response, aIndex);
625 void CCamImgProc::RemoveColorSwapEntry(TInt aIndex)
627 TInt response = KErrNone;
629 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
631 iOwner.Notify2(KUidECamEventCIPRemoveColorSwapEntry, KErrArgument, aIndex);
635 iColorSwapParameter.iEntryStatus = ENotActive;
636 iOwner.Notify2(KUidECamEventCIPRemoveColorSwapEntry, response, aIndex);
640 void CCamImgProc::GetColorSwapEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) const
642 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
644 User::Leave(KErrArgument);
647 if(aColorSwapParameters.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationEntry) ||
648 aColorSwapParameters.iNumBitsIgnored.Size() != sizeof(CCamera::CCameraImageProcessing::TBitsIgnore))
650 // new app. running on old impl.
651 User::Leave(KErrNotSupported);
655 aColorSwapParameters = iColorSwapParameter;
659 void CCamImgProc::StartColorSwapping()
661 TInt response = KErrNone;
662 iOwner.Notify(KUidECamEventCIPStartColorSwap, response);
665 void CCamImgProc::CancelColorSwappingL()
669 void CCamImgProc::GetConcurrentColorAccentSupportedL(TInt& aConcurrentColorAccentSupported) const
671 aConcurrentColorAccentSupported = KConcurrentColorOpSupported;
674 void CCamImgProc::GetColorAccentCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorAccentCapabilities) const
676 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
678 User::Leave(KErrArgument);
681 if(aColorAccentCapabilities.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationCapabilities))
683 // new app. running on old impl.
684 User::Leave(KErrNotSupported);
688 aColorAccentCapabilities = iSupportedColorAccentCapabilities;
692 void CCamImgProc::SetColorAccentEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters)
694 TInt response = KErrNone;
696 if(aColorAccentParameters.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationEntry) ||
697 aColorAccentParameters.iNumBitsIgnored.Size() != sizeof(CCamera::CCameraImageProcessing::TBitsIgnore))
699 // new app. running on old impl.
700 iOwner.Notify2(KUidECamEventCIPSetColorAccentEntry, KErrNotSupported, aIndex);
704 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
706 iOwner.Notify2(KUidECamEventCIPSetColorAccentEntry, KErrArgument, aIndex);
710 if(!CheckColorAccentEntry(aColorAccentParameters))
712 // if color operation entry is different from what is supported....
713 iOwner.Notify2(KUidECamEventCIPSetColorAccentEntry, KErrArgument, aIndex);
717 iColorAccentParameter = aColorAccentParameters;
718 iColorAccentParameter.iEntryStatus = EDiscreteSteps;
720 iOwner.Notify2(KUidECamEventCIPSetColorAccentEntry, response, aIndex);
726 void CCamImgProc::RemoveColorAccentEntry(TInt aIndex)
728 TInt response = KErrNone;
730 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
732 iOwner.Notify2(KUidECamEventCIPRemoveColorAccentEntry, KErrArgument, aIndex);
736 iColorAccentParameter.iEntryStatus = ENotActive;
737 iOwner.Notify2(KUidECamEventCIPRemoveColorAccentEntry, response, aIndex);
741 void CCamImgProc::GetColorAccentEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) const
743 if(aIndex <0 || aIndex > KConcurrentColorOpSupported-1)
745 User::Leave(KErrArgument);
748 if(aColorAccentParameters.Size() != sizeof(CCamera::CCameraImageProcessing::TColorOperationEntry) ||
749 aColorAccentParameters.iNumBitsIgnored.Size() != sizeof(CCamera::CCameraImageProcessing::TBitsIgnore))
751 // new app. running on old impl.
752 User::Leave(KErrNotSupported);
756 aColorAccentParameters = iColorAccentParameter;
760 void CCamImgProc::StartColorAccent()
762 TInt response = KErrNone;
763 iOwner.Notify(KUidECamEventCIPStartColorAccent, response);
766 void CCamImgProc::CancelColorAccentL()
770 TBool CCamImgProc::CheckColorSwapEntry(const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) const
772 if(aColorSwapParameters.iSourceColorRepresentation != KDefault)
777 if(aColorSwapParameters.iTargetColorRepresentation != KDefault)
782 if(aColorSwapParameters.iColorOperationSourceRgbGroupingMode != KDefault)
787 if(aColorSwapParameters.iColorOperationTargetRgbGroupingMode != KDefault)
792 if(aColorSwapParameters.iNumBitsIgnored.iRedBitsIgnore != 0)
797 if(aColorSwapParameters.iNumBitsIgnored.iGreenBitsIgnore != 0)
802 if(aColorSwapParameters.iNumBitsIgnored.iBlueBitsIgnore != 0)
807 if(aColorSwapParameters.iNumBitsIgnored.iAlphaBitsIgnore != 0)
815 TBool CCamImgProc::CheckColorAccentEntry(const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) const
817 if(aColorAccentParameters.iSourceColorRepresentation != KDefault)
822 if(aColorAccentParameters.iColorOperationSourceRgbGroupingMode != KDefault)
827 if(aColorAccentParameters.iNumBitsIgnored.iRedBitsIgnore != 0)
832 if(aColorAccentParameters.iNumBitsIgnored.iGreenBitsIgnore != 0)
837 if(aColorAccentParameters.iNumBitsIgnored.iBlueBitsIgnore != 0)
842 if(aColorAccentParameters.iNumBitsIgnored.iAlphaBitsIgnore != 0)
850 void CCamImgProc::GetSupportedRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference /*aOrientationReference*/,
851 TUint& /*aSupportedRelativeRotation*/, TUint& /*aSupportedRelativeMirroring*/, TUint& /*aSupportedRelativeFlipping*/) const
853 User::Leave(KErrNotSupported);
856 void CCamImgProc::GetCurrentRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference& /*aOrientationReference*/,
857 CCamera::CCameraImageProcessing::TRelativeRotation& /*aRelativeRotation*/, CCamera::CCameraImageProcessing::
858 TRelativeMirror& /*aRelativeMirror*/, CCamera::CCameraImageProcessing::TRelativeFlipping& /*aRelativeFlipping*/) const
860 User::Leave(KErrNotSupported);
863 void CCamImgProc::SetRelativeOrientationOptions(CCamera::CCameraImageProcessing::TOrientationReference /*aOrientationReference*/,
864 CCamera::CCameraImageProcessing::TRelativeRotation /*aRelativeRotation*/, CCamera::CCameraImageProcessing::
865 TRelativeMirror /*aRelativeMirror*/, CCamera::CCameraImageProcessing::TRelativeFlipping /*aRelativeFlipping*/) const
867 iOwner.Notify(KUidECamEventImageProcessingTransformRelativeOrientation, KErrNotSupported);
874 CCamAdvSet::CCamAdvSet(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
879 CCamAdvSet::~CCamAdvSet()
884 CCamAdvSet* CCamAdvSet::NewL(CCamUnitTestPlugin& aOwner)
886 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
890 globalData = new (ELeave) CDataGlobal;
891 CleanupStack::PushL(globalData);
893 globalData->iReferenceCount = 0;
894 globalData->iCamAdvSet = new (ELeave) CCamAdvSet(aOwner);
895 globalData->iCamAdvSet->iRefCount = 1;
896 TInt error = Dll::SetTls(globalData);
899 delete globalData->iCamAdvSet;
902 CleanupStack::Pop(globalData);
903 return static_cast <CCamAdvSet*> (globalData->iCamAdvSet);
907 CCamAdvSet* self = globalData->iCamAdvSet;
909 globalData->iReferenceCount++;
910 self->iRefCount = globalData->iReferenceCount + 1;
911 if (globalData->iReferenceCount == 3 )
918 TInt error = Dll::SetTls(globalData);
921 delete globalData->iCamAdvSet;
925 return static_cast <CCamAdvSet*> (self);
929 void CCamAdvSet::Release()
938 void CCamAdvSet::Init()
940 iShutterSpeed = KDefaultShutterSpeed;
941 iFocusDistance = KDefaultFocusDistance;
942 iAperture = KDefaultAperture;
943 iFocusRange = CCamera::CCameraAdvancedSettings::EFocusRangeAuto;
944 iWhiteBalance = CCamera::EWBAuto;
946 iISORateType = CCamera::CCameraAdvancedSettings::EISOManual;
947 iSupportedISORateType = KSupportedISORateType;
948 iIsCapableActualISOValue = KCapableActualISOValue;
950 iSupportedAFAssistantLight = KAFAssistantLightManual;
951 iAFAssistantLight = CCamera::CCameraAdvancedSettings::EAFAssistantLightOff;
952 iPixelAspectRatio = CCamera::CCameraAdvancedSettings::EPixelAspect1To1;
953 iFlashMode = CCamera::EFlashNone;
955 iSupportedDriveModes |= CCamera::CCameraAdvancedSettings::EDriveModeSingleShot;
956 iSupportedDriveModes |= CCamera::CCameraAdvancedSettings::EDriveModeBurst;
957 iSupportedDriveModes |= CCamera::CCameraAdvancedSettings::EDriveModeTimeNudgeCapture;
959 iDriveMode = CCamera::CCameraAdvancedSettings::EDriveModeAuto;
962 CCamera::CCameraAdvancedSettings::TCameraType CCamAdvSet::CameraType() const
964 return iOwner.iCameraTypes[iOwner.iCameraIndex];
967 CCamera::CCameraAdvancedSettings::TCameraType CCamAdvSet::CameraType(TInt aCameraIndex) const
969 if (aCameraIndex >= KECamSetAvailableCameras)
971 return CCamera::CCameraAdvancedSettings::ECameraUnknown;
975 return iOwner.iCameraTypes[aCameraIndex];
979 TBool CCamAdvSet::IsCameraPresent() const
981 return iOwner.iCameras[iOwner.iCameraIndex];
984 TBool CCamAdvSet::IsCameraPresent(TInt aCameraIndex) const
986 if (aCameraIndex >= KECamSetAvailableCameras)
992 return iOwner.iCameras[aCameraIndex];
996 TInt CCamAdvSet::CameraIndex() const
998 return iOwner.iCameraIndex;
1001 TInt CCamAdvSet::SupportedStabilizationModes() const
1005 CCamera::CCameraAdvancedSettings::TStabilizationMode CCamAdvSet::StabilizationMode() const
1007 return CCamera::CCameraAdvancedSettings::EStabilizationModeOff;
1010 void CCamAdvSet::SetStabilizationMode(CCamera::CCameraAdvancedSettings::TStabilizationMode /*aStabilizationMode*/)
1014 TInt CCamAdvSet::SupportedFocusModes() const
1019 CCamera::CCameraAdvancedSettings::TFocusMode CCamAdvSet::FocusMode() const
1021 return CCamera::CCameraAdvancedSettings::EFocusModeAuto;
1024 void CCamAdvSet::SetFocusMode(CCamera::CCameraAdvancedSettings::TFocusMode /*aFocusMode*/)
1026 TInt response = KErrNone;
1028 RetrieveResult(response);
1030 iOwner.Notify(KUidECamEventCameraSettingFocusMode, response);
1033 TInt CCamAdvSet::SupportedFocusRanges() const
1035 return KFocusRangeSupported;
1038 CCamera::CCameraAdvancedSettings::TFocusRange CCamAdvSet::FocusRange() const
1043 void CCamAdvSet::SetFocusRange(CCamera::CCameraAdvancedSettings::TFocusRange aFocusRange )
1045 TInt response = KErrNone;
1047 RetrieveResult(response);
1049 iFocusRange = aFocusRange;
1050 iOwner.Notify(KUidECamEventCameraSettingFocusRange2, response);
1051 iOwner.Notify(KUidECamEventCameraSettingFocusRange, response);
1054 TInt CCamAdvSet::SupportedAutoFocusTypes() const
1059 CCamera::CCameraAdvancedSettings::TAutoFocusType CCamAdvSet::AutoFocusType() const
1061 return CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff;
1064 void CCamAdvSet::SetAutoFocusType(CCamera::CCameraAdvancedSettings::TAutoFocusType /*aAutoFocusType*/)
1066 TInt response = KErrNone;
1068 RetrieveResult(response);
1070 iOwner.Notify(KUidECamEventCameraSettingAutoFocusType2, response);
1071 iOwner.Notify(KUidECamEventCameraSettingAutoFocusType, response);
1074 TInt CCamAdvSet::SupportedAutoFocusAreas() const
1079 CCamera::CCameraAdvancedSettings::TAutoFocusArea CCamAdvSet::AutoFocusArea() const
1081 return CCamera::CCameraAdvancedSettings::EAutoFocusTypeAuto;
1084 void CCamAdvSet::SetAutoFocusArea(CCamera::CCameraAdvancedSettings::TAutoFocusArea /*aAutoFocusArea*/)
1086 TInt response = KErrNone;
1088 RetrieveResult(response);
1090 iOwner.Notify(KUidECamEventCameraSettingAutoFocusArea, response);
1093 TInt CCamAdvSet::FocusDistance() const
1095 return iFocusDistance;
1098 void CCamAdvSet::SetFocusDistance(TInt aDistance)
1100 TInt response = KErrNone;
1103 iFocusDistance = aDistance;
1105 RetrieveResult(response);
1109 response = KErrNotSupported;
1112 iOwner.Notify(KUidECamEventCameraSettingFocusDistance, response);
1115 TInt CCamAdvSet::GetMinFocalLength() const
1117 return KErrNotSupported;
1120 void CCamAdvSet::GetSupportedIsoRatesL(RArray<TInt>& aSupportedIsoRates) const
1122 //If no ISO is supported by camera, then leave
1123 if(!iOwner.iSupportedISORates.Count())
1125 User::Leave(KErrNotSupported);
1128 for(TInt index=0; index < iOwner.iSupportedISORates.Count(); index++)
1130 aSupportedIsoRates.AppendL(iOwner.iSupportedISORates[index]);
1134 TInt CCamAdvSet::IsoRate() const
1136 //this returned value may not be true if ISO type is other than manual and camera
1137 //has no capability to retrieve actual ISO rate.
1138 return iOwner.iIsoRate;
1141 void CCamAdvSet::SetIsoRate(TInt aRate)
1144 //check whether the desired rate to be set is being supported or not.
1145 if(iOwner.iSupportedISORates.Find(aRate) == KErrNotFound)
1147 response = KErrECamParameterNotInRange;
1151 //set the ISO type to Manual
1152 //this function should be called by SetISORateL as well after doing boundary checkings
1153 //SetISORate(CCamera::CCameraAdvancedSettings::EISOManual, aRate);
1154 iISORateType = CCamera::CCameraAdvancedSettings::EISOManual;
1155 iOwner.iIsoRate = aRate;
1157 RetrieveResult(response);
1159 iOwner.Notify(KUidECamEventCameraSettingIsoRate, response);
1162 void CCamAdvSet::GetSupportedISORateTypeL(TInt& aSupportedISORateTypes) const
1164 aSupportedISORateTypes = iSupportedISORateType;
1167 void CCamAdvSet::SetISORate(CCamera::CCameraAdvancedSettings::TISORateType aISORateType, TInt aParam)
1169 TInt response = KErrNone;
1171 if(!(aISORateType & iSupportedISORateType) || iOwner.iSupportedISORates.Count() == 0)
1173 response = KErrNotSupported;
1177 switch(aISORateType)
1179 case CCamera::CCameraAdvancedSettings::EISOManual:
1181 if(iOwner.iSupportedISORates.Find(aParam) == KErrNotFound)
1183 response = KErrECamParameterNotInRange;
1187 RetrieveResult(response);
1191 case CCamera::CCameraAdvancedSettings::EISOAutoUnPrioritised:
1193 RetrieveResult(response);
1196 case CCamera::CCameraAdvancedSettings::EISOAutoISOPrioritised:
1198 if(iOwner.iSupportedISORates.Find(aParam) == KErrNotFound)
1200 response = KErrECamParameterNotInRange;
1204 RetrieveResult(response);
1208 case CCamera::CCameraAdvancedSettings::EISOAutoShutterSpeedPrioritised:
1210 RetrieveResult(response);
1213 case CCamera::CCameraAdvancedSettings::EISOAutoAperturePrioritised:
1215 RetrieveResult(response);
1219 response = KErrNotSupported;
1222 // this function should be called by SetISORate ,in old API, as well after doing boundary checkings
1223 // SetISORate(aISORateType, aParam);
1224 // In real impl, following code should be handled by RunL when server responds to the setting request. Error may also occur.
1225 iISORateType = aISORateType;
1226 if(aISORateType == CCamera::CCameraAdvancedSettings::EISOManual)
1228 if(response == KErrNone)
1230 iOwner.iIsoRate = aParam;
1235 if(response == KErrNone)
1237 iAutoISOIndex = aParam;
1242 iOwner.Notify(KUidECamEventCameraSettingIsoRateType, response);
1245 void CCamAdvSet::GetISORateL(CCamera::CCameraAdvancedSettings::TISORateType& aISORateType, TInt& aParam, TInt& aISORate) const
1247 //If camera has no ISO rate supported, then leave
1248 if(iOwner.iSupportedISORates.Count() == 0)
1250 User::Leave(KErrNotSupported);
1253 if(iISORateType == CCamera::CCameraAdvancedSettings::EISONone)
1255 aISORateType = iISORateType;
1259 if(iISORateType != CCamera::CCameraAdvancedSettings::EISOManual)
1261 aParam = iAutoISOIndex;
1263 //if camera is not capable to retrieve actual ISO value in auto ISO modes, KErrNotFound is returned in aISORate.
1264 if(!iIsCapableActualISOValue)
1266 aISORate = KErrNotFound;
1270 aISORate = iOwner.iIsoRate;
1275 aISORate = iOwner.iIsoRate;
1278 aISORateType = iISORateType;
1282 void CCamAdvSet::GetAperturesL(RArray<TInt>& /*aFStops*/, TValueInfo& /*aInfo*/) const
1287 TInt CCamAdvSet::Aperture() const
1292 void CCamAdvSet::SetAperture(TInt aFStop)
1294 TInt response = KErrNone;
1297 RetrieveResult(response);
1299 iOwner.Notify(KUidECamEventCameraSettingAperture, response);
1302 void CCamAdvSet::GetShutterSpeedsL(RArray<TInt>& aShutterSpeeds, TValueInfo& aInfo) const
1304 aShutterSpeeds.Reset();
1308 TInt CCamAdvSet::ShutterSpeed() const
1310 return iShutterSpeed;
1313 void CCamAdvSet::SetShutterSpeed(TInt aShutterSpeed)
1315 TInt response = KErrNone;
1316 if (aShutterSpeed >=0)
1318 iShutterSpeed = aShutterSpeed;
1320 RetrieveResult(response);
1324 response = KErrNotSupported;
1327 iOwner.Notify(KUidECamEventCameraSettingShutterSpeed, response);
1330 TInt CCamAdvSet::SupportedMeteringModes() const
1332 return CCamera::CCameraAdvancedSettings::EMeteringModeAuto;
1335 CCamera::CCameraAdvancedSettings::TMeteringMode CCamAdvSet::MeteringMode() const
1337 return CCamera::CCameraAdvancedSettings::EMeteringModeAuto;
1340 void CCamAdvSet::SetMeteringMode(CCamera::CCameraAdvancedSettings::TMeteringMode /*aMeteringMode*/)
1342 TInt response = KErrNone;
1344 RetrieveResult(response);
1346 iOwner.Notify(KUidECamEventCameraSettingMeteringMode, response);
1349 TInt CCamAdvSet::SupportedDriveModes() const
1351 return iSupportedDriveModes;
1354 CCamera::CCameraAdvancedSettings::TDriveMode CCamAdvSet::DriveMode() const
1359 void CCamAdvSet::SetDriveMode(CCamera::CCameraAdvancedSettings::TDriveMode aDriveMode)
1361 TInt response = KErrNone;
1363 iDriveMode = aDriveMode;
1365 RetrieveResult(response);
1367 iOwner.Notify(KUidECamEventCameraSettingDriveMode, response);
1370 TInt CCamAdvSet::SupportedBracketModes() const
1372 return CCamera::CCameraAdvancedSettings::EBracketModeOff;
1375 CCamera::CCameraAdvancedSettings::TBracketMode CCamAdvSet::BracketMode() const
1377 return CCamera::CCameraAdvancedSettings::EBracketModeOff;
1380 void CCamAdvSet::SetBracketMode(CCamera::CCameraAdvancedSettings::TBracketMode /*aBracketMode*/)
1382 TInt response = KErrNone;
1384 RetrieveResult(response);
1386 iOwner.Notify(KUidECamEventCameraSettingBracketMode, response);
1389 TInt CCamAdvSet::SupportedBracketParameters() const
1391 return CCamera::CCameraAdvancedSettings::EBracketParameterNone;
1394 CCamera::CCameraAdvancedSettings::TBracketParameter CCamAdvSet::BracketParameter() const
1396 return CCamera::CCameraAdvancedSettings::EBracketParameterNone;
1399 void CCamAdvSet::SetBracketParameter(CCamera::CCameraAdvancedSettings::TBracketParameter /*aBracketParameter*/)
1403 TInt CCamAdvSet::SupportedBracketSteps() const
1405 return CCamera::CCameraAdvancedSettings::EBracketStepSmall;
1408 CCamera::CCameraAdvancedSettings::TBracketStep CCamAdvSet::BracketStep() const
1410 return CCamera::CCameraAdvancedSettings::EBracketStepSmall;
1413 void CCamAdvSet::SetBracketStep(CCamera::CCameraAdvancedSettings::TBracketStep /*aBracketStep*/)
1417 void CCamAdvSet::GetBracketMerge(TInt& aStartIndex, TInt& aFrames) const
1419 aStartIndex = KBracketStartIndex;
1420 aFrames = KBracketFrames;
1423 void CCamAdvSet::SetBracketMerge(TInt /*aStartIndex = 0*/, TInt /*aFrames = 2*/)
1427 TInt CCamAdvSet::SupportedFlashModes() const
1429 return (CCamera::EFlashVideoLight << 1) - 1;
1432 CCamera::TFlash CCamAdvSet::FlashMode() const
1434 return CCamera::TFlash(iFlashMode);
1437 void CCamAdvSet::SetFlashMode(CCamera::TFlash aMode)
1442 TBool CCamAdvSet::RedEyeReduceOn() const
1444 return KDefaultRedEyeReduce;
1447 void CCamAdvSet::SetRedEyeReduceOn(TBool /*aState*/)
1451 void CCamAdvSet::GetFlashCompensationStepsL(RArray<TInt>& /*aFlashCompensationSteps*/, TValueInfo& /*aInfo*/) const
1456 TInt CCamAdvSet::FlashCompensationStep() const
1458 return KFlashCompensationStep;
1461 TInt CCamAdvSet::GetFlashCompensationStep(TInt& aFlashCompensationStep) const
1463 aFlashCompensationStep = KFlashCompensationStep;
1467 void CCamAdvSet::GetFlashCompensationRangeInSteps(TInt& /*aNegativeCompensation*/, TInt& /*aPositiveCompensation*/) const
1471 void CCamAdvSet::SetFlashCompensationStep(TInt /*aFlashCompensationStep*/)
1476 TInt CCamAdvSet::FlashCompensation() const
1478 return KFlashCompensationInSteps;
1481 TInt CCamAdvSet::GetFlashCompensation(TInt& aFlashCompensation) const
1483 aFlashCompensation = KFlashCompensationInSteps;
1487 void CCamAdvSet::SetFlashCompensation(TInt /*aFlashCompensation*/)
1491 TBool CCamAdvSet::IsExternalFlashPresent() const
1493 return KExternalFlashPresentState;
1496 void CCamAdvSet::GetManualFlashPowerLevelsL(RArray<TInt>& /*aManualFlashPowerLevels*/, TValueInfo& /*aInfo*/) const
1501 TInt CCamAdvSet::ManualFlashPowerLevel() const
1503 return KManualFlashPowerLevel;
1506 void CCamAdvSet::SetManualFlashPowerLevel(TInt /*aManualFlashPowerLevel*/)
1511 TInt CCamAdvSet::SupportedExposureModes() const
1513 return CCamera::EExposureAuto;
1516 CCamera::TExposure CCamAdvSet::ExposureMode() const
1518 return CCamera::EExposureAuto;
1521 void CCamAdvSet::SetExposureMode(CCamera::TExposure /*aExposureMode = CCamera::EExposureAuto*/)
1525 void CCamAdvSet::GetExposureCompensationStepsL(RArray<TInt>& /*aExposureCompensationSteps*/, TValueInfo& /*aInfo*/) const
1529 void CCamAdvSet::GetExposureCompensationRangeInSteps(TInt& /*aNegativeCompensation*/, TInt& /*aPositiveCompensation*/) const
1533 TInt CCamAdvSet::ExposureCompensationStep() const
1535 return KExposureCompensationStep;
1538 TInt CCamAdvSet::GetExposureCompensationStep(TInt& aExposureCompensationStep) const
1540 aExposureCompensationStep = KExposureCompensationStep;
1544 void CCamAdvSet::SetExposureCompensationStep(TInt /*aExposureCompensationStep*/)
1548 TInt CCamAdvSet::ExposureCompensation() const
1550 return KExposureCompensationInSteps;
1553 TInt CCamAdvSet::GetExposureCompensation(TInt& aExposureCompensation) const
1555 aExposureCompensation = KExposureCompensationInSteps;
1559 void CCamAdvSet::SetExposureCompensation(TInt /*aExposureCompensation*/)
1563 TInt CCamAdvSet::SupportedWhiteBalanceModes() const
1565 return KWhiteBalanceSupported;
1568 CCamera::TWhiteBalance CCamAdvSet::WhiteBalanceMode() const
1570 return iWhiteBalance;
1573 void CCamAdvSet::SetWhiteBalanceMode(CCamera::TWhiteBalance aWhiteBalanceMode)
1575 TInt response = KErrNone;
1577 iWhiteBalance = aWhiteBalanceMode;
1578 RetrieveResult(response);
1580 iOwner.Notify(KUidECamEventCameraSettingsWBValue, response);
1583 TBool CCamAdvSet::ApertureExposureLockOn() const
1585 return KApertureExposureLockOn;
1588 void CCamAdvSet::SetApertureExposureLockOn(TBool /*aAELock*/)
1592 TBool CCamAdvSet::ShootClickOn() const
1594 return KShootClickOn;
1597 void CCamAdvSet::SetShootClickOn(TBool /*aShootClickOn*/)
1601 void CCamAdvSet::GetTimerIntervalsL(RArray<TInt>& /*aTimerIntervals*/, TValueInfo& /*aInfo*/) const
1605 TInt CCamAdvSet::TimerInterval() const
1607 return KTimerInterval;
1610 void CCamAdvSet::SetTimerInterval(TInt /*aTimerInterval*/)
1614 void CCamAdvSet::GetTimeLapsePeriodRange(TTime& /*aTimeLapseMin*/, TTime& /*aTimeLapseMax*/) const
1618 void CCamAdvSet::GetTimeLapse(TTime& /*aStart*/, TTime& /*aEnd*/, TTime& /*aInterval*/) const
1622 void CCamAdvSet::SetTimeLapse(const TTime& /*aStart*/, const TTime& /*aEnd*/, const TTime& /*aInterval*/)
1626 CCamera::CCameraAdvancedSettings::TPictureOrientation CCamAdvSet::PictureOrientation() const
1628 return CCamera::CCameraAdvancedSettings::EPictureOrientationUnknown;
1631 void CCamAdvSet::SetPictureOrientation(CCamera::CCameraAdvancedSettings::TPictureOrientation /*aOrientation*/)
1635 TInt CCamAdvSet::SupportedPixelAspectRatios() const
1637 return (CCamera::CCameraAdvancedSettings::EEPixelAspect40To33 << 1) - 1;
1640 CCamera::CCameraAdvancedSettings::TPixelAspectRatio CCamAdvSet::PixelAspectRatio() const
1642 return CCamera::CCameraAdvancedSettings::TPixelAspectRatio(iPixelAspectRatio);
1645 void CCamAdvSet::SetPixelAspectRatio(CCamera::CCameraAdvancedSettings::TPixelAspectRatio aPixelAspectRatio)
1647 iPixelAspectRatio = aPixelAspectRatio;
1650 TInt CCamAdvSet::SupportedYuvRanges() const
1652 return CCamera::CCameraAdvancedSettings::EYuvRangeFull;
1655 CCamera::CCameraAdvancedSettings::TYuvRange CCamAdvSet::YuvRange() const
1657 return CCamera::CCameraAdvancedSettings::EYuvRangeFull;
1660 void CCamAdvSet::SetYuvRange(CCamera::CCameraAdvancedSettings::TYuvRange /*aYuvRange*/)
1664 TInt CCamAdvSet::BurstImages() const
1666 return KBurstImages;
1669 void CCamAdvSet::SetBurstImages(TInt /*aImages*/)
1673 void CCamAdvSet::GetOpticalZoomStepsL(RArray<TInt>& /*aOpticalZoomSteps*/, TValueInfo& /*aInfo*/) const
1677 TInt CCamAdvSet::OpticalZoom() const
1679 return KECamFineResolutionFactor;
1682 void CCamAdvSet::SetOpticalZoom(TInt /*aOpticalZoom*/)
1686 void CCamAdvSet::GetDigitalZoomStepsL(RArray<TInt>& /*aDigitalZoomSteps*/,
1687 TValueInfo& /*aInfo*/) const
1691 void CCamAdvSet::GetDigitalZoomStepsForStillL(RArray<TInt>& /*aDigitalZoomSteps*/, TValueInfo& /*aInfo*/, TInt /*aSizeIndex*/,
1692 CCamera::TFormat /*aFormat*/, TBool& /*aIsInfluencePossible*/) const
1696 void CCamAdvSet::GetDigitalZoomStepsForVideoL(RArray<TInt>& /*aDigitalZoomSteps*/, TValueInfo& /*aInfo*/, TInt /*aFrameRateIndex*/,
1697 TInt /*aSizeIndex*/, CCamera::TFormat /*aFormat*/, TBool& /*aIsInfluencePossible*/, CCamera::TExposure /*aExposure*/) const
1701 TInt CCamAdvSet::DigitalZoom() const
1703 return KECamFineResolutionFactor;
1706 void CCamAdvSet::SetDigitalZoom(TInt /*aDigitalZoom*/)
1710 TBool CCamAdvSet::ExposureLockOn() const
1712 return KExposureLockOn;
1715 void CCamAdvSet::SetExposureLockOn(TBool /*aState*/)
1719 TBool CCamAdvSet::AutoFocusLockOn() const
1721 return KAutoFocusLockOn;
1724 void CCamAdvSet::SetAutoFocusLockOn(TBool /*aState*/)
1728 void CCamAdvSet::GetSupportedSettingsL(RArray<TUid>& aSettings) const
1731 // if camera is present
1732 if (iOwner.iCameras[iOwner.iCameraIndex])
1734 aSettings.AppendL(KUidECamEventCameraSettingStabilizationMode);
1735 aSettings.AppendL(KUidECamEventCameraSettingFocusMode);
1736 aSettings.AppendL(KUidECamEventCameraSettingIsoRateType);
1740 void CCamAdvSet::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const
1742 aActiveSettings.Reset();
1743 if (iOwner.iCameras[iOwner.iCameraIndex])
1745 aActiveSettings.AppendL(KUidECamEventCameraSettingFocusMode);
1746 aActiveSettings.AppendL(KUidECamEventCameraSettingAFAssistantLight);
1751 void CCamAdvSet::GetDisabledSettingsL(RArray<TUid>& aDisbledSettings) const
1753 aDisbledSettings.Reset();
1754 if (iOwner.iCameras[iOwner.iCameraIndex])
1756 aDisbledSettings.AppendL(KUidECamEventCameraSettingStabilizationMode);
1757 aDisbledSettings.AppendL(KUidECamEventCameraSettingReferenceScreen);
1761 void CCamAdvSet::SetAutomaticSizeSelectionChangeOn(TBool /*aSetOn = EFalse*/)
1765 TBool CCamAdvSet::AutomaticSizeSelectionChangeOn() const
1767 return KAutomaticSizeSelectionChangeOn;
1770 void CCamAdvSet::GetSupportedContinuousAutoFocusTimeoutsL(RArray<TInt>& /*aTimeouts*/, TValueInfo& /*aInfo*/) const
1774 void CCamAdvSet::SetContinuousAutoFocusTimeout(TInt /*aTimeout*/)
1778 void CCamAdvSet::SetStabilizationEffect(CCamera::CCameraAdvancedSettings::TStabilizationEffect /*aEffect*/)
1782 CCamera::CCameraAdvancedSettings::TStabilizationEffect CCamAdvSet::StabilizationEffect() const
1784 return CCamera::CCameraAdvancedSettings::EStabilizationOff;
1787 TInt CCamAdvSet::SupportedStabilizationEffects() const
1789 return CCamera::CCameraAdvancedSettings::EStabilizationOff;
1792 TInt CCamAdvSet::SupportedStabilizationComplexityValues() const
1794 return CCamera::CCameraAdvancedSettings::EStabilizationComplexityAuto;
1797 CCamera::CCameraAdvancedSettings::TStabilizationAlgorithmComplexity CCamAdvSet::StabilizationComplexity() const
1799 return CCamera::CCameraAdvancedSettings::EStabilizationComplexityAuto;
1802 void CCamAdvSet::SetStabilizationComplexity(CCamera::CCameraAdvancedSettings::TStabilizationAlgorithmComplexity /*aComplexity*/)
1806 CCamera::CCameraAdvancedSettings::TWBUnits CCamAdvSet::SupportedWBUnits() const
1808 return CCamera::CCameraAdvancedSettings::EWBColorTemperature;
1811 void CCamAdvSet::SetWBRgbValue(const TRgb& /*aValue*/)
1815 void CCamAdvSet::GetWBRgbValue(TRgb& /*aValue*/) const
1819 void CCamAdvSet::GetWBSupportedColorTemperaturesL(RArray<TInt>& /*aWBColorTemperatures*/, TValueInfo& /*aInfo*/) const
1823 void CCamAdvSet::SetWBColorTemperature(TInt /*aColorTemperature*/)
1827 TInt CCamAdvSet::WBColorTemperature() const
1829 return KWBColorTemperature;
1832 TInt CCamAdvSet::ContinuousAutoFocusTimeout() const
1834 return KContinuousAutoFocusTimeoutValue;
1837 TInt CCamAdvSet::IsFlashReady(TBool& aReady) const
1839 aReady = KFlashReadyState;
1843 void CCamAdvSet::GetCurrentFocusModeStepsL(RArray<TInt>& /*aFocusModeSteps*/, TValueInfo& /*aInfo*/) const
1847 void CCamAdvSet::SetReferenceScreen(CWsScreenDevice& /*aScreenDevice*/)
1849 TInt error = KErrNone;
1851 RetrieveResult(error);
1853 iOwner.Notify(KUidECamEventCameraSettingReferenceScreen, error);
1856 void CCamAdvSet::GetPreCaptureWarningSupportedL(CCamera::CCameraAdvancedSettings::TCameraMode /*aCameraMode*/, TInt& /*aPreCaptureWarningSupported*/) const
1860 void CCamAdvSet::SubscribeToPreCaptureWarningL(TInt /*aPreCaptureWarning*/)
1864 void CCamAdvSet::UnSubscribePreCaptureWarningL()
1868 void CCamAdvSet::GetPreCaptureWarningL(TInt& /*aPreCaptureWarning*/) const
1872 void CCamAdvSet::GetSupportedAFAssistantLightL(TInt& aSupportedAFAssistantLight) const
1874 aSupportedAFAssistantLight = iSupportedAFAssistantLight;
1877 void CCamAdvSet::GetAFAssistantLightL(CCamera::CCameraAdvancedSettings::TAFAssistantLight& aAFAssistantLight) const
1879 aAFAssistantLight = iAFAssistantLight;
1882 void CCamAdvSet::SetAFAssistantLight(CCamera::CCameraAdvancedSettings::TAFAssistantLight aAFAssistantLight)
1884 TInt error = KErrNone;
1886 iAFAssistantLight = aAFAssistantLight;
1887 RetrieveResult(error);
1889 iOwner.Notify(KUidECamEventCameraSettingAFAssistantLight, error);
1892 void CCamAdvSet::GetSupportedContinuousZoomTypeL(TUint& aSupportedContinuousZoomType) const
1894 aSupportedContinuousZoomType = KSupportedContinuousZoomType;
1897 void CCamAdvSet::GetFocalLengthInfoL(TInt& /*aMinFocalLength*/, TInt& /*aCurrentFocalLength*/, TInt& /*aMaxFocalLength*/) const
1899 User::Leave(KErrNotSupported);
1902 void CCamAdvSet::GetNumOperationPreferenceL(TUint& /*aNumOperationPreferenceSupported*/) const
1904 User::Leave(KErrNotSupported);
1907 void CCamAdvSet::EnumerateOperationPreferenceL(TUint /*aOperationPreferenceIndex*/, CCamera::CCameraAdvancedSettings::
1908 TPerformanceLevel& /*aSpeedLevel*/, CCamera::CCameraAdvancedSettings::TPerformanceLevel& /*aQualityLevel*/,
1909 CCamera::CCameraAdvancedSettings::TPerformanceLevel& /*aLowMemoryConsumptionLevel*/,
1910 CCamera::CCameraAdvancedSettings::TPerformanceLevel& /*aLowPowerConsumptionLevel*/) const
1912 User::Leave(KErrNotSupported);
1915 void CCamAdvSet::SetOperationPreference(TUint /*aOperationPreferenceIndex*/)
1917 iOwner.Notify(KUidECamEventCameraSettingOperationPreference, KErrNotSupported);
1921 void CCamAdvSet::GetOperationPreferenceL(TInt& /*aOperationPreferenceIndex*/) const
1923 User::Leave(KErrNotSupported);
1926 void CCamAdvSet::GetSupportedEventsL(RArray<TUid>& aSupportedEvents) const
1928 aSupportedEvents.Reset();
1931 void CCamAdvSet::GetIndirectFeatureChangesL(TUid /*aRequestedSetting*/, RArray<TUid>& aIndirectFeatureChanges) const
1933 aIndirectFeatureChanges.Reset();
1936 void CCamAdvSet::CreateContinuousZoomImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
1938 aImplFactoryPtr = CContinuousZoomFactory::NewL();
1941 void CCamAdvSet::RetrieveResult(TInt& aError)
1943 //It is assumed that hardware retrieves this error
1944 //Assumed that it returns no error
1947 /******************************************************/
1949 CCamManagement::CCamManagement(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
1953 CCamManagement::~CCamManagement()
1957 void CCamManagement::Release()
1962 CCamManagement* CCamManagement::NewL(CCamUnitTestPlugin& aOwner)
1964 return new (ELeave) CCamManagement(aOwner);
1967 TBool CCamManagement::PlugCameraIn(TInt aIndex)
1969 if (aIndex >= KECamSetAvailableCameras)
1975 TInt response = KErrNone;
1977 uid.iUid = (KUidECamEventGlobalCamera00PluggedInUidValue + aIndex);
1978 iOwner.iCameras[aIndex] = ETrue;
1979 iOwner.Notify(uid, response);
1984 TBool CCamManagement::PlugCameraOut(TInt aIndex)
1986 if (aIndex >= KECamSetAvailableCameras)
1992 TInt response = KErrNone;
1994 uid.iUid = KUidECamEventGlobalCamera00PluggedOutUidValue + aIndex;
1995 iOwner.iCameras[aIndex] = EFalse;
1996 iOwner.Notify(uid, response);
2003 //Snapshot factory for Image
2004 CContinuousZoomFactory* CContinuousZoomFactory::NewL()
2006 CContinuousZoomFactory* self = new(ELeave) CContinuousZoomFactory();
2008 CleanupStack::PushL(self);
2010 CleanupStack::Pop();
2015 void CContinuousZoomFactory::ConstructL()
2019 CContinuousZoomFactory::CContinuousZoomFactory() : iCamContinuousZoomImp(NULL)
2023 CContinuousZoomFactory::~CContinuousZoomFactory()
2027 TInt CContinuousZoomFactory::GetImpl(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/) const
2029 return KErrNotSupported;
2032 TInt CContinuousZoomFactory::GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const
2034 switch(aIfaceUid.iUid)
2036 case KECamMCameraContinuousZoomUidValue:
2038 CCamera::CCameraAdvancedSettings::TContinuousZoomType zoomType = static_cast<CCamera::CCameraAdvancedSettings::TContinuousZoomType>(aParam1.iIntParam);
2039 iCamContinuousZoomImp = CCamContinuousZoom::NewL(zoomType);
2040 aIfPtr = static_cast<MCameraContinuousZoom*>(iCamContinuousZoomImp);
2046 return KErrNotSupported;
2051 TInt CContinuousZoomFactory::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
2053 return KErrNotSupported;
2056 void CContinuousZoomFactory::Release()
2062 CCamContinuousZoom* CCamContinuousZoom::NewL(CCamera::CCameraAdvancedSettings::TContinuousZoomType aContinuousZoomType)
2064 CCamContinuousZoom* self = new (ELeave) CCamContinuousZoom(aContinuousZoomType);
2068 CCamContinuousZoom::CCamContinuousZoom(CCamera::CCameraAdvancedSettings::TContinuousZoomType aContinuousZoomType)
2069 : iZoomType(aContinuousZoomType)
2071 iInfo.iMaxSpeedSupported = 10;
2072 iInfo.iMinAccelerationSupported = 0;
2073 iInfo.iMaxAccelerationSupported = 0;
2074 iInfo.iContinuousZoomMinLimit = 0;
2075 iInfo.iContinuousZoomMaxLimit = 10;
2078 CCamContinuousZoom::~CCamContinuousZoom()
2082 void CCamContinuousZoom::SetContinuousZoomObserverAndHandle(MContinuousZoomObserver& aObserver, CCamera::CCameraContinuousZoom* aContinuousZoomHandle)
2084 iObserver = &aObserver;
2085 iContinuousZoomHandle = aContinuousZoomHandle;
2088 void CCamContinuousZoom::StartContinuousZoomL(CCamera::CCameraAdvancedSettings::TContinuousZoomParameters aContinuousZoomParameters)
2090 if(aContinuousZoomParameters.Size() != sizeof(CCamera::CCameraAdvancedSettings::TContinuousZoomParameters) ||
2091 aContinuousZoomParameters.Version() != KContinuousZoomParametersCurrentVersion)
2093 User::Leave(KErrNotSupported);
2096 if(aContinuousZoomParameters.iContinuousZoomSpeed > iInfo.iMaxSpeedSupported ||
2097 aContinuousZoomParameters.iContinuousZoomAcceleration < iInfo.iMinAccelerationSupported ||
2098 aContinuousZoomParameters.iContinuousZoomAcceleration > iInfo.iMaxAccelerationSupported ||
2099 aContinuousZoomParameters.iContinuousZoomLimit < iInfo.iContinuousZoomMinLimit ||
2100 aContinuousZoomParameters.iContinuousZoomLimit > iInfo.iContinuousZoomMaxLimit)
2102 User::Leave(KErrArgument);
2105 iParameters = aContinuousZoomParameters;
2106 for(TInt i = 0; i < iParameters.iContinuousZoomLimit; i++)
2108 iObserver->ContinuousZoomProgress(*iContinuousZoomHandle, i, KErrNone);
2111 iObserver->ContinuousZoomCompleted(*iContinuousZoomHandle, iParameters.iContinuousZoomLimit, KErrNone);
2114 void CCamContinuousZoom::StopContinuousZoom()
2119 void CCamContinuousZoom::GetContinuousZoomSupportInfoL(CCamera::CCameraAdvancedSettings::TContinuousZoomSupportInfo& aContinuousZoomInfo) const
2121 if(aContinuousZoomInfo.Size() != sizeof(CCamera::CCameraAdvancedSettings::TContinuousZoomSupportInfo) ||
2122 aContinuousZoomInfo.Version() != KContinuousZoomSupportInfoCurrentVersion)
2124 User::Leave(KErrNotSupported);
2127 aContinuousZoomInfo = iInfo;
2130 void CCamContinuousZoom::GetContinuousZoomId(TInt& aZoomId) const
2132 aZoomId = (TInt)(this);
2135 void CCamContinuousZoom::Release()