os/mm/imagingandcamerafws/camerafw/testapps/testcameraapp/TestCameraApp.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2002-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 #ifndef __TESTCAMERAAPP_H__
    17 #define __TESTCAMERAAPP_H__
    18 
    19 #include <coecntrl.h>
    20 #include <eikappui.h>
    21 #include <eikapp.h>
    22 #include <eikdoc.h>
    23 
    24 #include <ecam.h>
    25 #include <ecamadvsettings.h>
    26 #include <ecam/camerasnapshot.h>
    27 
    28 const TUid KUidTestCameraApp={ 0x101F7D31 };
    29 
    30 // class CTCamAppView
    31 
    32 class CTCamAppView : public CCoeControl
    33     {
    34 public:
    35 	CTCamAppView();
    36 	~CTCamAppView();
    37     void ConstructL(const TRect& aRect);
    38 	void DrawImage(CFbsBitmap* aImage) const;
    39 	TPoint DrawBorders(const TSize& aSize) const;
    40 private:
    41 	// from CCoeControl
    42 	void Draw(const TRect& /*aRect*/) const;
    43     };
    44 
    45 // CTCamAppUi
    46 
    47 class CTCamAppUi : public CEikAppUi, public MCameraObserver, public MCameraObserver2
    48     {
    49 public:
    50     void ConstructL();
    51 	~CTCamAppUi();
    52 private:
    53 	// From CEikAppUi
    54 	virtual void HandleCommandL(TInt aCommand);
    55 	// New functions
    56 	void ViewFinderL();
    57 	void BurstModeL();
    58 	void SingleShotL();
    59 	void CaptureImageL();
    60 	void CaptureVideoL();
    61 	void IncImgProcAdjustmentL(TUid aTransformation);
    62 	void DecImgProcAdjustmentL(TUid aTransformation);
    63 	void EnableSnapshotL();
    64 	void DisableSnapshot();
    65 	// From MCameraObserver
    66 	virtual void ReserveComplete(TInt aError);
    67 	virtual void PowerOnComplete(TInt aError);
    68 	virtual void ViewFinderFrameReady(CFbsBitmap& aFrame);
    69 	virtual void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError);
    70 	virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError);
    71 	//From MCameraObserver2
    72 	virtual void HandleEvent(const TECAMEvent& aEvent);
    73 	virtual void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError);
    74 	virtual void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
    75 	virtual void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
    76 	
    77     void CreateDependencyFileL();
    78     void RemoveDependencyFile();
    79     
    80     void SnapshotDataDisplayL();
    81     
    82     void HandleEvent1(const TECAMEvent& aEvent);
    83     void HandleEvent2(const TECAMEvent2& aEvent2);
    84     
    85 private:
    86 	CCamera* iCamera;
    87 	CCamera::CCameraAdvancedSettings* iCameraAdvSet;
    88 	CCamera::CCameraPresets* iCameraPresets;
    89 	CCamera::CCameraSnapshot* iCameraSnapshot;
    90 	CCamera::CCameraImageProcessing* iCameraImgProc;
    91     CTCamAppView* iAppView;
    92     RFs ifsSession;
    93     };
    94 
    95 // CTCamDocument
    96 
    97 class CTCamDocument : public CEikDocument
    98 	{
    99 public:
   100 	CTCamDocument(CEikApplication& aApp);
   101 private:
   102 	 // from CEikDocument
   103 	CEikAppUi* CreateAppUiL();
   104 	};
   105 
   106 // CTCamApp
   107 
   108 class CTCamApp : public CEikApplication
   109 	{
   110 private:
   111 	// from CApaApplication
   112 	CApaDocument* CreateDocumentL();
   113 	TUid AppDllUid() const;
   114 	};
   115 
   116 #endif
   117