2 * Copyright (c) 2011 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.
17 #include <dpl/log/log.h>
18 #include <Commons/Exception.h>
19 #include "MediacontentMedia.h"
25 namespace Mediacontent {
27 MediacontentMedia::MediacontentMedia()
29 m_isChangedFavorite = false;
30 m_isGetMimetype = false;
33 MediacontentMedia::~MediacontentMedia()
37 string MediacontentMedia::getMediaUUID() const
42 void MediacontentMedia::setMediaUUID(const string &value)
47 string MediacontentMedia::getMimeType()
49 LogDebug("MediacontentMedia::getMimeType");
54 res = aul_get_mime_from_file(m_filePath.c_str(), type, sizeof(type));
55 LogDebug("file:"<< m_filePath <<" type:" << type);
59 m_isGetMimetype = true;
65 string MediacontentMedia::getDisplayName() const
70 void MediacontentMedia::setMimeType(const string &value)
76 void MediacontentMedia::setDisplayName(const string &value)
78 m_displayName = value;
81 string MediacontentMedia::getFilePath() const
87 void MediacontentMedia::setFilePath(const string &value)
93 string MediacontentMedia::getThumbnailPath() const
95 return m_thumbnailPath;
99 tm MediacontentMedia::getCreatedDate() const
101 return m_createdDate;
104 tm MediacontentMedia::getReleasedDate() const
106 return m_releasedDate;
109 void MediacontentMedia::setThumbnailPath(const string &value)
111 m_thumbnailPath = value;
114 tm MediacontentMedia::getModifiedDate() const
116 return m_modifiedDate;
119 void MediacontentMedia::setCreatedDate(const tm &value)
121 m_createdDate = value;
125 void MediacontentMedia::setReleasedDate(const tm &value)
127 m_releasedDate = value;
131 void MediacontentMedia::setModifiedDate(const tm &value)
133 m_modifiedDate = value;
136 int MediacontentMedia::getFavorite() const
140 void MediacontentMedia::setFavorite(int value)
143 m_isChangedFavorite = true;
146 string MediacontentMedia::getMediaType() const
151 void MediacontentMedia::setMediaType(const string &value)
156 void MediacontentMedia::display() const
159 LogDebug("m_mediaUUID : " << m_mediaUUID);
160 LogDebug("m_mediaType : " << m_mediaType);
161 // LogDebug("m_mimeType : " << m_mimeType);
162 LogDebug("m_displayName : " << m_displayName);
163 LogDebug("m_filePath : " << m_filePath);
164 LogDebug("m_thumbnailPath : " << m_thumbnailPath);
165 LogDebug("m_description : " << m_description);
166 // LogDebug("m_createdDate : " << m_createdDate);
167 // LogDebug("m_releasedDate : " << m_releasedDate);
168 // LogDebug("m_modifiedDate : " << m_modifiedDate);
169 LogDebug("m_favorite : " << m_favorite);
173 string MediacontentMedia::getDescription() const
175 return m_description;
178 void MediacontentMedia::setDescription(const string &value)
180 m_description = value;
183 bool MediacontentMedia::getIsChangedFavorite() const
185 return m_isChangedFavorite;
190 EditableAttributeListPtr MediacontentMedia::getEditableAttr() const
192 return m_editableAttrPtr;