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
70 AppLog("History::~History()");
74 History::operator =(const History& rhs)
78 __historyId = rhs.__historyId;
79 __historyTitle = rhs.__historyTitle;
80 __historyUrl = rhs.__historyUrl;
86 History::GetHistoryId(void) const
92 History::GetHistoryTitle(void) const
94 return __historyTitle;
98 History::GetHistoryUrl(void) const
104 History::GetVisitedTime(void) const
106 return __visitedTime;
110 History::GetHistoryIconPath(void) const
116 History::GetFaviconId(void) const
122 History::GetBookmarkId(void) const
128 History::GetVisitedCount(void) const
130 return __visitedCount;
134 History::GetThumbnail(void) const
140 History::GetThumbnailPath(void) const
142 return __thumbnailPath;
146 History::SetHistoryId(const String& strHistoryId)
148 __historyId = strHistoryId;
153 History::SetHistoryTitle(String& strHistoryTitle)
155 strHistoryTitle.Trim();
156 __historyTitle = strHistoryTitle;
161 History::SetHistoryUrl(const String& strHistoryUrl)
163 __historyUrl = strHistoryUrl;
168 History::SetVisitedTime(const DateTime& strVisitedTime)
170 __visitedTime = strVisitedTime;
175 History::SetIconPath(const String& strFilePath)
177 __iconPath = strFilePath;
182 History::SetFaviconId(const String& strFaviconId)
184 __faviconId = strFaviconId;
188 History::SetBookmarkId(const String& bookmarkId)
190 __bookmarkId = bookmarkId;
194 History::SetVisitedCount(int& visitedCount)
196 __visitedCount = visitedCount;
200 History::SetThumbnail(Bitmap* thumbnail)
202 //TODO To get this reviewed
203 if(__pThumbnail != thumbnail && __pThumbnail != null) {
206 __pThumbnail = thumbnail;
210 History::SetThumbnailPath(String& thumbnailPath)
212 __thumbnailPath = thumbnailPath;
216 History::SetFavIconBitmap(Tizen::Graphics::Bitmap& favIconImage)
218 Image* pImage = null;
219 pImage = new Image();
221 __pFavIconData = pImage->EncodeToBufferN(favIconImage,Tizen::Media::IMG_FORMAT_PNG);
223 __favIconWidth = favIconImage.GetWidth();
224 __favIconHeight = favIconImage.GetHeight();
230 History::SetFavIconBuffer(Tizen::Base::ByteBuffer& favIconBuffer)
232 __pFavIconData = &favIconBuffer;
236 History::GetFavIconBuffer()
238 return __pFavIconData;
242 History::GetFavIconBitmap()
244 Bitmap *pBitmap = null;
246 if (__pFavIconData != null)
248 Image *pImage = new(std::nothrow) Image();
250 pBitmap = pImage->DecodeN(*__pFavIconData, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
257 History::GetFavIconWidth()
259 return __favIconWidth;
263 History::GetFavIconHeight()
265 return __favIconHeight;
269 History::SetFavIconWidth(int width)
271 __favIconWidth = width;
275 History::SetFavIconHeight(int height)
277 __favIconHeight = height;