tizen 2.4 release
[framework/convergence/unifiedstorage-format.git] / include / thumbnail_manager / thumbnail_manager.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 #ifndef __THUMBNAIL_MANAGER_H__
18 #define __THUMBNAIL_MANAGER_H__
19
20 #include "unified_storage_format.h"
21
22 /**
23  * Thumbnail size information
24  */
25 typedef struct
26 {
27     size_t height;
28     size_t width;
29 } thumbnail_size_s;
30
31 // TODO check this enum
32 typedef enum
33 {
34     UNIFIED_STORAGE_THUMB_LARGE,
35     UNIFIED_STORAGE_THUMB_SMALL,
36 } media_thumb_type_e;
37
38 UNIFIED_STORAGE_FORMAT_PUBLIC_API int thumbnail_manager_init(void);
39 UNIFIED_STORAGE_FORMAT_PUBLIC_API int thumbnail_manager_deinit(void);
40
41 /**
42  * @brief Sets thumbnail size
43  * @param thumbnail_size Thumbnail size
44  */
45 UNIFIED_STORAGE_FORMAT_PUBLIC_API void thumbnail_manager_set_thumbnail_size(const thumbnail_size_s *thumbnail_size);
46
47 /**
48  * @brief Gets thumbnail size
49  * @param thumbnail_size Thumbnail size
50  */
51 UNIFIED_STORAGE_FORMAT_PUBLIC_API void thumbnail_manager_get_thumbnail_size(thumbnail_size_s *thumbnail_size);
52
53 /**
54  * @brief Generate hash name for thumbnail file
55  * @param origin_path File path
56  * @param hash_code Generated hash name for thumbnail file
57  * @param max_length Max length of has name to be generated
58  * @return 0 on success, -1 otherwise
59  */
60 UNIFIED_STORAGE_FORMAT_PUBLIC_API int thumbnail_manager_generate_hash(const char *origin_path, char *hash_code, int max_length);
61
62 /**
63  * Creates thumbnail file for image file
64  * @param file_path File path
65  * @param thumb_type Thumbnail type
66  * @param thumb_path Thumbnail path
67  * @return 0 on success, -1 otherwise
68  */
69 // TODO check this function
70 UNIFIED_STORAGE_FORMAT_PUBLIC_API int create_thumbnail_file_for_image_file(const char *file_path, const char *thumb_path);
71 //UNIFIED_STORAGE_FORMAT_PUBLIC_API int create_thumbnail_file_for_image_file(const char *file_path, media_thumb_type_e thumb_type, const char *thumb_path);
72
73 #endif /* __THUMBNAIL_MANAGER_H__ */