initial upload for tizen 2.0 beta
[apps/home/gallery.git] / include / data / gl-local-data.h
1 /*\r
2   * Copyright 2012  Samsung Electronics Co., Ltd\r
3   *\r
4   * Licensed under the Flora License, Version 1.0 (the "License");\r
5   * you may not use this file except in compliance with the License.\r
6   * You may obtain a copy of the License at\r
7   *\r
8   *     http://www.tizenopensource.org/license\r
9   *\r
10   * Unless required by applicable law or agreed to in writing, software\r
11   * distributed under the License is distributed on an "AS IS" BASIS,\r
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13   * See the License for the specific language governing permissions and\r
14   * limitations under the License.\r
15   */\r
16 \r
17 #ifndef _GL_LOCAL_DATA_H_\r
18 #define _GL_LOCAL_DATA_H_\r
19 \r
20 #include "gl-data-type.h"\r
21 \r
22 #ifdef _cplusplus\r
23 extern "C"\r
24 {\r
25 #endif\r
26 \r
27 \r
28 /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music*/\r
29 #define GL_CONDITION_IMAGE_VIDEO "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)"\r
30 #define GL_CONDITION_IMAGE       "(MEDIA_TYPE=0)"\r
31 #define GL_CONDITION_VIDEO       "(MEDIA_TYPE=1)"\r
32 \r
33 #define CONDITION_LENGTH 200\r
34 #define KEYWORD_LENGTH 20\r
35 \r
36 typedef struct _gl_filter_t gl_filter_s;\r
37 \r
38 struct _gl_filter_t {\r
39         char cond[CONDITION_LENGTH];             /*set media type or favorite type, or other query statement*/\r
40         media_content_collation_e collate_type;  /*collate type*/\r
41         media_content_order_e sort_type;         /*sort type*/\r
42         char sort_keyword[KEYWORD_LENGTH];       /*sort keyword*/\r
43         int offset;                              /*offset*/\r
44         int count;                               /*count*/\r
45         bool with_meta;                          /*whether get image or video info*/\r
46 };\r
47 \r
48 \r
49 int _gl_local_data_connect(void);\r
50 int _gl_local_data_disconnect(void);\r
51 int _gl_local_data_get_album_by_path(char *path, gl_album_s **album);\r
52 int _gl_local_data_get_album_list(gl_filter_s *condition, Eina_List **elist);\r
53 int _gl_local_data_get_media_by_id(char *media_id, gl_media_s **mitem);\r
54 int _gl_local_data_get_media_by_path(const char *path, gl_media_s **mitem);\r
55 int _gl_local_data_get_media_count(const char *cluster_id, gl_filter_s *condition,\r
56                                    int *item_cnt);\r
57 int _gl_local_data_get_all_media_count(gl_filter_s *filter, int *item_cnt);\r
58 int _gl_local_data_get_album_media_list(gl_filter_s *condition,\r
59                                         const char *album_id, Eina_List **elist);\r
60 int _gl_local_data_get_all_albums_media_list(gl_filter_s *condition,\r
61                                              Eina_List **elist);\r
62 int _gl_local_data_delete_album(const char *album_uuid);\r
63 int _gl_local_data_add_media(const char *file_url, media_info_h *info);\r
64 int _gl_local_data_get_thumb(gl_media_s *mitem, char **thumb);\r
65 int _gl_local_data_move_media(gl_media_s *mitem, const char *dst);\r
66 \r
67 #ifdef _cplusplus\r
68 }\r
69 #endif\r
70 \r
71 \r
72 #endif\r
73 \r