1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Emulator version of CCamera* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 #ifndef CAMCAMERACALLBACK_H |
|
20 #define CAMCAMERACALLBACK_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <fbs.h> |
|
25 |
|
26 class CCameraappTestBitmapManager; |
|
27 class MCameraObserver; |
|
28 |
|
29 |
|
30 class CCamCameraCallBack : public CActive |
|
31 { |
|
32 public: // Constructors and destructor |
|
33 |
|
34 /** |
|
35 * Two-phased constructor. |
|
36 */ |
|
37 static CCamCameraCallBack* NewL( MCameraObserver& aController ); |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 virtual ~CCamCameraCallBack(); |
|
43 |
|
44 public: // Functions from CActive |
|
45 |
|
46 // void Cancel(); |
|
47 |
|
48 public: // New Methods |
|
49 |
|
50 /** |
|
51 * Complete reserve request. |
|
52 */ |
|
53 void ReserveCompleteRequest( const TInt aError ); |
|
54 |
|
55 /** |
|
56 * Complete power-on request. |
|
57 */ |
|
58 void PowerOnCompleteRequest( const TInt aError ); |
|
59 |
|
60 /** |
|
61 * Prepare for Still capture |
|
62 */ |
|
63 void StillPrepareComplete(); |
|
64 |
|
65 /** |
|
66 * Initiate Still Image Capture |
|
67 */ |
|
68 void SendViewFinderFrames(); |
|
69 |
|
70 /** |
|
71 * Stop Sending View Finder Frames |
|
72 */ |
|
73 void StopViewFinderFrames(); |
|
74 |
|
75 /** |
|
76 * Capture Image and Call MCameraObserver::ImageReady . |
|
77 */ |
|
78 void RequestCaptureImage(); |
|
79 |
|
80 private: // New Methods |
|
81 |
|
82 /* |
|
83 * Constructor |
|
84 */ |
|
85 CCamCameraCallBack( MCameraObserver& aController ); |
|
86 |
|
87 // 2nd phase constructor |
|
88 void ConstructL( ); |
|
89 |
|
90 // We call SetActive and check the handling of all requests |
|
91 void SetActiveAndCompleteRequest(); |
|
92 |
|
93 // Complete Reserve request by calling MCameraObserver::ReserveComplete |
|
94 void DoReserveComplete(); |
|
95 |
|
96 // Complete Reserve request by calling MCameraObserver::PowerOnComplete |
|
97 void DoPowerOnComplete(); |
|
98 |
|
99 void DoStillPrepareComplete(); |
|
100 |
|
101 // Transfer view finder frames request by calling MCameraObserver::ViewFinderFrameReady |
|
102 void DoViewFinderFrame(); |
|
103 |
|
104 // Complete Reserve request by calling MCameraObserver::ImageReady |
|
105 void DoCaptureImageL(); |
|
106 |
|
107 void Reset(); |
|
108 |
|
109 |
|
110 /** |
|
111 * Cancels the active object |
|
112 */ |
|
113 void DoCancel(); |
|
114 |
|
115 /* |
|
116 * All requests are handled one by one in this method |
|
117 */ |
|
118 void RunL(); |
|
119 |
|
120 private: |
|
121 MCameraObserver& iController; |
|
122 |
|
123 CCameraappTestBitmapManager* iBitmapManager; |
|
124 // Request complete status flags |
|
125 TBool iStillPrepareComplete; |
|
126 TBool iReserveComplete; |
|
127 TBool iPowerOnComplete; |
|
128 TBool iCaptureImage; |
|
129 TBool iViewFinderFrame; |
|
130 |
|
131 // Errors caused during request |
|
132 TInt iReserveError; |
|
133 TInt iPowerOnError; |
|
134 }; |
|
135 |
|
136 #endif // CAMCAMERACALLBACKACTIVE_H |
|
137 |
|