2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <AppCommon.h>
30 bool CFileInfo::Create(void)
39 memset(m, 0, sizeof(SFileInfo));
41 if (!CExtNameInfo::Create(CExtNameInfo::CLASS_TYPE_FILE)) {
51 void CFileInfo::Destroy(void)
56 CExtNameInfo::Destroy();
63 groups gType(media_content_type_e type)
65 groups ret = E_GRP_OTHER;
68 case MEDIA_CONTENT_TYPE_IMAGE:
72 case MEDIA_CONTENT_TYPE_VIDEO:
75 case MEDIA_CONTENT_TYPE_MUSIC:
87 bool CFileInfo::Duplicate(CNameInfo* obj)
92 if (!CExtNameInfo::Duplicate(obj))
99 bool CFileInfo::SetLoadInfo(media_info_h handle)
108 bool CFileInfo::Load(void)
116 if (media_info_get_media_id(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
117 _ERR("media ID Fetch error");
123 if (media_info_get_title(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
124 _ERR("media name Fetch error");
130 media_content_type_e ctype;
131 if (media_info_get_media_type(m->handle, &ctype) != MEDIA_CONTENT_ERROR_NONE) {
132 _ERR("media type Fetch error");
135 SetType(gType(ctype));
138 if (media_info_get_size(m->handle, &size) != MEDIA_CONTENT_ERROR_NONE) {
139 _ERR("media size Fetch error");
144 if (media_info_get_file_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
145 _ERR("media file path Fetch error");
151 if (media_info_get_thumbnail_path(m->handle, &str) != MEDIA_CONTENT_ERROR_NONE) {
152 _ERR("media thumb Fetch error");
157 _ERR("Fail to get string by media_info_get_thumbnail_path");
162 SetThumbnailPath(str);
167 if (media_info_get_modified_time(m->handle, &time) != MEDIA_CONTENT_ERROR_NONE) {
168 _ERR("media mod time Fetch error");
171 SetModifiedTime(time);