// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
, __visitedCount(0)
, __pThumbnail(null)
, __thumbnailPath("")
+ ,__pFavIconData(null)
+ ,__favIconHeight(0)
+ ,__favIconWidth(0)
{
AppLog("History::History(void)");
__visitedTime.SetValue(0,0,0);
History::~History(void)
{
- if(__pThumbnail != null)
+ if (__pThumbnail != null)
{
delete __pThumbnail; //TODO To get this reviewed
}
+ if (__pFavIconData)
+ {
+ delete __pFavIconData;
+ }
AppLog("History::~History()");
}
{
__thumbnailPath = thumbnailPath;
}
+
+void
+History::SetFavIconBitmap(Tizen::Graphics::Bitmap& favIconImage)
+{
+ Image* pImage = null;
+ pImage = new Image();
+ pImage->Construct();
+ if (__pFavIconData != null)
+ {
+ delete __pFavIconData;
+ __pFavIconData = null;
+ }
+ __pFavIconData = pImage->EncodeToBufferN(favIconImage,Tizen::Media::IMG_FORMAT_PNG);
+
+ __favIconWidth = favIconImage.GetWidth();
+ __favIconHeight = favIconImage.GetHeight();
+
+ delete pImage;
+}
+
+void
+History::SetFavIconBuffer(Tizen::Base::ByteBuffer& favIconBuffer)
+{
+ __pFavIconData = &favIconBuffer;
+}
+
+ByteBuffer*
+History::GetFavIconBuffer()
+{
+ return __pFavIconData;
+}
+
+Bitmap*
+History::GetFavIconBitmap()
+{
+ Bitmap *pBitmap = null;
+
+ if (__pFavIconData != null)
+ {
+ Image *pImage = new(std::nothrow) Image();
+ pImage->Construct();
+ pBitmap = pImage->DecodeN(*__pFavIconData, IMG_FORMAT_PNG, BITMAP_PIXEL_FORMAT_ARGB8888);
+ delete pImage;
+ }
+ return pBitmap;
+}
+
+int
+History::GetFavIconWidth()
+{
+ return __favIconWidth;
+}
+
+int
+History::GetFavIconHeight()
+{
+ return __favIconHeight;
+}
+
+void
+History::SetFavIconWidth(int width)
+{
+ __favIconWidth = width;
+}
+
+void
+History::SetFavIconHeight(int height)
+{
+ __favIconHeight = height;
+}