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 FWebCtrl_HitElementResultImpl.cpp
20 * @brief The file contains the definition of _HitElementResultImpl class.
22 * The file contains the definition of _HitElementResultImpl class.
24 #include <FGrpBitmap.h>
25 #include <FWebCtrlHitElementResult.h>
26 #include <FBaseSysLog.h>
27 #include "FWebCtrl_HitElementResultImpl.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::Graphics;
35 namespace Tizen { namespace Web { namespace Controls
39 _HitElementResultImpl::_HitElementResultImpl(void)
40 : __pAttributeMap(null)
49 _HitElementResultImpl::~_HitElementResultImpl(void)
55 _HitElementResultImpl::SetHitElementResult(IMap* pAttributeMap, Bitmap* pImage, const String& tagName, const String& content, const String& url)
57 __pAttributeMap = std::unique_ptr<IMap, AllElementsDeleter>(pAttributeMap);
58 __pImage = std::unique_ptr<Bitmap>(pImage);
66 _HitElementResultImpl::GetTagName(void) const
73 _HitElementResultImpl::GetAttributeValue(const String& attributeName) const
75 String attribute(L"");
77 if (__pAttributeMap.get())
79 const String* pValue = dynamic_cast< const String* >(__pAttributeMap->GetValue(attributeName));
92 _HitElementResultImpl::GetContent(void) const
99 _HitElementResultImpl::GetUrl(void) const
106 _HitElementResultImpl::GetImage(void) const
108 return __pImage.get();
113 _HitElementResultImpl::HasImage(void) const
127 _HitElementResultImpl::HasUrl(void) const
129 if (__url.GetLength())
140 _HitElementResultImpl*
141 _HitElementResultImpl::GetInstance(HitElementResult* pHitElementResult)
143 return pHitElementResult->__pHitElementResultImpl;
147 const _HitElementResultImpl*
148 _HitElementResultImpl::GetInstance(const HitElementResult* pHitElementResult)
150 return pHitElementResult->__pHitElementResultImpl;
154 }}} // Tizen::Web::Controls