2 // Open Service Platform
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.
19 * @file FWebHistoryItem.cpp
20 * @brief The file contains the definition of HistoryItem class.
22 * This file contains the definition of HistoryItem class.
25 #include <FBaseResult.h>
26 #include <FBaseSysLog.h>
27 #include <FGrpBitmap.h>
28 #include <FWebHistoryItem.h>
29 #include "FWeb_HistoryItemImpl.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Graphics;
36 namespace Tizen { namespace Web
40 HistoryItem::HistoryItem(void)
41 : __pHistoryItemImpl(new (std::nothrow) _HistoryItemImpl())
43 SysTryReturnVoidResult(NID_WEB, __pHistoryItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
47 HistoryItem::~HistoryItem(void)
49 delete __pHistoryItemImpl;
50 __pHistoryItemImpl = null;
55 HistoryItem::GetTitle(void) const
57 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
59 return __pHistoryItemImpl->GetTitle();
64 HistoryItem::GetUrl(void) const
66 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
68 return __pHistoryItemImpl->GetUrl();
72 HistoryItem::GetFaviconN(void) const
74 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
78 Bitmap* pFavicon = __pHistoryItemImpl->GetFaviconN();
79 SysTryReturn(NID_WEB, GetLastResult() == E_SUCCESS, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));