|
1 // Copyright (c) 2007-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 @publishedPartner |
|
18 @prototype |
|
19 */ |
|
20 |
|
21 #ifndef IMPLEMENTATIONFACTORYINTF_H |
|
22 #define IMPLEMENTATIONFACTORYINTF_H |
|
23 |
|
24 /** |
|
25 Union used to provide future flexibility if extra details are needed by the abstract factory methods. |
|
26 |
|
27 @publishedPartner |
|
28 @prototype |
|
29 */ |
|
30 union TECamImplFactoryParam |
|
31 { |
|
32 public: |
|
33 /** explicit constructor when the union is used to represent a TAny* parameter */ |
|
34 explicit TECamImplFactoryParam(TAny* aPtrParam); |
|
35 |
|
36 /** explicit constructor when the union is used to represent a TInt parameter */ |
|
37 explicit TECamImplFactoryParam(TInt aIntParam); |
|
38 |
|
39 /** explicit constructor when the union is used to represent a TUint parameter */ |
|
40 explicit TECamImplFactoryParam(TUint aUintParam); |
|
41 |
|
42 public: |
|
43 /** union may represent a TAny* parameter in order to provide extra information for creating concrete implementation. */ |
|
44 TAny* iPtrParam; |
|
45 /** union may represent a TInt parameter in order to provide extra information for creating concrete implementation. */ |
|
46 TInt iIntParam; |
|
47 /** union may represent a TUint parameter in order to provide extra information for creating concrete implementation. */ |
|
48 TUint iUintParam; |
|
49 }; |
|
50 |
|
51 /** |
|
52 Abstract Factory Class in order to derive different concrete factory class for image processing implementation specific to |
|
53 VideoCapture and specific Viewfinder. |
|
54 |
|
55 Also used to derive concrete factory class for snapshot implementation specific to image capture and video capture. |
|
56 |
|
57 Also used to derive concrete factory class for histogram implementation specific to still image, video, snapshot or specific viewfinder. |
|
58 |
|
59 This may be used in other possible cases as well. |
|
60 |
|
61 @publishedPartner |
|
62 @prototype |
|
63 */ |
|
64 class MImplementationFactory |
|
65 { |
|
66 public: |
|
67 |
|
68 /** |
|
69 Releases the interface. |
|
70 */ |
|
71 virtual void Release() =0; |
|
72 |
|
73 /** |
|
74 Provides implementation handle for different implementation products. |
|
75 |
|
76 @param aIfPtr |
|
77 Retrieves pointer to specifc interface implementation as identified by the interface uid. |
|
78 |
|
79 @param aIfaceUid |
|
80 The interface uid. |
|
81 |
|
82 @return any defined error code. |
|
83 |
|
84 @note KErrNone should be returned only when a valid interface pointer is there. Any other error code implies that |
|
85 interface implementation pointer is NULL. |
|
86 |
|
87 @note KErrNotSupported should be returned when the concrete interface implementation is not present. |
|
88 |
|
89 @note The inferface pointer is retrieved only on the basis of interface uid passed. |
|
90 Examples of 'interface implementation pointer' - 'interface uid' are as follows:- |
|
91 MCameraImageProcessing* - KECamMCameraImageProcessingUid; |
|
92 MCameraImageProcessing2* - KECamMCameraImageProcessing2Uid; |
|
93 MCameraImageProcessing3* - KECamMCameraImageProcessing3Uid; |
|
94 |
|
95 MCameraSnapshot* - KECamMCameraSnapshotUid; |
|
96 MCameraSnapshot2* - KECamMCameraSnapshot2Uid; |
|
97 |
|
98 MCameraV2Histogram* - KECamMCameraV2HistogramUid; |
|
99 |
|
100 Many other pairs may be possible in future. For example when image processing API/ camera snapshot API/ |
|
101 histogram API is further extended. |
|
102 Or when same concept is being used on other ECam related sub-component. |
|
103 */ |
|
104 virtual TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const=0; |
|
105 |
|
106 /** |
|
107 Overloaded method which helps in retrieving the appropriate implementation pointer |
|
108 based on extra information provided through a single 'TECamImplFactoryParam'. |
|
109 |
|
110 Provides implementation handle for different implementation products. |
|
111 |
|
112 @param aIfPtr |
|
113 Retrieves pointer to specifc interface implementation as identified by the interface uid. |
|
114 |
|
115 @param aIfaceUid |
|
116 The interface uid. |
|
117 |
|
118 @param aParam1 |
|
119 union used to provide extra information which could a TAny*, TInt or TUint. |
|
120 |
|
121 @return error code |
|
122 |
|
123 @note The inferface pointer is retrieved only on the basis of interface uid passed. |
|
124 Examples of 'interface implementation pointer' - 'interface uid' are as follows:- |
|
125 MCameraImageProcessing* - KECamMCameraImageProcessingUid; |
|
126 MCameraImageProcessing2* - KECamMCameraImageProcessing2Uid; |
|
127 MCameraImageProcessing3* - KECamMCameraImageProcessing3Uid; |
|
128 |
|
129 MCameraSnapshot* - KECamMCameraSnapshotUid; |
|
130 MCameraSnapshot2* - KECamMCameraSnapshot2Uid; |
|
131 |
|
132 MCameraV2Histogram* - KECamMCameraV2HistogramUid; |
|
133 |
|
134 Many other pairs may be possible in future. For example when image processing API/ camera snapshot API/ |
|
135 histogram API is further extended. |
|
136 Or when same concept is being used on other ECam related sub-component. |
|
137 */ |
|
138 virtual TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const=0; |
|
139 |
|
140 /** |
|
141 Overloaded method which helps in retrieving the appropriate implementation pointer |
|
142 based on extra information provided through two different 'TECamImplFactoryParam'. |
|
143 |
|
144 Provides implementation handle for different implementation products. |
|
145 |
|
146 @param aIfPtr |
|
147 Retrieves pointer to specifc interface implementation as identified by the interface uid. |
|
148 |
|
149 @param aIfaceUid |
|
150 The interface uid. |
|
151 |
|
152 @param aParam1 |
|
153 union used to provide extra information which could a TAny*, TInt or TUint. |
|
154 |
|
155 @param aParam2 |
|
156 union used to provide extra information which could a TAny*, TInt or TUint. |
|
157 |
|
158 @return error code |
|
159 |
|
160 @note The inferface pointer is retrieved only on the basis of interface uid passed. |
|
161 Examples of 'interface implementation pointer' - 'interface uid' are as follows:- |
|
162 MCameraImageProcessing* - KECamMCameraImageProcessingUid; |
|
163 MCameraImageProcessing2* - KECamMCameraImageProcessing2Uid; |
|
164 MCameraImageProcessing3* - KECamMCameraImageProcessing3Uid; |
|
165 |
|
166 MCameraSnapshot* - KECamMCameraSnapshotUid; |
|
167 MCameraSnapshot2* - KECamMCameraSnapshot2Uid; |
|
168 |
|
169 MCameraV2Histogram* - KECamMCameraV2HistogramUid; |
|
170 |
|
171 Many other pairs may be possible in future. For example when image processing API/ camera snapshot API/ |
|
172 histogram API is further extended. |
|
173 Or when same concept is being used on other ECam related sub-component. |
|
174 */ |
|
175 virtual TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const=0; |
|
176 }; |
|
177 |
|
178 inline |
|
179 TECamImplFactoryParam::TECamImplFactoryParam(TAny* aPtrParam):iPtrParam(aPtrParam) |
|
180 { |
|
181 } |
|
182 |
|
183 inline |
|
184 TECamImplFactoryParam::TECamImplFactoryParam(TInt aIntParam):iIntParam(aIntParam) |
|
185 { |
|
186 } |
|
187 |
|
188 inline |
|
189 TECamImplFactoryParam::TECamImplFactoryParam(TUint aUintParam):iUintParam(aUintParam) |
|
190 { |
|
191 } |
|
192 |
|
193 |
|
194 #endif // IMPLEMENTATIONFACTORYINTF_H |