/* * Copyright (c) 2015 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://floralicense.org/license/ * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _DOC_DATA_UTIL_H_ #define _DOC_DATA_UTIL_H_ #include #include #include #include #include "doc-debug.h" #include "doc-strings.h" #include "doc-data-type.h" #include "doc-ugdata.h" #ifdef _cplusplus extern "C" { #endif /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music*/ #define DOC_CONDITION_LOCAL_DOCUMENT "((MEDIA_TYPE=4) AND (MEDIA_STORAGE_TYPE=0 OR MEDIA_STORAGE_TYPE=1))" #define DOC_CONDITION_ORDER "MEDIA_TIMELINE, MEDIA_DISPLAY_NAME" #define CONDITION_LENGTH 512 #define KEYWORD_LENGTH 128 #define DOC_CAMERA_PATH_PHONE "/opt/usr/media/DCIM/Camera" #define DOC_CAMERA_PATH_MMC "/opt/storage/sdcard/DCIM/Camera" #define DOC_DOWNLOADS_PATH "/opt/usr/media/Downloads" #define DOC_ROOT_PATH_MMC "/opt/storage/sdcard" #define DOC_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */ #define DOC_GET_ALL_RECORDS -1 typedef struct _doc_transfer_data_t doc_transfer_data_s; struct _doc_transfer_data_t { void **userdata; char *folder_id; bool with_meta; bool b_mtype; int list_type; }; typedef struct _doc_filter_t doc_filter_s; struct _doc_filter_t { char cond[CONDITION_LENGTH]; /*set media type or favorite type, or other query statement */ media_content_collation_e collate_type; /*collate type */ media_content_order_e sort_type; /*sort type */ char sort_keyword[KEYWORD_LENGTH]; /*sort keyword */ int offset; /*offset */ int count; /*count */ bool with_meta; /*whether get image or video info */ int list_type; }; typedef enum { DOC_FOLDER_LIST_NONE, /**< */ DOC_FOLDER_LIST_FIRST, /**< Get first several folders except Camera and Downloads */ DOC_FOLDER_LIST_PATH, /**< Get a folder via path */ DOC_FOLDER_LIST_ALL,/**< Get all folders except Camera and Downloads */ } doc_folder_list_e; doc_item *doc_data_util_calloc_item(void); int doc_data_util_free_mtype_items(Eina_List ** elist); int doc_data_util_free_item(doc_item * item); doc_sel_item_s *doc_data_util_new_sel_item(doc_item * ditem); int doc_data_util_free_sel_item(doc_sel_item_s * item); int doc_data_util_create_filter(doc_filter_s * condition, filter_h * filter); int doc_data_util_destroy_filter(filter_h filter); bool doc_data_util_clone_media(media_info_h media, doc_media_s ** pitem, bool b_meta); #ifdef _cplusplus } #endif #endif //_DOC_DATA_UTIL_H_