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