diff options
Diffstat (limited to 'src/controls/FWebCtrl_HitElementResultImpl.cpp')
-rwxr-xr-x | src/controls/FWebCtrl_HitElementResultImpl.cpp | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/src/controls/FWebCtrl_HitElementResultImpl.cpp b/src/controls/FWebCtrl_HitElementResultImpl.cpp new file mode 100755 index 0000000..62852b7 --- /dev/null +++ b/src/controls/FWebCtrl_HitElementResultImpl.cpp @@ -0,0 +1,154 @@ +// +// 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 FWebCtrl_HitElementResultImpl.cpp + * @brief The file contains the definition of _HitElementResultImpl class. + * + * The file contains the definition of _HitElementResultImpl class. + */ +#include <FGrpBitmap.h> +#include <FWebCtrlHitElementResult.h> +#include <FBaseSysLog.h> +#include "FWebCtrl_HitElementResultImpl.h" + + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Graphics; + + +namespace Tizen { namespace Web { namespace Controls +{ + + +_HitElementResultImpl::_HitElementResultImpl(void) + : __pAttributeMap(null) + , __pImage(null) + , __content(L"") + , __tagName(L"") + , __url(L"") +{ +} + + +_HitElementResultImpl::~_HitElementResultImpl(void) +{ +} + + +void +_HitElementResultImpl::SetHitElementResult(IMap* pAttributeMap, Bitmap* pImage, const String& tagName, const String& content, const String& url) +{ + __pAttributeMap = std::unique_ptr<IMap, AllElementsDeleter>(pAttributeMap); + __pImage = std::unique_ptr<Bitmap>(pImage); + __tagName = tagName; + __content = content; + __url = url; +} + + +String +_HitElementResultImpl::GetTagName(void) const +{ + return __tagName; +} + + +String +_HitElementResultImpl::GetAttributeValue(const String& attributeName) const +{ + String attribute(L""); + + if (__pAttributeMap.get()) + { + const String* pValue = dynamic_cast< const String* >(__pAttributeMap->GetValue(attributeName)); + + if (pValue) + { + attribute = *pValue; + } + } + + return attribute; +} + + +String +_HitElementResultImpl::GetContent(void) const +{ + return __content; +} + + +String +_HitElementResultImpl::GetUrl(void) const +{ + return __url; +} + + +const Bitmap* +_HitElementResultImpl::GetImage(void) const +{ + return __pImage.get(); +} + + +bool +_HitElementResultImpl::HasImage(void) const +{ + if (__pImage.get()) + { + return true; + } + else + { + return false; + } +} + + +bool +_HitElementResultImpl::HasUrl(void) const +{ + if (__url.GetLength()) + { + return true; + } + else + { + return false; + } +} + + +_HitElementResultImpl* +_HitElementResultImpl::GetInstance(HitElementResult* pHitElementResult) +{ + return pHitElementResult->__pHitElementResultImpl; +} + + +const _HitElementResultImpl* +_HitElementResultImpl::GetInstance(const HitElementResult* pHitElementResult) +{ + return pHitElementResult->__pHitElementResultImpl; +} + + +}}} // Tizen::Web::Controls |