2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FScl_UrlImpl.cpp
18 * @brief This is the implementation for _UrlImpl class.
20 * This file contains definitions of @e _UrlImpl class.
23 #include <FBaseSysLog.h>
25 #include <FApp_AppInfo.h>
26 #include "FScl_UrlImpl.h"
28 using namespace Tizen::App;
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Social
34 _UrlImpl::_UrlImpl(void)
35 : __type(URL_TYPE_PERSONAL)
40 _UrlImpl::_UrlImpl(UrlType type, const String& url)
47 _UrlImpl::_UrlImpl(const _UrlImpl& rhs)
50 __label = rhs.__label;
54 _UrlImpl::~_UrlImpl(void)
60 _UrlImpl::operator =(const _UrlImpl& rhs)
68 __label = rhs.__label;
75 _UrlImpl::operator ==(const _UrlImpl& rhs) const
77 if (__type == rhs.__type && __label == rhs.__label && __url == rhs.__url)
86 _UrlImpl::operator !=(const _UrlImpl& rhs) const
88 return !(*this == rhs);
92 _UrlImpl::Equals(const Object& rhs) const
94 const _UrlImpl* pUrl = dynamic_cast<const _UrlImpl*>(&rhs);
101 return (*this == *pUrl);
105 _UrlImpl::GetHashCode(void) const
110 hashCode += __label.GetHashCode();
111 hashCode += __url.GetHashCode();
117 _UrlImpl::GetType(void) const
123 _UrlImpl::GetUrl(void) const
129 _UrlImpl::SetType(UrlType type)
135 _UrlImpl::SetUrl(const String& url)
137 SysTryReturn(NID_SCL, !url.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The url is empty", GetErrorMessage(E_INVALID_ARG));
145 _UrlImpl::GetLabel(void) const
151 _UrlImpl::SetLabel(const String& label)
157 _UrlImpl::GetInstance(const Url& url)
159 return url.__pUrlImpl;
163 _UrlImpl::GetInstance(Url& url)
165 return url.__pUrlImpl;