269d65295b32c9925f9f595424f5f79493fb084a
[platform/core/api/thumbnail-util.git] / include / thumbnail_util_type.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef __TIZEN_THUMBNAIL_UTIL_TYPE_H__
19 #define __TIZEN_THUMBNAIL_UTIL_TYPE_H__
20
21 #include <time.h>
22 #include <tizen.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28
29 #ifndef DEPRECATED_API
30 #define DEPRECATED_API __attribute__ ((deprecated))
31 #endif
32
33 /**
34  * @file thumbnail_util_type.h
35  * @brief This file contains API related to thumbnail_util enumerations for classes of errors. \n
36  *        Listed APIs are called when extracting thumbnail from media files,  \n
37  */
38
39 /**
40 * @addtogroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE
41  * @{
42  */
43
44 /**
45  * @ingroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE
46  * @brief Enumeration for a thumbnail util error.
47  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
48  */
49  typedef enum
50 {
51     THUMBNAIL_UTIL_ERROR_NONE                    = TIZEN_ERROR_NONE,                    /**< Successful */
52     THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER       = TIZEN_ERROR_INVALID_PARAMETER,       /**< Invalid parameter */
53     THUMBNAIL_UTIL_ERROR_OUT_OF_MEMORY           = TIZEN_ERROR_OUT_OF_MEMORY,           /**< Out of memory */
54     THUMBNAIL_UTIL_ERROR_INVALID_OPERATION       = TIZEN_ERROR_INVALID_OPERATION,       /**< Invalid Operation */
55     THUMBNAIL_UTIL_ERROR_FILE_NO_SPACE_ON_DEVICE       = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */
56     THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED              = TIZEN_ERROR_PERMISSION_DENIED,                  /**< Permission denied */
57 } thumbnail_util_error_e;
58
59
60 /**
61  * @ingroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE
62  * @brief The structure type for the thumbnail info handle.
63  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
64  */
65 typedef struct thumbnail_s *thumbnail_h;
66
67
68 /**
69  * @ingroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE
70  * @brief Called when creating the thumbnail.
71  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
72  * @remarks Color space of the generated thumbnail is BGRA.
73  *
74  * @details This callback is called for completion of generating the thumbnail.
75  *
76  * @param[in] error     The error code
77  * @param[in] request_id       The generated request id by thumbnail extraction request
78  * @param[in] thumb_width    The width of the thumbnail which is generated
79  * @param[in] thumb_height   The height of the thumbnail which is generated
80  * @param[in] thumb_data     The raw data of the thumbnail which is generated
81  * @param[in] thumb_size      The size of the thumbnail which is generated
82  * @param[in] user_data        The user data passed from the thumbnail_util_extract() fuction
83  *
84  * @pre thumbnail_util_extract()
85  *
86  * @see thumbnail_util_extract()
87  */
88 typedef void (*thumbnail_extracted_cb)(thumbnail_util_error_e error, const char *request_id, int thumb_width, int thumb_height, unsigned char *thumb_data, int thumb_size, void *user_data);
89
90 /**
91  * @}
92  */
93
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97
98
99 #endif /*__TIZEN_THUMBNAIL_UTIL_TYPE_H__*/