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 <FWebHistoryItem.h>
28 #include "FWeb_HistoryItemImpl.h"
31 using namespace Tizen::Base;
32 using namespace Tizen::Graphics;
35 namespace Tizen { namespace Web
39 HistoryItem::HistoryItem(void)
40 : __pHistoryItemImpl(new (std::nothrow) _HistoryItemImpl())
42 SysTryReturnVoidResult(NID_WEB, __pHistoryItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
46 HistoryItem::~HistoryItem(void)
48 delete __pHistoryItemImpl;
49 __pHistoryItemImpl = null;
54 HistoryItem::GetTitle(void) const
56 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
58 return __pHistoryItemImpl->GetTitle();
63 HistoryItem::GetUrl(void) const
65 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
67 return __pHistoryItemImpl->GetUrl();
71 HistoryItem::GetFaviconN(void) const
73 SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
77 Bitmap* pFavicon = __pHistoryItemImpl->GetFaviconN();
78 SysTryReturn(NID_WEB, pFavicon, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));