2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include <Commons/Exception.h>
19 #include "ContentMedia.h"
26 MediacontentMedia::MediacontentMedia()
28 m_isChangedFavorite = false;
29 m_isChangedDisplayName = false;
31 m_releasedDate = NULL;
32 m_modifiedDate = NULL;
36 m_favorite = false; //unused.
37 m_editableAttrList.push_back("name");
38 m_editableAttrList.push_back("rating");
39 m_editableAttrList.push_back("description");
42 MediacontentMedia::~MediacontentMedia()
44 m_editableAttrList.clear();
45 if(m_createdDate != NULL)
49 if(m_releasedDate != NULL)
53 if(m_modifiedDate != NULL)
59 string MediacontentMedia::getMediaUUID() const
64 void MediacontentMedia::setMediaUUID(const string &value)
69 string MediacontentMedia::getMimeType()
71 LoggerD("MediacontentMedia::getMimeType");
75 string MediacontentMedia::getDisplayName() const
80 void MediacontentMedia::setMimeType(const string &value)
85 void MediacontentMedia::setDisplayName(const string &value, bool isChanged)
87 m_displayName = value;
89 m_isChangedDisplayName = true;
92 string MediacontentMedia::getTitle() const
97 void MediacontentMedia::setTitle(const string &value)
102 string MediacontentMedia::getFilePath() const
108 void MediacontentMedia::setFilePath(const string &value)
114 string MediacontentMedia::getThumbnailPath() const
116 return m_thumbnailPath;
120 tm* MediacontentMedia::getCreatedDate() const
122 return m_createdDate;
125 tm* MediacontentMedia::getReleasedDate() const
127 return m_releasedDate;
130 void MediacontentMedia::setThumbnailPath(const string &value)
132 m_thumbnailPath = value;
135 tm* MediacontentMedia::getModifiedDate() const
137 return m_modifiedDate;
140 void MediacontentMedia::setCreatedDate(tm *value)
142 m_createdDate = value;
146 void MediacontentMedia::setReleasedDate(tm *value)
148 m_releasedDate = value;
152 void MediacontentMedia::setModifiedDate(tm *value)
154 m_modifiedDate = value;
157 bool MediacontentMedia::getFavorite() const
161 void MediacontentMedia::setFavorite(bool value)
164 m_isChangedFavorite = true;
167 string MediacontentMedia::getMediaType() const
172 void MediacontentMedia::setMediaType(const string &value)
177 void MediacontentMedia::display() const
180 LoggerD("m_mediaUUID : " << m_mediaUUID);
181 LoggerD("m_mediaType : " << m_mediaType);
182 // LoggerD("m_mimeType : " << m_mimeType);
183 LoggerD("m_displayName : " << m_displayName);
184 LoggerD("m_filePath : " << m_filePath);
185 LoggerD("m_thumbnailPath : " << m_thumbnailPath);
186 LoggerD("m_description : " << m_description);
187 // LoggerD("m_createdDate : " << m_createdDate);
188 // LoggerD("m_releasedDate : " << m_releasedDate);
189 // LoggerD("m_modifiedDate : " << m_modifiedDate);
190 LoggerD("m_favorite : " << m_favorite);
194 string MediacontentMedia::getDescription() const
196 return m_description;
199 void MediacontentMedia::setDescription(const string &value, bool isChanged)
201 m_description = value;
203 m_isChangedDescription = true;
207 bool MediacontentMedia::getIsChangedFavorite() const
209 return m_isChangedFavorite;
212 bool MediacontentMedia::isChangedRating() const
214 return m_isChangedRating;
217 bool MediacontentMedia::isChangedDisplayName() const
219 return m_isChangedDisplayName;
222 bool MediacontentMedia::isChangedDescription() const
224 return m_isChangedDescription;
227 vector<std::string> MediacontentMedia::getEditableAttr() const
229 return m_editableAttrList;
232 void MediacontentMedia::setSize(unsigned long long value)
237 unsigned long long MediacontentMedia::getSize() const
242 void MediacontentMedia::setRating(int value, bool isChanged)
246 m_isChangedRating = true;
249 int MediacontentMedia::getRating() const