2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMediaCapability.h
20 * @brief This is the header file for the %MediaCapability class.
22 * This header file contains the declarations of the %MediaCapability class.
25 #ifndef _FMEDIA_CAPABILITY_H_
26 #define _FMEDIA_CAPABILITY_H_
29 #include <FMediaCapabilityTypes.h>
31 namespace Tizen { namespace Media
34 class _CapabilityImpl;
37 * @class MediaCapability
38 * @brief This class provides capability information of the various classes in the Media namespace.
43 * The %MediaCapability class provides capability information of the various classes in the Media namespace.
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm">Media Capabilities</a>.
47 * The following example demonstrates how to use the %MediaCapability class.
51 * #include <FGraphics.h>
54 * using namespace Tizen::Base;
55 * using namespace Tizen::Media;
58 * MediaCapabilitySample(void)
60 * Tizen::Base::Collection::IList *pList = null;
62 * pList = MediaCapability::GetValueN(CAMERA_PRIMARY_CAPTURE_FORMAT);
65 * return GetLastResult();
68 * for (int i = 0; i < pList->GetCount(); i++)
70 * Tizen::Graphics::PixelFormat captureFormat;
71 * Tizen::Base::Integer *pValue = dynamic_cast<Tizen::Base::Integer*>(pList->GetAt(i));
74 * captureFormat = (Tizen::Graphics::PixelFormat)pValue->ToInt();
75 * AppLog("CaptureFormat[%d] = %d", i, captureFormat);
78 * pList->RemoveAll(true);
81 * pList = MediaCapability::GetValueN(CAMERA_PRIMARY_PREVIEW_RESOLUTION);
84 * return GetLastResult();
87 * for (int i = 0; i < pList->GetCount(); i++)
89 * Tizen::Graphics::Dimension *pValue = dynamic_cast<Tizen::Graphics::Dimension*>(pList->GetAt(i));
92 * AppLog("PreviewResolution[%d] = %d x %d", i, pValue->width, pValue->height);
95 * pList->RemoveAll(true);
107 class _OSP_EXPORT_ MediaCapability
113 * Gets the capability value.
117 * @return An error code on failure, @n
119 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
120 * @param[out] value The retrieved capability information
121 * @exception E_SUCCESS The method is successful.
122 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
123 * @exception E_INVALID_ARG A specified input parameter is invalid.
124 * @exception E_SYSTEM A system error has occurred.
126 static result GetValue(const Tizen::Base::String& key, bool& value);
130 * Gets the capability value.
134 * @return An error code on failure, @n
136 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
137 * @param[out] value The retrieved capability information
138 * @exception E_SUCCESS The method is successful.
139 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
140 * @exception E_INVALID_ARG A specified input parameter is invalid.
141 * @exception E_SYSTEM A system error has occurred.
143 static result GetValue(const Tizen::Base::String& key, int& value);
146 * Gets the capability value.
150 * @return An error code on failure, @n
152 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
153 * @param[out] value The retrieved capability information
154 * @exception E_SUCCESS The method is successful.
155 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
156 * @exception E_INVALID_ARG A specified input parameter is invalid.
157 * @exception E_SYSTEM A system error has occurred.
159 static result GetValue(const Tizen::Base::String& key, long long& value);
162 * Gets the capability value.
166 * @return An error code on failure, @n
168 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
169 * @param[out] value The retrieved capability information
170 * @exception E_SUCCESS The method is successful.
171 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
172 * @exception E_INVALID_ARG A specified input parameter is invalid.
173 * @exception E_SYSTEM A system error has occurred.
175 static result GetValue(const Tizen::Base::String& key, double& value);
178 * Gets the capability value.
182 * @return An error code on failure, @n
184 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
185 * @param[out] value The retrieved capability information
186 * @exception E_SUCCESS The method is successful.
187 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
188 * @exception E_INVALID_ARG A specified input parameter is invalid.
189 * @exception E_SYSTEM A system error has occurred.
191 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
194 * Gets the capability value.
198 * @return A pointer to Tizen::Base::Collection::IList on success, @n
200 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm#media_capabilities">key name</a> of the media capability
201 * @exception E_SUCCESS The method is successful.
202 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
203 * @exception E_INVALID_ARG The specified input parameter is invalid.
204 * @exception E_SYSTEM A system error has occurred.
205 * @remarks The specific error code can be accessed using the GetLastResult() method.
206 * If the type of a key is 'List, type', use GetValueN(). @n
207 * For example, 'List, String', 'List, Integer'.
209 static Tizen::Base::Collection::IList* GetValueN(const Tizen::Base::String& key);
213 * This is the default constructor for this class.
217 * @remarks This default constructor is intentionally declared as private to implement the Singleton semantic.
219 MediaCapability(void);
221 * This is the default destructor for this class.
225 * @remarks This destructor is intentionally declared as private to implement the Singleton semantic.
227 ~MediaCapability(void);
229 * This is the copy constructor for this class.
233 * @remarks The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
235 MediaCapability(const MediaCapability& src);
237 * This is the copy assignment operator for this class.
241 * @remarks The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
243 MediaCapability& operator =(const MediaCapability& src);
245 friend class _CapabilityImpl;
246 _CapabilityImpl* __pImpl;