os/mm/imagingandcamerafws/camerafw/source/ecamviewfinder.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/imagingandcamerafws/camerafw/source/ecamviewfinder.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1105 @@
     1.4 +// Copyright (c) 2007-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 +//
    1.18 +
    1.19 +#include <ecamviewfinder.h>
    1.20 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.21 +#include <ecamviewfinderdef.h>
    1.22 +#endif
    1.23 +#include <ecam/camerahistogram.h>
    1.24 +#include <ecam/ecamviewfinderintf.h>
    1.25 +#include <ecam/implementationfactoryintf.h>
    1.26 +#include "ecamversion.h"
    1.27 +
    1.28 +/**	
    1.29 +CCameraViewFinder Constructor.
    1.30 +
    1.31 +@param aOwner
    1.32 +       a reference to a CCamera object providing the settings. 
    1.33 +
    1.34 +@internalComponent
    1.35 +@prototype
    1.36 +*/
    1.37 +CCameraViewFinder::CCameraViewFinder(CCamera& aOwner): iOwner(aOwner), iImplBase(NULL)
    1.38 +	{
    1.39 +	}
    1.40 +
    1.41 +/**
    1.42 +Destructor
    1.43 +*/	
    1.44 +CCameraViewFinder::~CCameraViewFinder()
    1.45 +	{
    1.46 +	}
    1.47 +
    1.48 +/**
    1.49 +Retrieves the fading capabilites for a particular viewfinder.
    1.50 +
    1.51 +@param  aVFFadingCapabilities
    1.52 +		Retrieves the fading capabilities associated with the given viewfinder.
    1.53 +		
    1.54 +@leave  May leave with any error code.
    1.55 +
    1.56 +@internalTechnology
    1.57 +*/
    1.58 +EXPORT_C void CCameraViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const
    1.59 +	{
    1.60 +	if(iImplBase != NULL)
    1.61 +		{
    1.62 +		iImplBase->GetViewFinderFadingCapabilitiesL(aVFFadingCapabilities);	
    1.63 +		}
    1.64 +	else
    1.65 +		{
    1.66 +		User::Leave(KErrNotSupported);	
    1.67 +		}	
    1.68 +	}
    1.69 +
    1.70 +/**
    1.71 +Retrieves the current fading effect/control being used for a particular viewfinder.
    1.72 +
    1.73 +@param  aCurrentVFFadingEffect
    1.74 +		Retrieves the fading effects associated with the given viewfinder.
    1.75 +		
    1.76 +@leave  May leave with any error code.
    1.77 +
    1.78 +@internalTechnology
    1.79 +*/
    1.80 +EXPORT_C void CCameraViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const
    1.81 +	{
    1.82 +	if(iImplBase != NULL)
    1.83 +		{
    1.84 +		iImplBase->GetViewFinderFadingEffectL(aCurrentVFFadingEffect);	
    1.85 +		}
    1.86 +	else
    1.87 +		{
    1.88 +		User::Leave(KErrNotSupported);	
    1.89 +		}
    1.90 +	}
    1.91 +
    1.92 +/**
    1.93 +Sets the fading effect/control for a particular viewfinder.
    1.94 +
    1.95 +@param  aVFFadingEffect
    1.96 +		The desired fading effects associated with the given viewfinder.
    1.97 +	
    1.98 +@leave  KErrNotSupported if the implementation of this method is not present.
    1.99 +		
   1.100 +@note   Event KUidECamEvent2ViewFinderFadingEffect is used to notify the requesting client about the setting of the 
   1.101 +		fading effect.
   1.102 +		
   1.103 +@internalTechnology
   1.104 +*/
   1.105 +EXPORT_C void CCameraViewFinder::SetViewFinderFadingEffectL(const CCameraViewFinder::TViewFinderFadingEffect& aVFFadingEffect)
   1.106 +	{
   1.107 +	if(iImplBase != NULL)
   1.108 +		{
   1.109 +		iImplBase->SetViewFinderFadingEffect(aVFFadingEffect);	
   1.110 +		}
   1.111 +	else
   1.112 +		{
   1.113 +		User::Leave(KErrNotSupported);	
   1.114 +		}
   1.115 +	}
   1.116 +	
   1.117 +/**
   1.118 +Retrieves the handle number which represents the given viewfinder object. 
   1.119 +
   1.120 +@param  aVFHandle
   1.121 +		The viewfinder handle
   1.122 +		
   1.123 +@leave  May leave with any error code.
   1.124 +
   1.125 +@note   KECamDefaultViewFinderHandle is used to refer to the viewfinder started using CCamera methods. 
   1.126 +*/
   1.127 +EXPORT_C void CCameraViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const
   1.128 +	{
   1.129 +	if(iImplBase != NULL)
   1.130 +		{
   1.131 +		iImplBase->GetViewFinderHandleL(aVFHandle);	
   1.132 +		}
   1.133 +	else
   1.134 +		{
   1.135 +		User::Leave(KErrNotSupported);	
   1.136 +		}
   1.137 +	}
   1.138 +
   1.139 +/**
   1.140 +Constructor for the TViewFinderFadingCapabilities class.
   1.141 +Sets the size and version of this class.
   1.142 +
   1.143 +@internalTechnology
   1.144 +*/
   1.145 +EXPORT_C CCameraViewFinder::TViewFinderFadingCapabilities::TViewFinderFadingCapabilities()
   1.146 +	{
   1.147 +	iSize = sizeof(CCameraViewFinder::TViewFinderFadingCapabilities);
   1.148 +	iVersion = KECamViewFinderFadingCapabilitiesCurrentVersion;
   1.149 +	}
   1.150 +	
   1.151 +/** 
   1.152 +Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables.
   1.153 +Intended to be used for implementation of methods where this class reference is passed as function arguments. 
   1.154 +Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application 
   1.155 +is made to run on an old implementation, an error may occur once the old implementation detects this by getting 
   1.156 +the size information of the T class passed. Also, if old application is made to run on a new implementation, this can be 
   1.157 +handled correctly if the derived class variables handling is done in a proper 'if-else' statement.
   1.158 +
   1.159 +@return The size of the class.
   1.160 +
   1.161 +@note The size will be modified when the T-class gets updated.
   1.162 +
   1.163 +@internalTechnology
   1.164 +*/
   1.165 +EXPORT_C TUint CCameraViewFinder::TViewFinderFadingCapabilities::Size() const
   1.166 +	{
   1.167 +	return iSize;
   1.168 +	}
   1.169 +	
   1.170 +/**	
   1.171 +Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved 
   1.172 +members get used at a later stage.
   1.173 +
   1.174 +@return The version of the class.
   1.175 +
   1.176 +@note The version will be modified when the T-class gets updated.
   1.177 +
   1.178 +@internalTechnology
   1.179 +*/
   1.180 +EXPORT_C TUint CCameraViewFinder::TViewFinderFadingCapabilities::Version() const
   1.181 +	{
   1.182 +	return iVersion;
   1.183 +	}
   1.184 +	
   1.185 +/**
   1.186 +Constructor for the TViewFinderFadingEffect class.
   1.187 +Sets the size and version of this class.
   1.188 +
   1.189 +@internalTechnology
   1.190 +*/
   1.191 +EXPORT_C CCameraViewFinder::TViewFinderFadingEffect::TViewFinderFadingEffect()
   1.192 +	{
   1.193 +	iSize = sizeof(CCameraViewFinder::TViewFinderFadingEffect);
   1.194 +	iVersion = KECamViewFinderFadingEffectCurrentVersion;
   1.195 +	}
   1.196 +	
   1.197 +/** 
   1.198 +Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables.
   1.199 +Intended to be used for implementation of methods where this class reference is passed as function arguments. 
   1.200 +Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application 
   1.201 +is made to run on an old implementation, an error may occur once the old implementation detects this by getting 
   1.202 +the size information of the T class passed. Also, if old application is made to run on a new implementation, this can be 
   1.203 +handled correctly if the derived class variables handling is done in a proper 'if-else' statement.
   1.204 +
   1.205 +@return The size of the class.
   1.206 +
   1.207 +@note The size will be modified when the T-class gets updated.
   1.208 +
   1.209 +@internalTechnology
   1.210 +*/
   1.211 +EXPORT_C TUint CCameraViewFinder::TViewFinderFadingEffect::Size() const
   1.212 +	{
   1.213 +	return iSize;
   1.214 +	}
   1.215 +	
   1.216 +/**	
   1.217 +Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved 
   1.218 +members get used at a later stage.
   1.219 +
   1.220 +@return The version of the class.
   1.221 +
   1.222 +@note The version will be modified when the T-class gets updated.
   1.223 +
   1.224 +@internalTechnology
   1.225 +*/
   1.226 +EXPORT_C TUint CCameraViewFinder::TViewFinderFadingEffect::Version() const
   1.227 +	{
   1.228 +	return iVersion;
   1.229 +	}
   1.230 +	
   1.231 +/**
   1.232 +Retrieves the position of spots for a given spot combination which is to be displayed on a particular viewfinder.
   1.233 +
   1.234 +@param  aSpotCombination
   1.235 +		A given spot combination. It is a bitfield where every bit represents the presence or absence of a particular spot.
   1.236 +		
   1.237 +@param  aSpotsPosition
   1.238 +		An array of TRect which represents the position of every spot present in the given spot combination. 
   1.239 +		The first member of this array maps the first spot present in the given spot combination from the least significant bit side.
   1.240 +		The position of a spot is relative to the top-left corner of viewfinder.
   1.241 +
   1.242 +@leave  May leave with any error code.
   1.243 +		
   1.244 +@note   These TRect specify the position of the spots relative to the targeted viewfinder space. Note 
   1.245 +        that spots could also be represented as points since point is a special case of rectangle.
   1.246 +		
   1.247 +@see 	CCamera::CCameraImageCaptureControl::GetMaximumSpotsL
   1.248 +@see	CCamera::CCameraImageCaptureControl::GetSupportedSpotsCombinationL
   1.249 +@see    CCamera::CCameraImageCaptureControl::GetSpotsCombinationL
   1.250 +@see    CCamera::CCameraImageCaptureControl::SetSpotsCombination
   1.251 +*/
   1.252 +void CCameraViewFinder::GetSpotsPositionL(TUint /*aSpotCombination*/, RArray<TRect>& /*aSpotsPosition*/) const
   1.253 +	{
   1.254 +	User::Leave(KErrNotSupported);	
   1.255 +	}
   1.256 +
   1.257 +/**
   1.258 +Retrieves the supported image enhancements.
   1.259 +
   1.260 +@param  aSupportedImageEnhancement
   1.261 +		A bitfield of all supported TImageEnhancement to be provided to the client.
   1.262 +
   1.263 +@leave  May leave with any error code.
   1.264 +*/
   1.265 +void CCameraViewFinder::GetSupportedImageEnhancementL(TUint& /*aSupportedImageEnhancement*/) const
   1.266 +	{
   1.267 +	User::Leave(KErrNotSupported);	
   1.268 +	}
   1.269 +
   1.270 +/**
   1.271 +Get the current image enhancement for the particular viewfinder.
   1.272 +
   1.273 +@param  aImageEnhancement
   1.274 +		Currently used TImageEnhancement for the viewfinder display.
   1.275 +		
   1.276 +@leave  May leave with any error code. 
   1.277 +*/
   1.278 +void CCameraViewFinder::GetImageEnhancementL(CCameraViewFinder::TImageEnhancement& /*aImageEnhancement*/) const
   1.279 +	{
   1.280 +	User::Leave(KErrNotSupported);	
   1.281 +	}
   1.282 +	
   1.283 +/**
   1.284 +Set the image enhancement for a particular viewfinder.
   1.285 +
   1.286 +@param  aImageEnhancement 
   1.287 +		The TImageEnhancement value to be set
   1.288 +		
   1.289 +@leave  KErrNotSupported If the implementation of this method is not present.
   1.290 +
   1.291 +@note   Event KUidECamEvent2ViewFinderImageEnhancement is used to notify clients about the image enhancement setting operation.
   1.292 +*/
   1.293 +void CCameraViewFinder::SetImageEnhancementL(CCameraViewFinder::TImageEnhancement /*aImageEnhancement*/)
   1.294 +	{
   1.295 +	User::Leave(KErrNotSupported);
   1.296 +	}
   1.297 +
   1.298 +/**
   1.299 +Retrieves the supported viewfinder magnification factor in terms of percentage. Changing the magnification factor allows 
   1.300 +the user to view more or less area than what would normally appear on the captured image.
   1.301 +
   1.302 +@param	aSupportedVFMagnification
   1.303 +		An array of TUint which retrieves the supported magnification factor. Every member of this array is a 
   1.304 +		magnification factor and represents a percentage unit. Note that every array member is multiplied by 
   1.305 +		KECamFineResolutionFactor to support fractional percentages as well. For example, 90.5% will be represented by 9050.
   1.306 +		
   1.307 +@leave  May leave with any error code.
   1.308 +*/
   1.309 +void CCameraViewFinder::GetSupportedVFMagnificationL(RArray<TUint>& /*aSupportedVFMagnification*/) const
   1.310 +	{
   1.311 +	User::Leave(KErrNotSupported);	
   1.312 +	}
   1.313 +
   1.314 +/**
   1.315 +Retrieves the current magnification factor for a particular viewfinder.
   1.316 +
   1.317 +@param  aVFMagnification
   1.318 +		The current magnification factor used for the given viewfinder. It represents a percentage unit. 
   1.319 +		Note that the magnification factor is multiplied by KECamFineResolutionFactor to support fractional 
   1.320 +		percentages as well. For example, 90.5% will be represented by 9050.
   1.321 +		
   1.322 +@leave  May leave with any error code.
   1.323 +*/
   1.324 +void CCameraViewFinder::GetViewfinderMagnificationL(TUint& /*aVFMagnification*/) const
   1.325 +	{
   1.326 +	User::Leave(KErrNotSupported);	
   1.327 +	}
   1.328 +
   1.329 +/**
   1.330 +Set a particular magnification factor for the given viewfinder.
   1.331 +
   1.332 +@param  aVFMagnification
   1.333 +		The magnification factor to be set. It represents a percentage unit. 
   1.334 +		Note that the magnification factor is multiplied by KECamFineResolutionFactor to support fractional 
   1.335 +		percentages as well. For example, 90.5% will be represented by 9050.
   1.336 +		
   1.337 +@leave  KErrNotSupported If the implementation of this method is not present.
   1.338 +
   1.339 +@note   Event KUidECamEvent2ViewFinderMagnification is used to notify the requesting client about the setting of the 
   1.340 +		magnification factor.
   1.341 +*/
   1.342 +void CCameraViewFinder::SetViewfinderMagnificationL(TUint /*aVFMagnification*/)
   1.343 +	{
   1.344 +	User::Leave(KErrNotSupported);
   1.345 +	}
   1.346 +
   1.347 +/**
   1.348 +Factory function for creating the CCameraV2DirectViewFinder object.
   1.349 +
   1.350 +@param aCamera 
   1.351 +	   A reference to a CCamera object providing the settings.
   1.352 +	   
   1.353 +@param aDirectViewFinderObserver
   1.354 +	   Reference to the direct view finder observer.
   1.355 +
   1.356 +@return A pointer to a fully constructed CCameraV2DirectViewFinder object.
   1.357 +
   1.358 +@leave KErrNoMemory Out of memory Or any other system-wide error code.
   1.359 +
   1.360 +@leave KErrExtensionNotSupported When NewL/NewDuplicateL used instead of New2L/NewDuplicate2L.
   1.361 +*/
   1.362 +EXPORT_C CCamera::CCameraV2DirectViewFinder* CCamera::CCameraV2DirectViewFinder::NewL(CCamera& aCamera, MDirectViewFinderObserver& aDirectViewFinderObserver)
   1.363 +	{
   1.364 + 	if(aCamera.CameraVersion() == KCameraDefaultVersion)
   1.365 + 		{
   1.366 + 		User::Leave(KErrExtensionNotSupported);
   1.367 + 		}
   1.368 + 		
   1.369 +	CCamera::CCameraV2DirectViewFinder* self = new (ELeave)CCamera::CCameraV2DirectViewFinder(aCamera); 
   1.370 +	CleanupStack::PushL(self);
   1.371 +	self->ConstructL(aDirectViewFinderObserver);
   1.372 +	CleanupStack::Pop(self);
   1.373 +	return self; 
   1.374 +	}
   1.375 +	
   1.376 +	
   1.377 +void CCamera::CCameraV2DirectViewFinder::ConstructL(MDirectViewFinderObserver& aDirectViewFinderObserver)
   1.378 +	{
   1.379 +	SetImplHandle();
   1.380 +	if(iImpl == NULL)
   1.381 +		{
   1.382 +		User::LeaveIfError(KErrNotSupported);		
   1.383 +		}
   1.384 +	SetImplBaseHandle();
   1.385 +	
   1.386 +	iImpl->SetDirectViewFinderObserver(aDirectViewFinderObserver);
   1.387 +	iImpl->SetDirectViewFinderHandle(this);
   1.388 +	}
   1.389 +	
   1.390 +/**	
   1.391 +CCameraV2DirectViewFinder Constructor.
   1.392 +
   1.393 +@param aOwner
   1.394 +       A reference to a CCamera object providing the settings. 
   1.395 +*/
   1.396 +CCamera::CCameraV2DirectViewFinder::CCameraV2DirectViewFinder(CCamera& aOwner): CCameraViewFinder(aOwner),iImpl(NULL)
   1.397 +	{
   1.398 +	}
   1.399 +
   1.400 +/**
   1.401 +Destructor
   1.402 +@note  The child objects created out of this direct viewfinder class object shall be delete beforehand. Various child 
   1.403 +	   objects are snapshot and histograms.
   1.404 +*/	
   1.405 +EXPORT_C CCamera::CCameraV2DirectViewFinder::~CCameraV2DirectViewFinder()
   1.406 +	{
   1.407 +	if (iImpl != NULL)
   1.408 +		{
   1.409 +		iImpl->Release(this);
   1.410 +		}
   1.411 +		
   1.412 +	if (iImplBase != NULL)
   1.413 +		{
   1.414 +		iImplBase->Release();
   1.415 +		}
   1.416 +	}	
   1.417 +	
   1.418 +/**
   1.419 +Retrieve pointer to histogram API in order to use it specifically for a particular viewfinder.
   1.420 +
   1.421 +@return Pointer to use histogram API specifically for the given viewfinder.
   1.422 +		
   1.423 +@leave  May leave with any error code.
   1.424 +
   1.425 +@note   Different types of histogram may be used for a specific viewfinder. Every time this method will be called
   1.426 +		on the CCameraV2DirectViewFinder class object, a new type of histogram will be created.
   1.427 +*/	
   1.428 +EXPORT_C CCamera::CCameraV2Histogram* CCamera::CCameraV2DirectViewFinder::CreateHistogramHandleL() const
   1.429 +	{
   1.430 +	MImplementationFactory* implFactory = NULL;
   1.431 +	
   1.432 +	iImpl->CreateHistogramImplFactoryL(implFactory);
   1.433 +	
   1.434 +	CleanupReleasePushL(*implFactory);
   1.435 +	CCamera::CCameraV2Histogram* histogram = CCamera::CCameraV2Histogram::CreateL(iOwner, *implFactory);
   1.436 +	CleanupStack::Pop(implFactory);
   1.437 +	
   1.438 +	implFactory->Release();
   1.439 +	return histogram;	
   1.440 +	}
   1.441 +
   1.442 +/**
   1.443 +Retrieve pointer to image processing API in order to use it specifically for a particular viewfinder.
   1.444 +
   1.445 +@return Pointer to use image processing API specifically for the given viewfinder.
   1.446 +		
   1.447 +@leave  May leave with any error code.
   1.448 +*/
   1.449 +EXPORT_C CCamera::CCameraImageProcessing* CCamera::CCameraV2DirectViewFinder::GetTransformationHandleL() const
   1.450 +	{
   1.451 +	MImplementationFactory* implFactory = NULL;
   1.452 +	
   1.453 +	iImpl->GetImageProcessingImplFactoryL(implFactory);
   1.454 +	
   1.455 +	CleanupReleasePushL(*implFactory);
   1.456 +	CCamera::CCameraImageProcessing* imgProc = CCamera::CCameraImageProcessing::CreateL(iOwner, *implFactory);
   1.457 +	CleanupStack::Pop(implFactory);
   1.458 +	
   1.459 +	implFactory->Release();
   1.460 +	return imgProc;	
   1.461 +	}
   1.462 +
   1.463 +/**
   1.464 +Retrieve pointer to direct snapshot API in order to use it for displaying the snapshots for still images directly on the 
   1.465 +given direct viewfinder screen. 
   1.466 +
   1.467 +@return Pointer to use direct snapshot API specifically for the given viewfinder.
   1.468 +		
   1.469 +@leave  May leave with any error code.
   1.470 +
   1.471 +@note  Direct snapshot API is not supposed to be used for snapshots for video.
   1.472 +*/
   1.473 +EXPORT_C CCamera::CCameraDirectSnapshot* CCamera::CCameraV2DirectViewFinder::GetDirectSnapshotHandleL() const
   1.474 +	{
   1.475 +	return CCamera::CCameraDirectSnapshot::CreateL(const_cast<CCamera::CCameraV2DirectViewFinder&>(*this));
   1.476 +	}
   1.477 +
   1.478 +/** 
   1.479 +Creates a new viewfinder and starts transfer of view finder data to the given portion of the screen using direct 
   1.480 +screen access.
   1.481 +
   1.482 +The aScreenRect parameter is in screen coordinates and may be modified if,
   1.483 +for example, the camera requires the destination to have a certain byte alignment, and so on.
   1.484 +
   1.485 +@param  aWs 
   1.486 +        Window server session.
   1.487 +@param  aScreenDevice 
   1.488 +        Screen device.
   1.489 +@param  aWindow 
   1.490 +        Displayable window.
   1.491 +@param  aScreenRect 
   1.492 +        Portion of the screen to which view finder data is to be
   1.493 +        transferred. This is in screen co-ordinates and may be modified if, for example,
   1.494 +        the camera requires the destination to have a certain byte alignment.
   1.495 +
   1.496 +@leave  KErrInUse if another direct viewfinder is running with the same set of window parameters. May leave with any other error code.
   1.497 +
   1.498 +@note   MDirectViewFinderObserver::DirectViewFinderFirstFrameDisplayed() will be used to notify clients that the first 
   1.499 +		frame has been displayed.
   1.500 +*/
   1.501 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, 
   1.502 +										RWindowBase& aWindow, TRect& aScreenRect)
   1.503 +	{
   1.504 +	iImpl->StartViewFinderDirectL(aWs, aScreenDevice, aWindow, aScreenRect);	
   1.505 +	}
   1.506 +
   1.507 +/** 
   1.508 +Creates a new viewfinder and starts transfer of view finder data to the given portion of the screen using direct screen
   1.509 +access and also clips to the specified portion of the screen.
   1.510 +
   1.511 +The view finder has the same size and position as aScreenRect but is only
   1.512 +visible in the intersection of aScreenRect and aClipRect. May leave with KErrNotSupported
   1.513 +or KErrNotReady if Reserve() has not been called, or has not yet completed.
   1.514 +
   1.515 +@param  aWs 
   1.516 +        Window server session.
   1.517 +@param  aScreenDevice 
   1.518 +        Screen device.
   1.519 +@param  aWindow 
   1.520 +        Displayable window.
   1.521 +@param  aScreenRect 
   1.522 +        Portion of the screen to which view finder data is to be
   1.523 +        transferred. This is in screen coordinates and may be modified if, for example,
   1.524 +        the camera requires the destination to have a certain byte alignment.
   1.525 +@param  aClipRect
   1.526 +        The rectangle to which the screen will be clipped.
   1.527 +
   1.528 +@leave  KErrInUse if another direct viewfinder is running with the same set of window parameters. May leave with any other error code.
   1.529 +
   1.530 +@note   MDirectViewFinderObserver::DirectViewFinderFirstFrameDisplayed() will be used to notify clients that the first 
   1.531 +		frame has been displayed.
   1.532 +*/									
   1.533 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice,
   1.534 +										RWindowBase& aWindow, TRect& aScreenRect, TRect& aClipRect)
   1.535 +	{
   1.536 +	iImpl->StartViewFinderDirectL(aWs, aScreenDevice, aWindow, aScreenRect, aClipRect);	
   1.537 +	}
   1.538 +
   1.539 +/**
   1.540 +Retrieves the parameters associated with the direct viewfinder.
   1.541 +
   1.542 +@param  aScreenNumber
   1.543 +		Retrieves the screen number on which the direct viewfinder is supposed to run.
   1.544 +		
   1.545 +@param  aScreenRect
   1.546 +		Retrieves the TRect which identifies the portion of the screen to which view finder data is to be transferred.
   1.547 +
   1.548 +@param  aClipRect
   1.549 +		Retrieves the TRect which identifies the rectangle to which the screen will be clipped.
   1.550 +		
   1.551 +@leave  May leave with any error code.
   1.552 +*/
   1.553 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::GetDirectViewFinderPropertiesL(TInt& aScreenNumber, TRect& aScreenRect, 
   1.554 +																						TRect& aClipRect) const
   1.555 +	{
   1.556 +	iImpl->GetDirectViewFinderPropertiesL(aScreenNumber, aScreenRect, aClipRect);	
   1.557 +	}
   1.558 +
   1.559 +/**
   1.560 +Pauses the direct viewfinder.
   1.561 +*/
   1.562 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::PauseViewFinderDirect()
   1.563 +	{
   1.564 +	iImpl->PauseViewFinderDirect();	
   1.565 +	}
   1.566 +
   1.567 +/**
   1.568 +Resumes the direct viewfinder
   1.569 +
   1.570 +@note   MDirectViewFinderObserver::DirectViewFinderFirstFrameDisplayed() will be used to notify clients that the first
   1.571 +		frame has been displayed.
   1.572 +*/
   1.573 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::ResumeViewFinderDirect()
   1.574 +	{
   1.575 +	iImpl->ResumeViewFinderDirect();	
   1.576 +	}
   1.577 +
   1.578 +/**
   1.579 +Retrieves the state of the direct viewfinder.
   1.580 +
   1.581 +@param  aViewFinderState
   1.582 +		Retrieves the state of the direct viewfinder.
   1.583 +		
   1.584 +@leave  May leave with any error code.
   1.585 +*/
   1.586 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::GetViewFinderStateL(CCamera::CCameraV2DirectViewFinder::TViewFinderState& aViewFinderState) const
   1.587 +	{
   1.588 +	iImpl->GetViewFinderStateL(aViewFinderState);	
   1.589 +	}
   1.590 +
   1.591 +/**
   1.592 +Stops the direct viewfinder.
   1.593 +*/
   1.594 +EXPORT_C void CCamera::CCameraV2DirectViewFinder::StopDirectViewFinder()
   1.595 +	{
   1.596 +	iImpl->StopDirectViewFinder();	
   1.597 +	}
   1.598 +
   1.599 +/** 
   1.600 +Gets the handle to the implementer's MCameraV2DirectViewFinder derived class.
   1.601 +*/	
   1.602 +void CCamera::CCameraV2DirectViewFinder::SetImplHandle()
   1.603 +	{
   1.604 +	if(iImpl == NULL)
   1.605 +		{
   1.606 +		iImpl = static_cast<MCameraV2DirectViewFinder*>(iOwner.CustomInterface(KECamMCameraV2DirectViewFinderUid));
   1.607 +		}
   1.608 +	}
   1.609 +
   1.610 +/** 
   1.611 +Gets the handle to the implementer's MCameraViewFinder derived class for v2 direct viewfinder.
   1.612 +*/	
   1.613 +void CCamera::CCameraV2DirectViewFinder::SetImplBaseHandle()
   1.614 +	{
   1.615 +	if(iImplBase == NULL)
   1.616 +		{
   1.617 +		iImplBase = static_cast<MCameraViewFinder*>(iOwner.CustomInterface(KECamMCameraBaseV2DirectViewFinderUid));
   1.618 +		}
   1.619 +	}
   1.620 +/**
   1.621 +Provides the interface pointer for the MCameraV2DirectViewFinder implementation.
   1.622 +
   1.623 +@return  Interface pointer for MCameraV2DirectViewFinder implementation.
   1.624 +*/	
   1.625 +MCameraV2DirectViewFinder* CCamera::CCameraV2DirectViewFinder::Impl()
   1.626 +	{
   1.627 +	return iImpl;
   1.628 +	}
   1.629 +
   1.630 +/**
   1.631 +Factory function for creating the CCameraClientViewFinder object.
   1.632 +
   1.633 +@param aCamera 
   1.634 +	   A reference to a CCamera object providing the settings.
   1.635 +	   
   1.636 +@param aClientViewFinderObserver
   1.637 +	   Reference to the client view finder observer.
   1.638 +
   1.639 +@return A pointer to a fully constructed CCameraClientViewFinder object.
   1.640 +
   1.641 +@leave KErrNoMemory Out of memory or any other system-wide error code.
   1.642 +
   1.643 +@leave KErrExtensionNotSupported When NewL/NewDuplicateL used instead of New2L/NewDuplicate2L.
   1.644 +*/
   1.645 +EXPORT_C CCamera::CCameraClientViewFinder* CCamera::CCameraClientViewFinder::NewL(CCamera& aCamera, MClientViewFinderObserver& aClientViewFinderObserver)
   1.646 +	{
   1.647 + 	if(aCamera.CameraVersion() == KCameraDefaultVersion)
   1.648 + 		{
   1.649 + 		User::Leave(KErrExtensionNotSupported);
   1.650 + 		}
   1.651 + 		
   1.652 +	CCamera::CCameraClientViewFinder* self = new (ELeave)CCamera::CCameraClientViewFinder(aCamera); 
   1.653 +	CleanupStack::PushL(self);
   1.654 +	self->ConstructL(aClientViewFinderObserver);
   1.655 +	CleanupStack::Pop(self);
   1.656 +	return self; 
   1.657 +	}
   1.658 +		
   1.659 +void CCamera::CCameraClientViewFinder::ConstructL(MClientViewFinderObserver& aClientViewFinderObserver)
   1.660 +	{
   1.661 +	SetImplHandle();
   1.662 +	if(iImpl == NULL)
   1.663 +		{
   1.664 +		User::LeaveIfError(KErrNotSupported);		
   1.665 +		}
   1.666 +	SetImplBaseHandle();
   1.667 +	
   1.668 +	iImpl->SetClientViewFinderObserver(aClientViewFinderObserver);
   1.669 +	iImpl->SetClientViewFinderHandle(this);
   1.670 +	}
   1.671 +	
   1.672 +/**	
   1.673 +CCameraClientViewFinder Constructor.
   1.674 +
   1.675 +@param aOwner
   1.676 +       a reference to a CCamera object providing the settings. 
   1.677 +*/
   1.678 +CCamera::CCameraClientViewFinder::CCameraClientViewFinder(CCamera& aOwner): CCameraViewFinder(aOwner), iImpl(NULL)
   1.679 +	{
   1.680 +	}
   1.681 +	
   1.682 +/**
   1.683 +Retrieve pointer to histogram API in order to use it specifically for a particular viewfinder.
   1.684 +
   1.685 +@return Pointer to use histogram API specifically for the given viewfinder.
   1.686 +		
   1.687 +@leave  May leave with any error code.
   1.688 +
   1.689 +@note   Different types of histogram may be used for a specific viewfinder. Every time this method will be called
   1.690 +		on the CCameraClientViewFinder class object, a new type of histogram will be created.
   1.691 +*/	
   1.692 +EXPORT_C CCamera::CCameraV2Histogram* CCamera::CCameraClientViewFinder::CreateHistogramHandleL() const
   1.693 +	{
   1.694 +	MImplementationFactory* implFactory = NULL;
   1.695 +	
   1.696 +	iImpl->CreateHistogramImplFactoryL(implFactory);
   1.697 +	
   1.698 +	CleanupReleasePushL(*implFactory);
   1.699 +	CCamera::CCameraV2Histogram* histogram = CCamera::CCameraV2Histogram::CreateL(iOwner, *implFactory);
   1.700 +	CleanupStack::Pop(implFactory);
   1.701 +	
   1.702 +	implFactory->Release();
   1.703 +	return histogram;	
   1.704 +	}
   1.705 +
   1.706 +/**
   1.707 +Retrieve pointer to image processing API in order to use it specifically for a particular viewfinder.
   1.708 +
   1.709 +@return Pointer to use image processing API specifically for the given viewfinder.
   1.710 +		
   1.711 +@leave  May leave with any error code.
   1.712 +*/
   1.713 +EXPORT_C CCamera::CCameraImageProcessing* CCamera::CCameraClientViewFinder::GetTransformationHandleL() const
   1.714 +	{
   1.715 +	MImplementationFactory* implFactory = NULL;
   1.716 +	
   1.717 +	iImpl->GetImageProcessingImplFactoryL(implFactory);
   1.718 +	
   1.719 +	CleanupReleasePushL(*implFactory);
   1.720 +	CCamera::CCameraImageProcessing* imgProc = CCamera::CCameraImageProcessing::CreateL(iOwner, *implFactory);
   1.721 +	CleanupStack::Pop(implFactory);
   1.722 +	
   1.723 +	implFactory->Release();
   1.724 +	return imgProc;	
   1.725 +	}
   1.726 +
   1.727 +/** 
   1.728 +Creates a new viewfinder and starts transfer of view finder data.
   1.729 +
   1.730 +Availability of viewfinder data is notified by MClientViewFinderObserver::ViewFinderBufferReady().
   1.731 +
   1.732 +@param  aScreenNumber
   1.733 +		The screen number on which the client viewfinder is supposed to run.
   1.734 +@param  aImageFormat 
   1.735 +        The image format requested by the client.
   1.736 +@param  aSize 
   1.737 +        On return, the size used. The size may be modified by the implementation because of hardware constraints and 
   1.738 +        byte alignment.
   1.739 +
   1.740 +@leave  May leave with any error code.
   1.741 +
   1.742 +@note   KECamDefaultViewFinderHandle is used to refer to the viewfinder started using CCamera methods.
   1.743 +
   1.744 +@see	CCamera::StartViewFinderL(TFormat aImageFormat,TSize& aSize)
   1.745 +*/
   1.746 +EXPORT_C void CCamera::CCameraClientViewFinder::StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize)
   1.747 +	{
   1.748 +	iImpl->StartClientViewFinderL(aScreenNumber, aImageFormat, aSize);
   1.749 +	}
   1.750 +
   1.751 +/** 
   1.752 +Creates a new viewfinder and starts transfer of view finder data. Also, clips the picture to the specified clip	rectangle. 
   1.753 +
   1.754 +Availability of viewfinder data is notified by MClientViewFinderObserver::ViewFinderBufferReady().
   1.755 +
   1.756 +The picture is the size of the intersection of aSize and aClipRect, not simply
   1.757 +aSize padded with white space.
   1.758 +
   1.759 +@param  aScreenNumber
   1.760 +		The screen number on which the client viewfinder is supposed to run.
   1.761 +@param  aImageFormat 
   1.762 +        The image format.
   1.763 +@param  aSize
   1.764 +        On return, the size used. The size may be modified by the implementation because of hardware constraints and
   1.765 +        byte alignment.
   1.766 +@param  aClipRect 
   1.767 +        Required clip rectangle. May be modified if, for example,
   1.768 +        the camera only supports certain byte alignments.
   1.769 +
   1.770 +@leave  May leave with any error code.
   1.771 +
   1.772 +@note   KECamDefaultViewFinderHandle is used to refer viewfinder started using CCamera methods.
   1.773 +
   1.774 +@see	CCamera::StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect)
   1.775 +*/
   1.776 +EXPORT_C void CCamera::CCameraClientViewFinder::StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize, TRect& aClipRect)
   1.777 +	{
   1.778 +	iImpl->StartClientViewFinderL(aScreenNumber, aImageFormat, aSize, aClipRect);
   1.779 +	}
   1.780 +
   1.781 +/**
   1.782 +Retrieves the state of the client viewfinder.
   1.783 +
   1.784 +@param  aIsActive
   1.785 +		ETrue indicates that client viewfinder is active.
   1.786 +		EFalse indicates that client viewfinder is not active.
   1.787 +
   1.788 +@leave  May leave with any error code.
   1.789 +*/
   1.790 +EXPORT_C void CCamera::CCameraClientViewFinder::GetClientViewFinderStateL(TBool& aIsActive) const
   1.791 +	{
   1.792 +	iImpl->GetClientViewFinderStateL(aIsActive);	
   1.793 +	}
   1.794 +
   1.795 +/**
   1.796 +Retrieves the parameters associated with the client viewfinder.
   1.797 +
   1.798 +@param  aScreenNumber
   1.799 +		Retrieves the screen number on which the client viewfinder is supposed to run.
   1.800 +		
   1.801 +@param  aImageFormat
   1.802 +		Retrieves the image format of the client viewfinder.
   1.803 +
   1.804 +@param  aSize
   1.805 +		Retrieves the size used for the client viewfinder.
   1.806 +		
   1.807 +@param	aClipRect
   1.808 +		Retrieves the clip rectangle. If not specified, the clipping is retrieved as a TRect having origin as top left 
   1.809 +		corner and the size as 'aSize'.
   1.810 +		
   1.811 +@leave  May leave with any error code.
   1.812 +*/
   1.813 +EXPORT_C void CCamera::CCameraClientViewFinder::GetClientViewFinderPropertiesL(TInt& aScreenNumber, CCamera::TFormat& aImageFormat, TSize& aSize, TRect& aClipRect) const
   1.814 +	{
   1.815 +	iImpl->GetClientViewFinderPropertiesL(aScreenNumber, aImageFormat, aSize, aClipRect);
   1.816 +	}
   1.817 +
   1.818 +/**
   1.819 +Stop the client viewfinder.
   1.820 +*/
   1.821 +EXPORT_C void CCamera::CCameraClientViewFinder::StopClientViewFinder()
   1.822 +	{
   1.823 +	iImpl->StopClientViewFinder();
   1.824 +	}
   1.825 +
   1.826 +/**
   1.827 +Retrieves the client viewfinder buffer. Client calls this method after being notified about availability of viewfinder
   1.828 +data via MClientViewFinderObserver::ViewFinderBufferReady().
   1.829 +
   1.830 +@param  aClientViewFinderBuffer
   1.831 +		Reference to MCameraBuffer2 which retrieves the client viewfinder data.
   1.832 +
   1.833 +@leave  May leave with any error code.
   1.834 +*/	
   1.835 +EXPORT_C void CCamera::CCameraClientViewFinder::GetViewFinderBufferL(MCameraBuffer2& aClientViewFinderBuffer) const
   1.836 +	{
   1.837 +	iImpl->GetViewFinderBufferL(aClientViewFinderBuffer);	
   1.838 +	}
   1.839 +
   1.840 +/**
   1.841 +Destructor
   1.842 +@note  The child objects created out of this client viewfinder class object shall be delete beforehand. Various child 
   1.843 +	   objects are snapshot and histograms.
   1.844 +*/	
   1.845 +EXPORT_C CCamera::CCameraClientViewFinder::~CCameraClientViewFinder()
   1.846 +	{
   1.847 +	if (iImpl != NULL)
   1.848 +		{
   1.849 +		iImpl->Release(this);
   1.850 +		}
   1.851 +		
   1.852 +	if (iImplBase != NULL)
   1.853 +		{
   1.854 +		iImplBase->Release();
   1.855 +		}
   1.856 +	}
   1.857 +
   1.858 +/** 
   1.859 +Gets the handle to the implementer's MCameraClientViewFinder derived class.
   1.860 +*/	
   1.861 +void CCamera::CCameraClientViewFinder::SetImplHandle()
   1.862 +	{
   1.863 +	if(iImpl == NULL)
   1.864 +		{
   1.865 +		iImpl = static_cast<MCameraClientViewFinder*>(iOwner.CustomInterface(KECamMCameraClientViewFinderUid));
   1.866 +		}
   1.867 +	}
   1.868 +
   1.869 +/** 
   1.870 +Gets the handle to the implementer's MCameraViewFinder derived class for client viewfinder.
   1.871 +*/	
   1.872 +void CCamera::CCameraClientViewFinder::SetImplBaseHandle()
   1.873 +	{
   1.874 +	if(iImplBase == NULL)
   1.875 +		{
   1.876 +		iImplBase = static_cast<MCameraViewFinder*>(iOwner.CustomInterface(KECamMCameraBaseClientViewFinderUid));
   1.877 +		}
   1.878 +	}
   1.879 +
   1.880 +/**
   1.881 +@internalComponent
   1.882 +
   1.883 +Factory function that creates a new camera direct snapshot object.
   1.884 +
   1.885 +@param	aDirectViewFinder
   1.886 +		A reference to the camera direct viewfinder object for which a camera direct snapshot object is to be created.
   1.887 +		
   1.888 +@leave  KErrNoMemory if out of memory; also any system wide error.
   1.889 +
   1.890 +@return A pointer to a fully constructed camera direct snapshot object.
   1.891 +*/	
   1.892 +EXPORT_C CCamera::CCameraDirectSnapshot* CCamera::CCameraDirectSnapshot::CreateL(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder)
   1.893 +	{
   1.894 +	CCamera::CCameraDirectSnapshot* self = new (ELeave) CCamera::CCameraDirectSnapshot();
   1.895 +	CleanupStack::PushL(self);
   1.896 +	self->ConstructL(aDirectViewFinder);
   1.897 +	CleanupStack::Pop(self);
   1.898 +	return self; 
   1.899 +	}
   1.900 +
   1.901 +/**
   1.902 +@internalComponent
   1.903 +
   1.904 +CCameraDirectSnapshot second phase constructor 
   1.905 +
   1.906 +Function used to initialise internal state of the object. 
   1.907 +
   1.908 +@param	aDirectViewFinder
   1.909 +		A reference to the camera direct viewfinder object on which the direct snapshot will be displayed.
   1.910 +
   1.911 +@leave KErrNoMemory Out of memory; or any other error code as well.
   1.912 +
   1.913 +@note This method is supposed to be used by this class only.
   1.914 +*/ 
   1.915 +void CCamera::CCameraDirectSnapshot::ConstructL(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder) 
   1.916 +	{
   1.917 +	iImpl = static_cast<MCameraDirectSnapshot*>(DirectViewFinderImpl(aDirectViewFinder)->GetDirectSnapshotImpl(KECamMCameraDirectSnapshotUid));
   1.918 +
   1.919 +	if (iImpl == NULL)
   1.920 +		{
   1.921 +		User::Leave(KErrNotSupported);
   1.922 +		}
   1.923 +		
   1.924 +	iImpl->SetDirectViewFinder(&aDirectViewFinder);
   1.925 +	}
   1.926 +	
   1.927 +/**
   1.928 +Constructor for the CCameraDirectSnapshot class.
   1.929 +*/
   1.930 +CCamera::CCameraDirectSnapshot::CCameraDirectSnapshot():iImpl(NULL)
   1.931 +	{
   1.932 +	}
   1.933 +
   1.934 +/**
   1.935 +Provides the interface pointer for the concrete implementation of CCameraV2DirectViewFinder. 
   1.936 +
   1.937 +@param	aDirectViewFinder
   1.938 +		A reference to the camera direct viewfinder object
   1.939 +
   1.940 +@return interface pointer for the concrete implementation of CCameraV2DirectViewFinder.
   1.941 +*/
   1.942 +MCameraV2DirectViewFinder* CCamera::CCameraDirectSnapshot::DirectViewFinderImpl(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder)
   1.943 +	{
   1.944 +	return aDirectViewFinder.Impl();
   1.945 +	}
   1.946 +	
   1.947 +/**
   1.948 +Destructor
   1.949 +*/
   1.950 +EXPORT_C CCamera::CCameraDirectSnapshot::~CCameraDirectSnapshot()
   1.951 +	{
   1.952 +	if (iImpl != NULL)
   1.953 +		{
   1.954 +		iImpl->Release();
   1.955 +		}
   1.956 +	}
   1.957 +
   1.958 +/**
   1.959 +Retrieve the version2 direct viewfinder object out of which this direct snapshot has been created. This information may be
   1.960 +required by the client in order to map the direct snapshot object with its parent version2 direct viewfinder object or also
   1.961 +to retrieve properties of its parent version2 direct viewfinder object.
   1.962 +
   1.963 +@param	aDirectViewFinder
   1.964 +		A pointer to the camera version2 direct viewfinder object on which the direct snapshot will be displayed.
   1.965 +
   1.966 +@leave  May leave with any error code.
   1.967 +*/
   1.968 +EXPORT_C void CCamera::CCameraDirectSnapshot::GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const
   1.969 +	{
   1.970 +	iImpl->GetDirectViewFinderL(aDirectViewFinder);
   1.971 +	}
   1.972 +
   1.973 +/**
   1.974 +Enable the direct snapshot. The direct snapshot will be displayed on the parent direct viewfinder screen. The screen size
   1.975 +of the snapshot will be the same as that of the parent direct viewfinder screen.
   1.976 +
   1.977 +The direct snapshot can be displayed only for still images.
   1.978 +
   1.979 +@param  aDirectSnapshotParameters
   1.980 +		The desired direct snapshot parameter.
   1.981 +		
   1.982 +@leave  May leave with any error code.
   1.983 +*/
   1.984 +EXPORT_C void CCamera::CCameraDirectSnapshot::EnableDirectSnapshotL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
   1.985 +	{
   1.986 +	iImpl->EnableDirectSnapshotL(aDirectSnapshotParameters);
   1.987 +	}
   1.988 +
   1.989 +/**
   1.990 +Disable the direct snapshot. The direct snapshot will not be displayed on the parent direct viewfinder screen.
   1.991 +*/
   1.992 +EXPORT_C void CCamera::CCameraDirectSnapshot::DisableDirectSnapshot()
   1.993 +	{
   1.994 +	iImpl->DisableDirectSnapshot();
   1.995 +	}
   1.996 +
   1.997 +/**
   1.998 +Retrieves the current state for direct snapshot.
   1.999 +
  1.1000 +@param  aDirectSnapshotParameters
  1.1001 +		Retrieves the current state for direct snapshot.
  1.1002 +		
  1.1003 +@leave  May leave with any error code.
  1.1004 +*/	
  1.1005 +EXPORT_C void CCamera::CCameraDirectSnapshot::GetDirectSnapshotStateL(CCamera::CCameraDirectSnapshot::TDirectSnapshotState& aDirectSnapshotState) const
  1.1006 +	{
  1.1007 +	iImpl->GetDirectSnapshotStateL(aDirectSnapshotState);
  1.1008 +	}
  1.1009 +
  1.1010 +/**
  1.1011 +Retrieves the direct snapshot parameters. 
  1.1012 +
  1.1013 +@param  aDirectSnapshotParameters
  1.1014 +		Retrieves the direct snapshot parameter of type TDirectSnapshotParameters.
  1.1015 +		
  1.1016 +@leave  May leave with any error code.
  1.1017 +*/
  1.1018 +EXPORT_C void CCamera::CCameraDirectSnapshot::GetDirectSnapshotParametersL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) const
  1.1019 +	{
  1.1020 +	iImpl->GetDirectSnapshotParametersL(aDirectSnapshotParameters);	
  1.1021 +	}
  1.1022 +
  1.1023 +/**
  1.1024 +Sets the direct snapshot parameters. 
  1.1025 +
  1.1026 +@param  aDirectSnapshotParameters
  1.1027 +		The desired direct snapshot parameter of type TDirectSnapshotParameters.
  1.1028 +		
  1.1029 +@leave  May leave with any error code.
  1.1030 +*/	
  1.1031 +EXPORT_C void CCamera::CCameraDirectSnapshot::SetDirectSnapshotParametersL(const CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
  1.1032 +	{
  1.1033 +	iImpl->SetDirectSnapshotParametersL(aDirectSnapshotParameters);		
  1.1034 +	}
  1.1035 +
  1.1036 +/**
  1.1037 +Constructor for the TDirectSnapshotParameters class.
  1.1038 +Sets the size and version of this class.
  1.1039 +*/
  1.1040 +EXPORT_C CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::TDirectSnapshotParameters()
  1.1041 +	{
  1.1042 +	iSize = sizeof(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters);
  1.1043 +	iVersion = KECamViewFinderFadingEffectCurrentVersion;
  1.1044 +	}
  1.1045 +	
  1.1046 +/** 
  1.1047 +Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables.
  1.1048 +Intended to be used for implementation of methods where this class reference is passed as function arguments. 
  1.1049 +Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application 
  1.1050 +is made to run on an old implementation, an error may occur once the old implementation detects this by getting 
  1.1051 +the size information of the T class passed. Also, if old application is made to run on a new implementation, this can be 
  1.1052 +handled correctly if the derived class variables handling is done in a proper 'if-else' statement.
  1.1053 +
  1.1054 +@return The size of the class.
  1.1055 +
  1.1056 +@note The size will be modified when the T-class gets updated.
  1.1057 +*/	
  1.1058 +EXPORT_C TUint CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::Size() const
  1.1059 +	{
  1.1060 +	return iSize;
  1.1061 +	};
  1.1062 +
  1.1063 +/**	
  1.1064 +Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved 
  1.1065 +members get used at a later stage.
  1.1066 +
  1.1067 +@return The version of the class.
  1.1068 +
  1.1069 +@note The version will be modified when the T-class gets updated.
  1.1070 +*/
  1.1071 +EXPORT_C TUint CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::Version() const
  1.1072 +	{
  1.1073 +	return iVersion;
  1.1074 +	};
  1.1075 +		
  1.1076 +/** 
  1.1077 +Indicates whether the aspect ratio of the direct snapshot image has to maintained (if ETrue) or not (if EFalse) 
  1.1078 +while scaling down.
  1.1079 +
  1.1080 +@return TBool: ETrue implies aspect ratio has to be maintained, EFalse otherwise.
  1.1081 +
  1.1082 +@see CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::iIsAspectRatioMaintained
  1.1083 +*/
  1.1084 +EXPORT_C TBool CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::IsAspectRatioMaintained() const
  1.1085 +	{
  1.1086 +	if (iIsAspectRatioMaintained)
  1.1087 +		{
  1.1088 +		return ETrue;
  1.1089 +		}
  1.1090 +	else
  1.1091 +		{
  1.1092 +		return EFalse;
  1.1093 +		}	
  1.1094 +	}
  1.1095 +	
  1.1096 +/** 
  1.1097 +Sets the state to inform whether the aspect ratio of the direct snapshot image has to be maintained or not while scaling
  1.1098 +down.
  1.1099 +
  1.1100 +@param  aIsAspectRatioMaintained
  1.1101 +		ETrue implies must be maintained, EFalse otherwise.
  1.1102 +		
  1.1103 +@see CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::iIsAspectRatioMaintained
  1.1104 +*/
  1.1105 +EXPORT_C void CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters::SetAspectRatioState(TBool aIsAspectRatioMaintained)
  1.1106 +	{
  1.1107 +	iIsAspectRatioMaintained = static_cast<TUint>(aIsAspectRatioMaintained);
  1.1108 +	}