initial upload for tizen 2.0 beta
[apps/home/gallery.git] / ug / ug-gallery-efl / include / ge-data-type.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 _GE_TYPE_H_\r
18 #define _GE_TYPE_H_\r
19 \r
20 #include <stdlib.h>\r
21 #include <media_content_type.h>\r
22 #include <media_filter.h>\r
23 #include <media_image.h>\r
24 #include <media_video.h>\r
25 #include <media_info.h>\r
26 #include <media_folder.h>\r
27 #include <eina_list.h>\r
28 \r
29 #define FREE_DATA(ptr)  \\r
30         do { \\r
31                 if(ptr != NULL) \\r
32                 {       \\r
33                         free(ptr);      \\r
34                         ptr = NULL;     \\r
35                 }       \\r
36         }while(0);\r
37 \r
38 #define GE_TYPE_ALBUM (0x55551)\r
39 #define GE_TYPE_MEDIA (0x55553)\r
40 \r
41 typedef enum\r
42 {\r
43         GE_PHONE,                       /**< Stored only in phone */\r
44         GE_MMC,                         /**< Stored only in MMC */\r
45         GE_SYSTEM,                      /**< Stored in ALL*/\r
46 } _ge_store_type_t;\r
47 \r
48 \r
49 typedef struct _ge_album_t ge_album_s;\r
50 typedef struct _ge_media_t ge_media_s;\r
51 typedef struct _ge_image_t ge_image_s;\r
52 typedef struct _ge_video_t ge_video_s;\r
53 \r
54 struct _ge_album_t {\r
55         int gtype;                         /*self-defination type, when free this struct space, use it*/\r
56         media_folder_h folder_h;           /*the handle of operating this folder*/\r
57         char *uuid;                        /*folder  UUID*/\r
58         char *display_name;                /*album name*/\r
59         char *path;                        /*the full path of this folder*/\r
60         int type;                          /*storage type*/\r
61         time_t mtime;                      /*modified time*/\r
62         int count;                         /*the media count in this folder*/\r
63         char *thumb_url;                   /**< thumbnail full path */\r
64         void *_reserved;                   /*reserved*/\r
65 };\r
66 \r
67 struct _ge_media_t {\r
68         int gtype;                         /*self-defination type, when free this struct space, use it*/\r
69         media_info_h media_h;              /*the handle of operating this media*/\r
70         char *uuid;                        /*meida id*/\r
71         int type;                          /*meida type, image or video*/\r
72         char *thumb_url;                   /*the thumbnail full path of this meida file*/\r
73         char *file_url;                    /*the full path of this meida file*/\r
74         time_t mtime;                      /*modified time*/\r
75         char *album_uuid;                /*folder UUID*/\r
76         char *display_name;                /*item name*/\r
77 \r
78         union {\r
79                 ge_image_s *image_info;    /*image information*/\r
80                 ge_video_s *video_info;    /*video information*/\r
81         };\r
82         void *_reserved;                   /*reserved*/\r
83 };\r
84 \r
85 struct _ge_image_t {\r
86         char *media_uuid;                  /*media uuid*/\r
87         image_meta_h image_h;              /*the handle of operating this image*/\r
88         media_content_orientation_e orientation;                   /*the orientation of this image*/\r
89         void *_reserved;                   /*reserved*/\r
90 };\r
91 \r
92 struct _ge_video_t {\r
93         char *media_uuid;                  /*media uuid*/\r
94         video_meta_h video_h;              /*the handle of operating this video*/\r
95         char *title;                       /*the title of video*/\r
96         time_t last_played_pos;            /*the last played position*/\r
97         int duration;                      /*the duration of this video*/\r
98         int bookmarks;                     /*whether exist bookmarks*/\r
99         void *_reserved;                   /*reserved*/\r
100 };\r
101 \r
102 int _ge_data_type_new_media(ge_media_s **item);\r
103 int _ge_data_type_new_album(ge_album_s **album);\r
104 int _ge_data_type_free_media_list(Eina_List **list);\r
105 int _ge_data_type_free_album_list(Eina_List **list);\r
106 int _ge_data_type_free_geitem(void **item);\r
107 \r
108 #endif\r
109 \r