Flora license update
[apps/core/preloaded/ug-camera-efl.git] / include / cam_file.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 CAM_FILE_H_
19 #define CAM_FILE_H_
20
21 #include <glib.h>
22 #include <glib/gstdio.h>
23 #include "cam.h"
24 #define INTERNAL_FILE_PATH              "/opt/usr/media/Camera"
25 #define EXTERNAL_FILE_PATH              "/opt/storage/sdcard/Camera"
26
27 typedef enum {
28         MEDIA_TYPE_JPEG,
29         MEDIA_TYPE_MP4,
30         MEDIA_TYPE_3GP,
31         MEDIA_TYPE_LAST
32 } media_type_t;
33
34 gboolean cam_file_init(GError **error);
35 void cam_file_finalize();
36 gboolean cam_file_get_size(const char *filename, guint64 *size);
37 gboolean cam_file_check_exists(gchar *filename);
38 gboolean cam_file_get_size(const char *filename, guint64 *size);
39
40 gboolean cam_file_register(const char *filename, GError **error);
41 gboolean cam_file_register_to_DCF(const char *filename, GError **error);
42 gboolean cam_file_delete(const gchar *filename, GError **error);
43 gboolean cam_file_rename(const gchar *filename, const gchar *new_name,
44                          GError **error);
45 const gchar *cam_file_get_dcim_path(void);
46 const gchar *cam_file_get_internal_image_path(void);
47 const gchar *cam_file_get_internal_video_path(void);
48 const gchar *cam_file_get_external_image_path(void);
49 const gchar *cam_file_get_external_video_path(void);
50
51 gchar *cam_file_get_next_filename_for_multishot(const gchar *storage_root, const gchar *first_file_name, const gint shot_num, const gchar *suffix);
52
53 gchar *cam_file_get_next_filename(const gchar *storage_root,
54                                   const gchar *prefix_string,
55                                   const gchar *suffix);
56 gchar *cam_file_get_next_dcim_filename(const gchar *storage_root, media_type_t media_type);
57 /**
58  * @brief               get latest file path in @storage_root folder
59  * @param[in]   data    camera appdata structure
60  * @param[in]   storage_root    folder path (full path)
61  * @return                      Operation result
62  * @retval      NOT NULL        lateset file path in @storage_root
63  * @retval         NULL Error or no file
64  */
65 gchar *cam_file_get_last_file_path (void *data, const gchar *storage_root);
66 /**
67  * @brief               get latest file path folder id in @storage_root folder,folder id is for media-content api
68  * @param[in]   storage_root    folder path (full path)
69  * @return                      Operation result
70  * @retval      NOT NULL        folder id for @storage_root
71  * @retval         NULL Error
72  */
73 char *cam_file_get_cam_storage_folder_id(const gchar *storage_root);
74 /**
75  * @brief               get thumbnail full path of @file_path,folder id is for media-content api
76  * @param[in]   file_path       file path (full path)
77  * @param[out]  file_path       thumbnail_path of @file_path (full path)
78  * @return                      Operation result
79  * @retval      TRUE    succeed
80  * @retval         FALSE        Error
81  */
82 gboolean cam_file_get_cam_file_thumbnail_path(const gchar *file_path, gchar **thumbnail_path);
83
84 gboolean cam_check_dir();
85
86
87 #endif