|
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 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef ECAMPLUGIN_H |
|
23 #define ECAMPLUGIN_H |
|
24 |
|
25 #include <ecam.h> |
|
26 |
|
27 _LIT8(KECamPluginMatchString, "*"); // ECom insists on something |
|
28 |
|
29 class CCameraStructure; // declared here. |
|
30 |
|
31 /** |
|
32 Parent class for CCamera plugin. |
|
33 Abstract class for CCamera plugin, including ECom support. |
|
34 |
|
35 @see CCamera |
|
36 */ |
|
37 class CCameraPlugin : public CCamera |
|
38 { |
|
39 friend class CCamera; // so can use internal factory functions etc |
|
40 protected: |
|
41 |
|
42 /** |
|
43 @internalComponent |
|
44 |
|
45 @see CCamera::NewL(MCameraObserver& aObserver,TInt aCameraIndex) |
|
46 */ |
|
47 IMPORT_C static CCameraPlugin* NewL(MCameraObserver& aObserver,TInt aCameraIndex, TInt aCameraVersion); |
|
48 |
|
49 /** |
|
50 @internalComponent |
|
51 |
|
52 @see CCamera::NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle) |
|
53 */ |
|
54 IMPORT_C static CCameraPlugin* NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle, TInt aCameraVersion); |
|
55 |
|
56 /** |
|
57 @internalComponent |
|
58 |
|
59 @see CCamera::NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority) |
|
60 */ |
|
61 IMPORT_C static CCameraPlugin* NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority, TInt aCameraVersion); |
|
62 |
|
63 /** |
|
64 @internalComponent |
|
65 |
|
66 @see CCamera::NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle) |
|
67 */ |
|
68 IMPORT_C static CCameraPlugin* NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle, TInt aCameraVersion); |
|
69 |
|
70 /** |
|
71 @internalComponent |
|
72 |
|
73 @see CCamera::CamerasAvailable() |
|
74 */ |
|
75 IMPORT_C static TInt CamerasAvailable(); |
|
76 |
|
77 /** |
|
78 Returns the camera API version no. |
|
79 |
|
80 @return Version of the camera API |
|
81 */ |
|
82 IMPORT_C TInt CameraVersion(); |
|
83 |
|
84 /** |
|
85 Destructor |
|
86 */ |
|
87 IMPORT_C ~CCameraPlugin(); |
|
88 |
|
89 protected: |
|
90 |
|
91 /** |
|
92 A call to one of the factory functions firstly loads the plugin, followed by a |
|
93 call to this function to complete construction. |
|
94 |
|
95 Creates an object representing a camera. |
|
96 |
|
97 @param aObserver |
|
98 Reference to class derived from MCameraObserver2 designed to receive |
|
99 notification of asynchronous event completion. |
|
100 @param aCameraIndex |
|
101 Index from 0 to CamerasAvailable()-1 inclusive specifying the |
|
102 camera device to use. |
|
103 @return Pointer to a fully constructed CCamera object. Ownership is passed |
|
104 to the caller. |
|
105 |
|
106 @leave May leave with KErrNoMemory or KErrNotSupported if aCameraIndex is |
|
107 out of range. |
|
108 */ |
|
109 virtual void Construct2L(MCameraObserver& aObserver,TInt aCameraIndex)=0; |
|
110 |
|
111 /** |
|
112 A call to one of the factory functions firstly loads the plugin, followed by a |
|
113 call to this function to complete construction. |
|
114 |
|
115 Duplicates the original camera object for use by, for example, multimedia systems. |
|
116 |
|
117 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. |
|
118 |
|
119 @param aObserver |
|
120 Reference to an observer. |
|
121 @param aCameraHandle Handle of an existing camera object. |
|
122 |
|
123 @return Duplicate of the original camera object. |
|
124 */ |
|
125 virtual void Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle)=0; |
|
126 |
|
127 /** |
|
128 A call to one of the factory functions firstly loads the plugin, followed by a |
|
129 call to this function to complete construction. |
|
130 |
|
131 Creates an object representing a camera. |
|
132 |
|
133 @param aObserver |
|
134 Reference to class derived from MCameraObserver2 designed to receive |
|
135 notification of asynchronous event completion. |
|
136 @param aCameraIndex |
|
137 Index from 0 to CamerasAvailable()-1 inclusive specifying the |
|
138 camera device to use. |
|
139 @param aPriority |
|
140 Value from -100 to 100 indicating relative priority of client to |
|
141 use camera. |
|
142 |
|
143 @return Pointer to a fully constructed CCamera object. Ownership is passed |
|
144 to the caller. |
|
145 |
|
146 @leave May leave with KErrNoMemory or KErrNotSupported if aCameraIndex is |
|
147 out of range. |
|
148 */ |
|
149 virtual void Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority)=0; |
|
150 |
|
151 /** |
|
152 A call to one of the factory functions firstly loads the plugin, followed by a |
|
153 call to this function to complete construction. |
|
154 |
|
155 Duplicates the original camera object for use by, for example, multimedia systems. |
|
156 |
|
157 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. |
|
158 |
|
159 @param aObserver |
|
160 Reference to an observer. |
|
161 @param aCameraHandle Handle of an existing camera object. |
|
162 |
|
163 @leave May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. |
|
164 |
|
165 @return Duplicate of the original camera object. |
|
166 */ |
|
167 virtual void Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle)=0; |
|
168 |
|
169 protected: |
|
170 |
|
171 /** |
|
172 Default constructor for this class. |
|
173 */ |
|
174 IMPORT_C CCameraPlugin(); |
|
175 |
|
176 private: |
|
177 |
|
178 /** |
|
179 Returns the loaded plugin. |
|
180 |
|
181 @return Pointer to the plugin. |
|
182 */ |
|
183 static CCameraPlugin* NewL(TInt aCameraVersion); |
|
184 |
|
185 /** |
|
186 Returns the loaded plugin. |
|
187 Plugin is left on the cleanup stack. |
|
188 |
|
189 @param aCameraVersion |
|
190 The version of camera API used by applications |
|
191 |
|
192 @return Pointer to the plugin. |
|
193 */ |
|
194 static CCameraPlugin* NewLC(TInt aCameraVersion); |
|
195 |
|
196 private: |
|
197 CCameraStructure* iCameraStructure; |
|
198 }; |
|
199 |
|
200 NONSHARABLE_CLASS( CCameraStructure ): public CBase |
|
201 { |
|
202 public: |
|
203 TUid iDestructorKey; |
|
204 TInt iCameraVersion; |
|
205 }; |
|
206 |
|
207 #endif // ECAMPLUGIN_H |