mmplugins/cameraplugins/source/stub/ECamStubPlugin.cpp
changeset 0 40261b775718
child 64 92a82bc706f7
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "ECamStubPlugin.h"
       
    17 
       
    18 #include <ecom/ecom.h>
       
    19 #include <ecom/implementationproxy.h>
       
    20 #include <ecamuids.hrh>
       
    21 
       
    22 //
       
    23 // Main stuff
       
    24 //
       
    25 
       
    26 static void Panic(TInt aReason)
       
    27 	{
       
    28 	_LIT(KDllName, "ECam Stub Plugin");
       
    29 	User::Panic(KDllName, aReason);
       
    30 	}
       
    31 
       
    32 //
       
    33 // CCameraStub
       
    34 //
       
    35 
       
    36 CCameraStub::CCameraStub()
       
    37 	{
       
    38 	}
       
    39 	
       
    40 CCameraStub::~CCameraStub()
       
    41 	{
       
    42 	}
       
    43 	
       
    44 CCameraStub* CCameraStub::NewL()
       
    45 	{
       
    46 	return new (ELeave) CCameraStub;
       
    47 	}
       
    48 	
       
    49 // 
       
    50 // 2nd stage ConstructL calls called by framework
       
    51 //
       
    52 
       
    53 void CCameraStub::Construct2L(MCameraObserver& aObserver,TInt aCameraIndex)
       
    54 	{
       
    55 	iObserver = &aObserver;
       
    56 	iCameraIndex = aCameraIndex;
       
    57 	User::Leave(KErrNotSupported);
       
    58 	}
       
    59 	
       
    60 void CCameraStub::Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle)
       
    61 	{
       
    62 	iObserver = &aObserver;
       
    63 	iCameraHandle = aCameraHandle;
       
    64 	User::Leave(KErrNotSupported);
       
    65 	}
       
    66 
       
    67 
       
    68 void CCameraStub::Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority)
       
    69 	{
       
    70 	iObserver2 = &aObserver;
       
    71 	iCameraIndex = aCameraIndex;
       
    72 	iPriority = aPriority;
       
    73 	User::Leave(KErrNotSupported);
       
    74 	}
       
    75 	
       
    76 void CCameraStub::Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle)
       
    77 	{
       
    78 	iObserver2 = &aObserver;
       
    79 	iCameraHandle = aCameraHandle;
       
    80 	User::Leave(KErrNotSupported);
       
    81 	}
       
    82 
       
    83 
       
    84 	
       
    85 //
       
    86 // Dummy versions of virtual functions
       
    87 //
       
    88 
       
    89 void CCameraStub::CameraInfo(TCameraInfo& /*aInfo*/) const
       
    90 	{
       
    91 	Panic(EPanicUnimplemented);
       
    92 	}
       
    93 
       
    94 void CCameraStub::Reserve()
       
    95 	{
       
    96 	Panic(EPanicUnimplemented);
       
    97 	}
       
    98 
       
    99 
       
   100 void CCameraStub::Release()
       
   101 	{
       
   102 	Panic(EPanicUnimplemented);
       
   103 	}
       
   104 
       
   105 void CCameraStub::PowerOn()
       
   106 	{
       
   107 	Panic(EPanicUnimplemented);
       
   108 	}
       
   109 
       
   110 void CCameraStub::PowerOff()
       
   111 	{
       
   112 	Panic(EPanicUnimplemented);
       
   113 	}
       
   114 
       
   115 TInt CCameraStub::Handle()
       
   116 	{
       
   117 	Panic(EPanicUnimplemented);
       
   118 	return 0;
       
   119 	}
       
   120 
       
   121 void CCameraStub::SetZoomFactorL(TInt /*aZoomFactor = 0*/)
       
   122 	{
       
   123 	Panic(EPanicUnimplemented);
       
   124 	}
       
   125 
       
   126 TInt CCameraStub::ZoomFactor() const
       
   127 	{
       
   128 	Panic(EPanicUnimplemented);
       
   129 	return 0;
       
   130 	}
       
   131 
       
   132 void CCameraStub::SetDigitalZoomFactorL(TInt /*aDigitalZoomFactor = 0*/)
       
   133 	{
       
   134 	Panic(EPanicUnimplemented);
       
   135 	}
       
   136 
       
   137 TInt CCameraStub::DigitalZoomFactor() const
       
   138 	{
       
   139 	Panic(EPanicUnimplemented);
       
   140 	return 0;
       
   141 	}
       
   142 
       
   143 void CCameraStub::SetContrastL(TInt /*aContrast*/)
       
   144 	{
       
   145 	Panic(EPanicUnimplemented);
       
   146 	}
       
   147 
       
   148 TInt CCameraStub::Contrast() const
       
   149 	{
       
   150 	Panic(EPanicUnimplemented);
       
   151 	return 0;
       
   152 	}
       
   153 
       
   154 void CCameraStub::SetBrightnessL(TInt /*aBrightness*/)
       
   155 	{
       
   156 	Panic(EPanicUnimplemented);
       
   157 	}
       
   158 
       
   159 TInt CCameraStub::Brightness() const
       
   160 	{
       
   161 	Panic(EPanicUnimplemented);
       
   162 	return 0;
       
   163 	}
       
   164 
       
   165 
       
   166 void CCameraStub::SetFlashL(TFlash /*aFlash = EFlashNone*/)
       
   167 	{
       
   168 	Panic(EPanicUnimplemented);
       
   169 	}
       
   170 
       
   171 CCamera::TFlash CCameraStub::Flash() const
       
   172 	{
       
   173 	Panic(EPanicUnimplemented);
       
   174 	return EFlashNone;
       
   175 	}
       
   176 
       
   177 void CCameraStub::SetExposureL(TExposure /*aExposure = EExposureAuto*/)
       
   178 	{
       
   179 	Panic(EPanicUnimplemented);
       
   180 	}
       
   181 
       
   182 CCamera::TExposure CCameraStub::Exposure() const
       
   183 	{
       
   184 	Panic(EPanicUnimplemented);
       
   185 	return EExposureAuto;
       
   186 	}
       
   187 
       
   188 void CCameraStub::SetWhiteBalanceL(TWhiteBalance /*aWhiteBalance = EWBAuto*/)
       
   189 	{
       
   190 	Panic(EPanicUnimplemented);
       
   191 	}
       
   192 
       
   193 
       
   194 CCamera::TWhiteBalance CCameraStub::WhiteBalance() const
       
   195 	{
       
   196 	Panic(EPanicUnimplemented);
       
   197 	return EWBAuto;
       
   198 	}
       
   199 
       
   200 void CCameraStub::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/)
       
   201 	{
       
   202 	Panic(EPanicUnimplemented);
       
   203 	}
       
   204 
       
   205 void CCameraStub::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/,TRect& /*aClipRect*/)
       
   206 	{
       
   207 	Panic(EPanicUnimplemented);
       
   208 	}
       
   209 
       
   210 void CCameraStub::StartViewFinderBitmapsL(TSize& /*aSize*/)
       
   211 	{
       
   212 	Panic(EPanicUnimplemented);
       
   213 	}
       
   214 	
       
   215 void CCameraStub::StartViewFinderBitmapsL(TSize& /*aSize*/,TRect& /*aClipRect*/)
       
   216 	{
       
   217 	Panic(EPanicUnimplemented);
       
   218 	}
       
   219 
       
   220 
       
   221 void CCameraStub::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/)
       
   222 	{
       
   223 	Panic(EPanicUnimplemented);
       
   224 	}
       
   225 
       
   226 void CCameraStub::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/,TRect& /*aClipRect*/)
       
   227 	{
       
   228 	Panic(EPanicUnimplemented);
       
   229 	}
       
   230 
       
   231 
       
   232 void CCameraStub::StopViewFinder()
       
   233 	{
       
   234 	Panic(EPanicUnimplemented);
       
   235 	}
       
   236 
       
   237 TBool CCameraStub::ViewFinderActive() const
       
   238 	{
       
   239 	Panic(EPanicUnimplemented);
       
   240 	return EFalse;
       
   241 	}
       
   242 
       
   243 void CCameraStub::SetViewFinderMirrorL(TBool /*aMirror*/)
       
   244 	{
       
   245 	Panic(EPanicUnimplemented);
       
   246 	}
       
   247 
       
   248 TBool CCameraStub::ViewFinderMirror() const
       
   249 	{
       
   250 	Panic(EPanicUnimplemented);
       
   251 	return EFalse;
       
   252 	}
       
   253 
       
   254 void CCameraStub::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/)
       
   255 	{
       
   256 	Panic(EPanicUnimplemented);
       
   257 	}
       
   258 
       
   259 void CCameraStub::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/,const TRect& /*aClipRect*/)
       
   260 	{
       
   261 	Panic(EPanicUnimplemented);
       
   262 	}
       
   263 
       
   264 
       
   265 void CCameraStub::CaptureImage()
       
   266 	{
       
   267 	Panic(EPanicUnimplemented);
       
   268 	}
       
   269 
       
   270 void CCameraStub::CancelCaptureImage()
       
   271 	{
       
   272 	Panic(EPanicUnimplemented);
       
   273 	}
       
   274 
       
   275 void CCameraStub::EnumerateCaptureSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
       
   276 	{
       
   277 	Panic(EPanicUnimplemented);
       
   278 	}
       
   279 
       
   280 void CCameraStub::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/)
       
   281 	{
       
   282 	Panic(EPanicUnimplemented);
       
   283 	}
       
   284 
       
   285 void CCameraStub::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/,const TRect& /*aClipRect*/)
       
   286 	{
       
   287 	Panic(EPanicUnimplemented);
       
   288 	}
       
   289 
       
   290 void CCameraStub::StartVideoCapture()
       
   291 	{
       
   292 	Panic(EPanicUnimplemented);
       
   293 	}
       
   294 
       
   295 void CCameraStub::StopVideoCapture()
       
   296 	{
       
   297 	Panic(EPanicUnimplemented);
       
   298 	}
       
   299 
       
   300 TBool CCameraStub::VideoCaptureActive() const
       
   301 	{
       
   302 	Panic(EPanicUnimplemented);
       
   303 	return EFalse;
       
   304 	}
       
   305 
       
   306 void CCameraStub::EnumerateVideoFrameSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
       
   307 	{
       
   308 	Panic(EPanicUnimplemented);
       
   309 	}
       
   310 
       
   311 void CCameraStub::EnumerateVideoFrameRates(TReal32& /*aRate*/,TInt /*aRateIndex*/,TFormat /*aFormat*/,TInt /*aSizeIndex*/,TExposure /*aExposure = EExposureAuto*/) const
       
   312 	{
       
   313 	Panic(EPanicUnimplemented);
       
   314 	}
       
   315 
       
   316 void CCameraStub::GetFrameSize(TSize& /*aSize*/) const
       
   317 	{
       
   318 	Panic(EPanicUnimplemented);
       
   319 	}
       
   320 
       
   321 TReal32 CCameraStub::FrameRate() const
       
   322 	{
       
   323 	Panic(EPanicUnimplemented);
       
   324 	return 0.0;
       
   325 	}
       
   326 
       
   327 TInt CCameraStub::BuffersInUse() const
       
   328 	{
       
   329 	Panic(EPanicUnimplemented);
       
   330 	return 0;
       
   331 	}
       
   332 
       
   333 TInt CCameraStub::FramesPerBuffer() const
       
   334 	{
       
   335 	Panic(EPanicUnimplemented);
       
   336 	return 0;
       
   337 	}
       
   338 
       
   339 void CCameraStub::SetJpegQuality(TInt /*aQuality*/)
       
   340 	{
       
   341 	Panic(EPanicUnimplemented);
       
   342 	}
       
   343 
       
   344 TInt CCameraStub::JpegQuality() const
       
   345 	{
       
   346 	Panic(EPanicUnimplemented);
       
   347 	return 0;
       
   348 	}
       
   349 
       
   350 TAny* CCameraStub::CustomInterface(TUid /*aInterface*/)
       
   351 	{
       
   352 	Panic(EPanicUnimplemented);
       
   353 	return NULL;
       
   354 	}
       
   355 
       
   356 
       
   357 //
       
   358 // CCameraStubInfo
       
   359 //
       
   360 
       
   361 CCameraStubInfo::CCameraStubInfo()
       
   362 	{
       
   363 	}
       
   364 	
       
   365 CCameraStubInfo::~CCameraStubInfo()
       
   366 	{
       
   367 	}
       
   368 	
       
   369 CCameraStubInfo* CCameraStubInfo::NewL()
       
   370 	{
       
   371 	return new (ELeave) CCameraStubInfo;
       
   372 	}
       
   373 	
       
   374 TInt CCameraStubInfo::CamerasAvailable()
       
   375 	{
       
   376 	return 0;
       
   377 	}
       
   378 
       
   379 
       
   380 // __________________________________________________________________________
       
   381 // Exported proxy for instantiation method resolution
       
   382 // Define the interface UIDs
       
   383 const TImplementationProxy ImplementationTable[] = 
       
   384 	{
       
   385 		IMPLEMENTATION_PROXY_ENTRY(KUidOnboardCameraStubPlugin,	CCameraStub::NewL),
       
   386 		IMPLEMENTATION_PROXY_ENTRY(KUidOnboardCameraStubInfo,	CCameraStubInfo::NewL)
       
   387 	};
       
   388 
       
   389 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   390 	{
       
   391 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   392 
       
   393 	return ImplementationTable;
       
   394 	}
       
   395