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 FWebBookmarkItem.h
20 * @brief This is the header file for the %BookmarkItem class.
22 * This header file contains the declarations of the %BookmarkItem class.
25 #ifndef _FWEB_BOOKMARK_ITEM_H_
26 #define _FWEB_BOOKMARK_ITEM_H_
28 #include <FBaseString.h>
30 namespace Tizen { namespace Graphics
35 namespace Tizen { namespace Web
37 class _BookmarkItemImpl;
40 * A unique ID. This ID is unique within a local storage only. @n
41 * @c RecordId is assigned by the local storage when a record is saved to the storage.
49 * The root folder ID. @n
50 * In fact, it is a symbolic value because the root folder record does not exist physically.
54 const RecordId ROOT_FOLDER_ID = -1;
58 * @brief This class is used for accessing a bookmark item stored in the %WebBookmark class.
62 * @final This class is not intended for extension.
64 * The %BookmarkItem class provides access to the WebBookmark class.
65 * Each item contains the title, the URL of the page, the item type, and the parent folder ID.
67 class _OSP_EXPORT_ BookmarkItem
68 : public Tizen::Base::Object
73 * Copying of objects using this copy constructor is allowed.
74 * This is the copy constructor for the %BookmarkItem class. @n
75 * It creates an instance of %BookmarkItem with the values of the specified instance.
79 * @param[in] rhs An instance of %BookmarkItem
81 BookmarkItem(const BookmarkItem& rhs);
84 * This destructor overrides Tizen::Base::Object::~Object().
88 virtual ~BookmarkItem(void);
91 * Gets the title from the current bookmark item.
95 * @return The title of the current bookmark item
97 Tizen::Base::String GetTitle(void) const;
100 * Gets the URL from the current bookmark item.
104 * @return The URL of the current bookmark item @n
105 * If the item type is folder, this method will return an empty string.
108 Tizen::Base::String GetUrl(void) const;
111 * Gets the favicon image from the current bookmark item.
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_SYSTEM Either of the following conditions has occurred: @n
118 * - The method cannot proceed due to a severe system error. @n
119 * @remarks The specific error code can be accessed using the GetLastResult() method.
121 Tizen::Graphics::Bitmap* GetFaviconN(void) const;
124 * Gets the parent folder ID of the current bookmark item.
128 * @return The parent folder ID of the current bookmark item @n
129 * If the current bookmark item is the one in topmost level, this method will return ::ROOT_FOLDER_ID.
131 RecordId GetParentFolderId(void) const;
134 * Checks whether the type of the current bookmark item is folder or not.
138 * @return @c true if the type of the current bookmark item is folder, @n
141 bool IsFolder(void) const;
144 * Gets the hash value of the current instance.
148 * @return The hash value of the current instance
150 virtual int GetHashCode(void) const;
153 * Compares two instances of the %BookmarkItem class.
157 * @return @c true if the two instances match, or if and only if the two instances contain the same elements, @n
159 * @param[in] obj The object to compare with the current instance
160 * @see Tizen::Base::Object::Equals()
162 virtual bool Equals(const Tizen::Base::Object& obj) const;
165 * Copying of objects using this copy assignment operator is allowed.
169 * @param[in] rhs The instance of the %BookmarkItem class to assign from
171 BookmarkItem& operator =(const BookmarkItem& rhs);
175 // This default constructor is intentionally declared as private to implement the Singleton semantic
177 // @remarks This constructor is hidden.
182 _BookmarkItemImpl* __pBookmarkItemImpl;
184 friend class _BookmarkItemImpl;
186 friend class _WebBookmarkImpl;
190 #endif // _FWEB_BOOKMARK_ITEM_H_