3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
19 /*@file: IntHistory.cpp
20 *@brief: Used to define History
23 #include "IntHistoryData.h"
25 using namespace Tizen::App;
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Collection;
28 using namespace Tizen::Base::Utility;
29 using namespace Tizen::Content;
30 using namespace Tizen::Graphics;
31 using namespace Tizen::Io;
32 using namespace Tizen::System;
33 using namespace Tizen::Locales;
34 using namespace Tizen::Media;
35 using namespace Tizen::Ui;
36 using namespace Tizen::Ui::Controls;
38 History::History(void)
52 AppLog("History::History(void)");
53 __visitedTime.SetValue(0,0,0);
56 History::History(const History& hs)
58 AppLog("History::History(const History& hs)");
59 __historyId = hs.__historyId;
60 __historyTitle = hs.__historyTitle;
61 __historyUrl = hs.__historyUrl;
64 History::~History(void)
66 if (__pThumbnail != null)
68 delete __pThumbnail; //TODO To get this reviewed
72 delete __pFavIconData;
74 AppLog("History::~History()");
78 History::operator =(const History& rhs)
82 __historyId = rhs.__historyId;
83 __historyTitle = rhs.__historyTitle;
84 __historyUrl = rhs.__historyUrl;
90 History::GetHistoryId(void) const
96 History::GetHistoryTitle(void) const
98 return __historyTitle;
102 History::GetHistoryUrl(void) const
108 History::GetVisitedTime(void) const
110 return __visitedTime;
114 History::GetHistoryIconPath(void) const
120 History::GetFaviconId(void) const
126 History::GetBookmarkId(void) const
132 History::GetVisitedCount(void) const
134 return __visitedCount;
138 History::GetThumbnail(void) const
144 History::GetThumbnailPath(void) const
146 return __thumbnailPath;
150 History::SetHistoryId(const String& strHistoryId)
152 __historyId = strHistoryId;
157 History::SetHistoryTitle(String& strHistoryTitle)
159 strHistoryTitle.Trim();
160 __historyTitle = strHistoryTitle;
165 History::SetHistoryUrl(const String& strHistoryUrl)
167 __historyUrl = strHistoryUrl;
172 History::SetVisitedTime(const DateTime& strVisitedTime)
174 __visitedTime = strVisitedTime;
179 History::SetIconPath(const String& strFilePath)
181 __iconPath = strFilePath;
186 History::SetFaviconId(const String& strFaviconId)
188 __faviconId = strFaviconId;
192 History::SetBookmarkId(const String& bookmarkId)
194 __bookmarkId = bookmarkId;
198 History::SetVisitedCount(int& visitedCount)
200 __visitedCount = visitedCount;
204 History::SetThumbnail(Bitmap* thumbnail)
206 //TODO To get this reviewed
207 if(__pThumbnail != thumbnail && __pThumbnail != null) {
210 __pThumbnail = thumbnail;
214 History::SetThumbnailPath(String& thumbnailPath)
216 __thumbnailPath = thumbnailPath;
220 History::SetFavIconBitmap(Tizen::Graphics::Bitmap& favIconImage)
222 Image* pImage = null;
223 pImage = new Image();
225 if (__pFavIconData != null)
227 delete __pFavIconData;
228 __pFavIconData = null;
230 __pFavIconData = pImage->EncodeToBufferN(favIconImage,Tizen::Media::IMG_FORMAT_PNG);
232 __favIconWidth = favIconImage.GetWidth();
233 __favIconHeight = favIconImage.GetHeight();
239 History::SetFavIconBuffer(Tizen::Base::ByteBuffer& favIconBuffer)
241 __pFavIconData = &favIconBuffer;
245 History::GetFavIconBuffer()
247 return __pFavIconData;
251 History::GetFavIconBitmap()
253 Bitmap *pBitmap = null;
255 if (__pFavIconData != null)
257 Image *pImage = new(std::nothrow) Image();
259 pBitmap = pImage->DecodeN(*__pFavIconData, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
266 History::GetFavIconWidth()
268 return __favIconWidth;
272 History::GetFavIconHeight()
274 return __favIconHeight;
278 History::SetFavIconWidth(int width)
280 __favIconWidth = width;
284 History::SetFavIconHeight(int height)
286 __favIconHeight = height;