Camera&Recorder doxygen update
[platform/framework/native/media.git] / inc / FMediaCapability.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                        FMediaCapability.h
20  * @brief                       This is the header file for the %MediaCapability class.
21  *
22  * This header file contains the declarations of the %MediaCapability class.
23  */
24
25 #ifndef _FMEDIA_CAPABILITY_H_
26 #define _FMEDIA_CAPABILITY_H_
27
28 #include <FBase.h>
29 #include <FMediaCapabilityTypes.h>
30
31 namespace Tizen { namespace Media
32 {
33
34 class _CapabilityImpl;
35
36 /**
37  * @class       MediaCapability
38  * @brief       This class provides capability information of the various classes in the Media namespace.
39  *
40  * @since               2.0
41  *
42  *
43  * The %MediaCapability class provides capability information of the various classes in the Media namespace.
44  *
45  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/media_capabilities.htm">Media Capabilities</a>.
46  *
47  * The following example demonstrates how to use the %MediaCapability class.
48  * @code
49  *
50  * #include <FBase.h>
51  * #include <FGraphics.h>
52  * #include <FMedia.h>
53  *
54  * using namespace Tizen::Base;
55  * using namespace Tizen::Media;
56  *
57  * result
58  * MediaCapabilitySample(void)
59  * {
60  *       Tizen::Base::Collection::IList *pList = null;
61  *
62  *       pList = MediaCapability::GetValueN(CAMERA_PRIMARY_CAPTURE_FORMAT);
63  *       if (pList == null)
64  *       {
65  *               return GetLastResult();
66  *       }
67  *
68  *       for (int i = 0; i < pList->GetCount(); i++)
69  *       {
70  *               Tizen::Graphics::PixelFormat captureFormat;
71  *               Tizen::Base::Integer *pValue = dynamic_cast<Tizen::Base::Integer*>(pList->GetAt(i));
72  *               if (pValue)
73  *               {
74  *                       captureFormat = (Tizen::Graphics::PixelFormat)pValue->ToInt();
75  *                       AppLog("CaptureFormat[%d] = %d", i, captureFormat);
76  *               }
77  *       }
78  *       pList->RemoveAll(true);
79  *       delete pList;
80  *
81  *       pList = MediaCapability::GetValueN(CAMERA_PRIMARY_PREVIEW_RESOLUTION);
82  *       if (pList == null)
83  *       {
84  *               return GetLastResult();
85  *       }
86  *
87  *       for (int i = 0; i < pList->GetCount(); i++)
88  *       {
89  *               Tizen::Graphics::Dimension *pValue = dynamic_cast<Tizen::Graphics::Dimension*>(pList->GetAt(i));
90  *               if (pValue)
91  *               {
92  *                       AppLog("PreviewResolution[%d] = %d x %d", i, pValue->width, pValue->height);
93  *               }
94  *       }
95  *       pList->RemoveAll(true);
96  *       delete pList;
97  *
98  *       return E_SUCCESS;
99  * }
100  *
101  * @endcode
102  *
103  *
104  *
105  */
106
107 class _OSP_EXPORT_ MediaCapability
108 {
109
110 // Operations
111 public:
112         /**
113         *       Gets the capability value.
114         *
115         * @since                2.0
116         *
117         *       @return         An error code on failure, @n
118         *                               else E_SUCCESS
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.
125         */
126         static result GetValue(const Tizen::Base::String& key, bool& value);
127
128
129         /**
130         *       Gets the capability value.
131         *
132         * @since                2.0
133         *
134         *       @return         An error code on failure, @n
135         *                               else E_SUCCESS
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.
142         */
143         static result GetValue(const Tizen::Base::String& key, int& value);
144
145         /**
146         *       Gets the capability value.
147         *
148         * @since                2.0
149         *
150         *       @return         An error code on failure, @n
151         *                               else E_SUCCESS
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.
158         */
159         static result GetValue(const Tizen::Base::String& key, long long& value);
160
161         /**
162         *       Gets the capability value.
163         *
164         * @since                2.0
165         *
166         *       @return                 An error code on failure, @n
167         *                                       else E_SUCCESS
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.
174         */
175         static result GetValue(const Tizen::Base::String& key, double& value);
176
177         /**
178         *       Gets the capability value.
179         *
180         * @since                2.0
181         *
182         *       @return                 An error code on failure, @n
183         *                                       else E_SUCCESS
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.
190         */
191         static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
192
193         /**
194         *       Gets the capability value.
195         *
196         * @since                2.0
197         *
198         *       @return         A pointer to Tizen::Base::Collection::IList on success, @n
199         *                               else @c null
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        
206         *                               - The specific error code can be accessed using the GetLastResult() method.
207         *                               - If the type of a key is 'List, type', use GetValueN(). @n
208         *                               For example, 'List, String', 'List, Integer'.
209         */
210         static Tizen::Base::Collection::IList* GetValueN(const Tizen::Base::String& key);
211
212 private:
213         /**
214          * This is the default constructor for this class.
215          *
216          * @since               2.0
217          *
218          * @remarks         This default constructor is intentionally declared as private to implement the Singleton semantic.
219          */
220         MediaCapability(void);
221         /**
222          * This is the default destructor for this class.
223          *
224          * @since               2.0
225          *
226          * @remarks         This destructor is intentionally declared as private to implement the Singleton semantic.
227          */
228         ~MediaCapability(void);
229         /**
230          * This is the copy constructor for this class.
231          *
232          * @since               2.0
233          *
234          * @remarks         The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
235          */
236         MediaCapability(const MediaCapability& src);
237         /**
238          * This is the copy assignment operator for this class.
239          *
240          * @since               2.0
241          *
242          * @remarks         The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
243          */
244         MediaCapability& operator =(const MediaCapability& src);
245
246         friend class _CapabilityImpl;
247         _CapabilityImpl* __pImpl;
248 };
249
250
251 }}// Tizen::Media
252
253 #endif