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 * @brief This is the header file for the %Url class.
21 * This header file contains the declarations of the %Url class.
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FSclTypes.h>
31 namespace Tizen { namespace Social
36 * The maximum length of the URL property.
38 * @brief <i> [Deprecated] </i>
39 * @deprecated This constant is deprecated because there is no limitation any more.
43 static const int MAX_URL_LENGTH = 100;
47 * @brief This class stores the information of a URL.
51 * @final This class is not intended for extension.
53 * @remarks The %Url class consists of a URL string and a URL type.
55 * The %Url class stores the information of a URL. @n
56 * The following example demonstrates how to use the %Url class.
59 using namespace Tizen::Base;
60 using namespace Tizen::Social;
63 MyClass::SomeMethod(void)
67 // Creates an instance of Url
71 r = url.SetUrl(L"http://www.tizen.org");
78 url.SetType(URL_TYPE_WORK);
84 class _OSP_EXPORT_ Url
85 : public Tizen::Base::Object
89 * This is the default constructor for this class.
96 * Initializes this instance with the specified URL string and type.
100 * @param[in] type The type of the URL
101 * @param[in] url The URL
103 Url(UrlType type, const Tizen::Base::String& url);
106 * Copying of objects using this copy constructor is allowed.
110 * @param[in] rhs An instance of %Url
115 * This destructor overrides Tizen::Base::Object::~Object().
122 * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
126 * @return @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n
128 * @param[in] rhs An instance of Tizen::Base::Object to compare
130 virtual bool Equals(const Tizen::Base::Object& rhs) const;
133 * Gets the hash value of the current instance of Tizen::Base::Object.
137 * @return An integer value indicating the hash value of the current instance of Tizen::Base::Object
139 virtual int GetHashCode(void) const;
142 * Gets the type of this %Url instance.
145 * @brief <i> [Compatibility] </i>
149 * @compatibility This method has compatibility issues with OSP compatible applications. @n
150 * For more information, see @ref CompUrlGetTypePage "here".
153 * @return The type of %Url
155 UrlType GetType(void) const;
159 * @page CompUrlGetTypePage Compatibility for GetType()
160 * @section CompUrlGetTypePageIssueSection Issues
161 * Implementing this method in OSP compatible applications has the following issue: @n
162 * -# URL_TYPE_CUSTOM is not supported. If the type of the url is URL_TYPE_CUSTOM, URL_TYPE_OTHER is returned instead.
164 * @section CompUrlGetTypePageSolutionSection Resolutions
165 * The issue mentioned above has been resolved in Tizen.
171 * Gets the label of an URL.
175 * @return The URL label
178 Tizen::Base::String GetLabel(void) const;
181 * Sets the label of an URL.
185 * @param[in] label The URL label
188 void SetLabel(const Tizen::Base::String& label);
191 * Gets the URL of this %Url instance.
195 * @return The URL as a string
197 Tizen::Base::String GetUrl(void) const;
200 * Sets the type of this %Url instance.
204 * @param[in] type The type of %Url
206 void SetType(UrlType type);
209 * Sets the URL of this %Url instance.
212 * @brief <i> [Compatibility] </i>
216 * @compatibility This method has compatibility issues with OSP compatible applications. @n
217 * For more information, see @ref CompUrlSetUrlPage "here".
220 * @return An error code
221 * @param[in] url The URL
222 * @exception E_SUCCESS The method is successful.
223 * @exception E_INVALID_ARG The specified @c url is an empty string.
225 result SetUrl(const Tizen::Base::String& url);
229 * @page CompUrlSetUrlPage Compatibility for SetUrl()
230 * @section CompUrlSetUrlPageIssueSection Issues
231 * Implementing this method in OSP compatible applications has the following issue: @n
232 * -# If the length of an URL to be set is greater than 100 characters, E_INVALID_ARG is returned.
234 * @section CompUrlSetUrlPageSolutionSection Resolutions
235 * The issue mentioned above has been resolved in Tizen.
239 * Copying of objects using this copy assignment operator is allowed.
243 * @param[in] rhs An instance of %Url
245 Url& operator =(const Url& rhs);
248 * Checks whether the specified instance is equal to the calling instance.
252 * @return @c true if the data of the specified instance is equal to the data of the current instance, @n
254 * @param[in] rhs The source instance of %Url
256 bool operator ==(const Url& rhs) const;
259 * Compares the specified instance with the calling instance for inequality.
263 * @return @c true if the data of the specified instance is not equal to the data of the current instance, @n
265 * @param[in] rhs The source instance of %Url
267 bool operator !=(const Url& rhs) const;
270 friend class _UrlImpl;
271 class _UrlImpl* __pUrlImpl;
276 #endif // _FSCL_URL_H_