diff options
Diffstat (limited to 'src/FWebHistoryItem.cpp')
-rwxr-xr-x | src/FWebHistoryItem.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/FWebHistoryItem.cpp b/src/FWebHistoryItem.cpp new file mode 100755 index 0000000..f333cf8 --- /dev/null +++ b/src/FWebHistoryItem.cpp @@ -0,0 +1,84 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FWebHistoryItem.cpp + * @brief The file contains the definition of HistoryItem class. + * + * This file contains the definition of HistoryItem class. + */ +#include <new> +#include <FBaseResult.h> +#include <FBaseSysLog.h> +#include <FWebHistoryItem.h> +#include "FWeb_HistoryItemImpl.h" + + +using namespace Tizen::Base; +using namespace Tizen::Graphics; + + +namespace Tizen { namespace Web +{ + + +HistoryItem::HistoryItem(void) + : __pHistoryItemImpl(new (std::nothrow) _HistoryItemImpl()) +{ + SysTryReturnVoidResult(NID_WEB, __pHistoryItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); +} + + +HistoryItem::~HistoryItem(void) +{ + delete __pHistoryItemImpl; + __pHistoryItemImpl = null; +} + + +String +HistoryItem::GetTitle(void) const +{ + SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use."); + + return __pHistoryItemImpl->GetTitle(); +} + + +String +HistoryItem::GetUrl(void) const +{ + SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use."); + + return __pHistoryItemImpl->GetUrl(); +} + +Bitmap* +HistoryItem::GetFaviconN(void) const +{ + SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use."); + + ClearLastResult(); + + Bitmap* pFavicon = __pHistoryItemImpl->GetFaviconN(); + SysTryReturn(NID_WEB, pFavicon, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + return pFavicon; +} + + +}} // Tizen::Web |