|
1 /* |
|
2 * Copyright (c) 2003,2004 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: Active object for calling Camera Application Engine methods |
|
15 * indirectly from callbacks |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CAECALLBACKACTIVE_H |
|
22 #define CAECALLBACKACTIVE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CCaeEngineImp; |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * CCaeCallbackActive |
|
36 * Active object for calling Camera Application Engine methods |
|
37 * indirectly from callbacks |
|
38 */ |
|
39 NONSHARABLE_CLASS( CCaeCallbackActive ) : public CActive |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Symbian OS two-phased constructor. |
|
45 * @since 2.1 |
|
46 * @param aCamAppEngine Reference to CCaeEngineImp instance |
|
47 */ |
|
48 static CCaeCallbackActive* NewLC( |
|
49 CCaeEngineImp& aCamAppEngine ); |
|
50 |
|
51 /** |
|
52 * Symbian OS two-phased constructor. |
|
53 * @since 2.1 |
|
54 * @param aCamAppEngine Reference to CCaeEngineImp instance |
|
55 */ |
|
56 static CCaeCallbackActive* NewL( |
|
57 CCaeEngineImp& aCamAppEngine ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CCaeCallbackActive(); |
|
63 |
|
64 protected: // Constructors and destructor |
|
65 |
|
66 /** |
|
67 * Symbian OS 2nd phase constructor that can leave. |
|
68 */ |
|
69 void ConstructL(); |
|
70 |
|
71 /** |
|
72 * C++ constructor. |
|
73 * @since 2.1 |
|
74 * @param aCamAppEngine Reference to CCaeEngineImp instance |
|
75 */ |
|
76 CCaeCallbackActive( |
|
77 CCaeEngineImp& aCamAppEngine ); |
|
78 |
|
79 public: // New methods |
|
80 |
|
81 /** |
|
82 * Switches camera module power on. |
|
83 * @since 2.1 |
|
84 * @return void |
|
85 */ |
|
86 void PowerOn(); |
|
87 |
|
88 public: // Methods from CActive (was protected) |
|
89 |
|
90 /** |
|
91 * Calls Camera Application Engine operation. |
|
92 * @return void |
|
93 */ |
|
94 void RunL(); |
|
95 |
|
96 protected: // Methods from CActive |
|
97 |
|
98 /** |
|
99 * Cancels request. |
|
100 * @return void |
|
101 */ |
|
102 void DoCancel(); |
|
103 |
|
104 private: |
|
105 |
|
106 // Timer to implement delayed operation calls. |
|
107 RTimer iTimer; |
|
108 |
|
109 // Reference to Camera Application Engine. |
|
110 CCaeEngineImp& iCamAppEngine; |
|
111 |
|
112 // Requests available. |
|
113 enum TRequest |
|
114 { |
|
115 /** Default */ |
|
116 ERequestDefault, |
|
117 /** Switch camera power on */ |
|
118 ERequestPowerOn, |
|
119 }; |
|
120 |
|
121 // Request. |
|
122 TRequest iRequest; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // CAECALLBACKACTIVE_H |
|
127 |
|
128 // End of File |