Updating INI configuration file to work with most cameras.
[profile/ivi/camera.git] / include / cam_file.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.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/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,
52                                                 const gchar *first_file_name,
53                                                 const gchar *suffix);
54 gchar *cam_file_get_next_filename(const gchar *storage_root,
55                                   const gchar *prefix_string,
56                                   const gchar *suffix);
57 gchar *cam_file_get_next_dcim_filename(const gchar *storage_root, media_type_t media_type);
58 /**
59  * @brief               get latest file path in @storage_root folder
60  * @param[in]   data    camera appdata structure
61  * @param[in]   storage_root    folder path (full path)
62  * @return                      Operation result
63  * @retval      NOT NULL        lateset file path in @storage_root
64  * @retval         NULL Error or no file
65  */
66 gchar *cam_file_get_last_file_path (void *data, const gchar *storage_root);
67 /**
68  * @brief               get latest file path folder id in @storage_root folder,folder id is for media-content api
69  * @param[in]   storage_root    folder path (full path)
70  * @return                      Operation result
71  * @retval      NOT NULL        folder id for @storage_root
72  * @retval         NULL Error
73  */
74 char *cam_file_get_cam_storage_folder_id(const gchar *storage_root);
75 /**
76  * @brief               get thumbnail full path of @file_path,folder id is for media-content api
77  * @param[in]   file_path       file path (full path)
78  * @param[out]  file_path       thumbnail_path of @file_path (full path)
79  * @return                      Operation result
80  * @retval      TRUE    succeed
81  * @retval         FALSE        Error
82  */
83 gboolean cam_file_get_cam_file_thumbnail_path(const gchar *file_path, gchar **thumbnail_path);
84
85 gboolean cam_check_dir();
86
87
88 #endif