imagingandcamerafws/camerafw/Include/MCameraOverlay.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef MCAMERAOVERLAY_H
       
    23 #define MCAMERAOVERLAY_H
       
    24 
       
    25 #include <ecam/cameraoverlay.h>
       
    26 #include <ecam/ecamcommonuidif.hrh>
       
    27 
       
    28 /** 
       
    29 This is the UID which is used to obtain the MCameraOverlay interface, 
       
    30 via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface.
       
    31 
       
    32 @see KECamMCameraOverlayUidValue
       
    33  */   
       
    34 static const TUid KECamMCameraOverlayUid = {KECamMCameraOverlayUidValue};
       
    35 
       
    36 /** 
       
    37 This is the UID which is used to obtain the MCameraOverlay2 interface, 
       
    38 via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface.
       
    39 
       
    40 @see KECamMCameraOverlay2UidValue
       
    41 
       
    42 @publishedPartner
       
    43 @prototype
       
    44 */   
       
    45 static const TUid KECamMCameraOverlay2Uid = {KECamMCameraOverlay2UidValue};
       
    46 
       
    47 
       
    48 /**
       
    49 This is a mixin class to be implemented by providers of the camera extension API for image overlays.
       
    50 
       
    51 @note This class is intended for sub classing by licensees only.
       
    52 
       
    53 @see CCamera::CCameraOverlay
       
    54 
       
    55 @publishedPartner
       
    56 @released
       
    57 */
       
    58 class MCameraOverlay
       
    59 	{
       
    60 public:		
       
    61 	/**
       
    62 	Creates an image overlay object on the ECam implementation, returning a handle to the newly created object.
       
    63 
       
    64 	@param	aParameters
       
    65 			The parameters characterizing the overlay to be created. 
       
    66 	@param	aBitmap
       
    67 			The image that is to become the overlay.
       
    68 			By default this is set to NULL, allowing the client to provide the image at some point after 
       
    69 			the overlay object has been created, by using SetOverlayBitmapL().
       
    70 
       
    71 	@leave	KErrNoMemory if out of memory; also any system wide error.
       
    72 	
       
    73 	@leave  KErrArgument if the member variables in TOverlayParameters are such that they create mutual exclusion.		
       
    74 	
       
    75 	@return The overlay handle.
       
    76 	*/
       
    77     virtual TUint CreateOverlayL(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap)=0;
       
    78 
       
    79 	/**
       
    80 	Allows the overlay image data to be changed for a specified overlay.
       
    81 	Use this function to set the overlay image data if it was not specified when the overlay
       
    82 	was created using CreateOverlayL().
       
    83 
       
    84 	@param	aOverlayHandle
       
    85 			The handle of the overlay whose overlay image data is to be changed.
       
    86 	@param	aBitmap
       
    87 			The new image data for the overlay.
       
    88 		
       
    89 	@leave	KErrArgument if aOverlayHandle is out of range; also any system wide error.
       
    90 	
       
    91 	@note   Once this method is called, overlay size should not be changed for the given overlay. Hence, 
       
    92 			SetOverlayParametersL should not be called after this method. 
       
    93 	*/
       
    94     virtual void SetOverlayBitmapL(TUint aOverlayHandle, const CFbsBitmap* aBitmap)=0;
       
    95     
       
    96 	/**
       
    97 	Gets the overlay image data for a specified overlay.
       
    98 
       
    99 	@param	aOverlayHandle
       
   100 			The handle of the overlay whose overlay image data is to be obtained.
       
   101 	@param	aBitmap
       
   102 			A CFbsBitmap that will receive the returned image data for the overlay.
       
   103 	
       
   104 	@leave	KErrArgument if aOverlayHandle is out of range; also any system wide error.
       
   105 	
       
   106 	@leave  KErrNotSupported if a sharing client (which did not create the given overlay) tries to retrieve the overlay 
       
   107 			bitmap and the implementation may not be interested in providing the overlay.
       
   108 	
       
   109 	@note   The ECam implementation will transfer the ownership of the aBitmap to the client.
       
   110 	*/
       
   111     virtual void GetOverlayBitmapL(TUint aOverlayHandle, CFbsBitmap* aBitmap)=0;
       
   112     
       
   113 	/**
       
   114 	Gets the parameters that characterize a given overlay. 
       
   115 
       
   116 	@param	aOverlayHandle
       
   117 			The handle of the overlay whose parameters are required.
       
   118 	@param	aInfo
       
   119 			Reference to TOverlayParameters object that will contain the returned overlay parameters.
       
   120 			
       
   121 	@leave	KErrArgument if aOverlayHandle is out of range; also any system wide error.
       
   122 	*/
       
   123 	virtual void GetOverlayParametersL(TUint aOverlayHandle, CCamera::CCameraOverlay::TOverlayParameters& aInfo)=0;
       
   124 	
       
   125 	/**
       
   126 	Sets new parameters that characterize a given overlay.
       
   127 
       
   128 	@param	aOverlayHandle
       
   129 			The handle of the overlay whose parameters are to be changed.
       
   130 	@param	aParameters
       
   131 			The new overlay parameters.
       
   132 	
       
   133 	@leave	KErrNotSupported if TOverlayCameraMode passed in TOverlayParameters is not supported; 
       
   134 			also any system wide error.
       
   135 			
       
   136 	@leave  KErrArgument if the member variables in TOverlayParameters are such that they create mutual exclusion.
       
   137 	*/
       
   138 	virtual void SetOverlayParametersL(TUint aOverlayHandle, const CCamera::CCameraOverlay::TOverlayParameters& aParameters)=0;
       
   139 	
       
   140 	/**
       
   141 	Releases the specified overlay handle.
       
   142 
       
   143 	@note 	If the handle specified in aOverlayHandle is invalid (out of range) the function 
       
   144 			call is ignored and no error is reported.
       
   145 
       
   146 	@param	aOverlayHandle	
       
   147 			The handle of the overlay that is to be released.
       
   148 	*/
       
   149 	virtual void ReleaseOverlay(TUint aOverlayHandle)=0;
       
   150 	
       
   151 	/**
       
   152 	Releases and destroys all overlay handles on the ECam implementation. 
       
   153 	This function is called from the destructor of CCamera::CCameraOverlay.
       
   154 	*/
       
   155 	virtual void Release()=0;
       
   156 	
       
   157 	/**
       
   158 	Gets information on the overlay functionality supported by the ECam implementation.
       
   159 
       
   160 	@param	aInfo
       
   161 			A reference to a TOverlaySupportInfo object that will receive the overlay support information.
       
   162 	*/
       
   163     virtual void GetOverlaySupport(CCamera::CCameraOverlay::TOverlaySupportInfo& aInfo)=0;
       
   164     
       
   165 	/**
       
   166 	Gets all the overlay handles maintained by the ECam implementation, in order of their Z-Value.
       
   167 	
       
   168 	@param 	aOverlayHandles
       
   169 			Returned list, in Z-Value order, of all the overlay handles maintained on the ECam implementation.
       
   170 			The topmost overlay is the first element of the array. 
       
   171 
       
   172 	@leave	KErrNoMemory if out of memory; also any system wide error.		
       
   173 	*/
       
   174 	virtual void GetAllOverlaysInZOrderL(RArray<TUint>& aOverlayHandles)=0;
       
   175 	
       
   176 	/**
       
   177 	Sets Z-Order of all the overlay handles known by this CCameraOverlay object.
       
   178 	
       
   179 	@param 	aOverlayHandles
       
   180 			The overlay handles in aOverlayHandles array. This must be the complete current set 
       
   181 			of handles known to this CCameraOverlay object. The client specifies the desired 
       
   182 			order by placing the topmost overlay in the first element of the array.
       
   183 			
       
   184 	@leave	KErrNoMemory if out of memory; also any system wide error.		
       
   185 	*/
       
   186 	virtual void SetAllOverlaysInZOrderL(const RArray<TUint>& aOverlayHandles)=0;
       
   187 	};
       
   188 	
       
   189 
       
   190 /**
       
   191 This is a mixin class to be implemented by providers of the camera extension API for extra features for image overlays.
       
   192 
       
   193 @see CCamera::CCameraOverlay
       
   194 
       
   195 @publishedPartner
       
   196 @prototype
       
   197 */
       
   198 class MCameraOverlay2
       
   199 	{
       
   200 public:		
       
   201 	/** 
       
   202 	Releases the interface. 
       
   203 	*/
       
   204 	virtual void Release()=0;
       
   205 	
       
   206 	/**
       
   207 	Allows the overlay image data to be changed for a specified overlay. Ownership of the bitmap is passed to the 
       
   208 	implementation.
       
   209 	Use this function to set the overlay image data if it was not specified when the overlay was created using 
       
   210 	CreateOverlayL().
       
   211 
       
   212 	@param	aOverlayHandle
       
   213 			The handle of the overlay whose overlay image data is to be changed.
       
   214 	@param	aBitmap
       
   215 			The new image data for the overlay.
       
   216 		
       
   217 	@leave  May leave with any error code.
       
   218 
       
   219 	@note   If required, implementation is free to modify the overlay bitmap passed to it.
       
   220 	
       
   221 	@note   SetOverlayParametersL should not be called after this method for the given overlay since it may change the 
       
   222 			overlay parameters considerably. In such a case, SetOverlayParametersL may leave with error KErrArgument.
       
   223 	*/
       
   224 	virtual void SetModifiableOverlayBitmapL(TUint aOverlayHandle, CFbsBitmap* aBitmap)=0;
       
   225 	
       
   226 	/**
       
   227 	Gets all the overlay handles maintained by the ECam implementation, in order of their z-value, for a particular camera mode.
       
   228 	If for viewfinder, then the handle number is used to get z-value for the viewfinder whose handle number is passed.
       
   229 	
       
   230 	@param  aOverlayCameraMode
       
   231 			The specific camera mode whose overlays' z-value information is required.
       
   232 			
       
   233 	@param  aViewFinderHandle
       
   234 			The specific viewfinder handle, if overlays' z-value information is required for viewfinder camera mode.
       
   235 	
       
   236 	@param 	aOverlayHandles
       
   237 			Returned list, in z-value order, of all the overlay handles maintained on the ECam implementation.
       
   238 			The topmost overlay is the first element of the array. 
       
   239 
       
   240 	@leave  May leave with any error code.
       
   241 	*/
       
   242 	virtual void GetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, RArray<TUint>& aOverlayHandles) const=0;
       
   243 	
       
   244 	/**
       
   245 	Sets all the overlay handles maintained by the ECam implementation, in order of their z-value, for a particular camera mode.
       
   246 	If for viewfinder, then the handle number is used to set the z-value for the viewfinder whose handle number is passed.
       
   247 	
       
   248 	@param  aOverlayCameraMode
       
   249 			The specific camera mode whose overlays' z-value is to be set.
       
   250 			
       
   251 	@param  aViewFinderHandle
       
   252 			The specific viewfinder handle, if overlays' z-value is required to be set for viewfinder camera mode.
       
   253 	
       
   254 	@param 	aOverlayHandles
       
   255 			The overlay handles in aOverlayHandles array. This must be the complete current set 
       
   256 			of handles known to this CCameraOverlay object for the given camera mode (and for given viewfinder, if applicable). 
       
   257 			The client specifies the desired order by placing the topmost overlay in the first element of the array.
       
   258 
       
   259 	@leave  May leave with any error code.
       
   260 	*/
       
   261 	virtual void SetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, const RArray<TUint>& aOverlayHandles)=0;
       
   262 	};
       
   263 
       
   264 #endif // MCAMERAOVERLAY_H