Init Tizen 2.2.1
[framework/osp/web.git] / inc / FWebBookmarkItem.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FWebBookmarkItem.h
20  * @brief               This is the header file for the %BookmarkItem class.
21  *
22  * This header file contains the declarations of the %BookmarkItem class.
23  */
24
25 #ifndef _FWEB_BOOKMARK_ITEM_H_
26 #define _FWEB_BOOKMARK_ITEM_H_
27
28 #include <FBaseString.h>
29
30 namespace Tizen { namespace Graphics
31 {
32 class Bitmap;
33 }} // Tizen::Graphics
34
35 namespace Tizen { namespace Web
36 {
37 class _BookmarkItemImpl;
38
39 /**
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.
42  * 
43  *
44  * @since               2.1
45  */
46 typedef int RecordId;
47
48 /**
49  * The root folder ID. @n
50  * In fact, it is a symbolic value because the root folder record does not exist physically.
51  *
52  * @since               2.1
53  */
54 const RecordId ROOT_FOLDER_ID = -1;
55
56 /**
57 * @class                BookmarkItem
58 * @brief                This class is used for accessing a bookmark item stored in the %WebBookmark class.
59 *
60 * @since                2.1
61 *
62 * @final                This class is not intended for extension.
63 *
64 * The %BookmarkItem class provides access to the WebBookmark class.
65 * Each item contains the title, the URL of a page, the item type, and the parent folder ID.
66 */
67 class _OSP_EXPORT_ BookmarkItem
68         : public Tizen::Base::Object
69 {
70 public:
71
72         /**
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.
76          *
77          * @since               2.1
78          *
79          * @param[in] rhs An instance of %BookmarkItem to copy
80          */
81         BookmarkItem(const BookmarkItem& rhs);
82
83         /**
84          * This destructor overrides Tizen::Base::Object::~Object().
85          *
86          * @since               2.1
87          */
88         virtual ~BookmarkItem(void);
89
90         /**
91          * Gets the title from the current bookmark item.
92          *
93          * @since               2.1
94          *
95          * @return              The title of the current bookmark item
96          */
97         Tizen::Base::String GetTitle(void) const;
98
99         /**
100          * Gets the URL from the current bookmark item.
101          *
102          * @since               2.1
103          *
104          * @return              The URL of the current bookmark item @n
105          *                              If the item type is folder, this method returns an empty string.
106          * @see IsFolder()
107          */
108         Tizen::Base::String GetUrl(void) const;
109
110         /**
111          * Gets the favicon image from the current bookmark item.
112          *       
113          * @since               2.1
114          *
115          * @return              The image
116          * @exception   E_SUCCESS       The method is successful.
117          * @exception   E_SYSTEM        The method cannot proceed due to a severe system error.
118          * @remarks     The specific error code can be accessed using the GetLastResult() method.
119          */
120         Tizen::Graphics::Bitmap* GetFaviconN(void) const;
121
122         /**
123          * Gets the parent folder ID of the current bookmark item. 
124          *
125          * @since               2.1
126          *
127          * @return              The parent folder ID of the current bookmark item @n
128          *                              If the current bookmark item is the one at the topmost level, this method returns ::ROOT_FOLDER_ID.
129          */
130         RecordId GetParentFolderId(void) const;
131
132         /**
133          * Checks whether the type of the current bookmark item is folder or not.
134          *
135          * @since               2.1
136          *
137          * @return              @c true if the type of the current bookmark item is folder, @n
138          *                              else @c false
139          */
140         bool IsFolder(void) const;
141
142         /**
143          * Gets the hash value of the current instance.
144          *
145          * @since               2.1
146          *
147          * @return              The hash value of the current instance
148          */
149         virtual int GetHashCode(void) const;
150
151         /**
152          * Compares two instances of the %BookmarkItem class.
153          *
154          * @since               2.1
155          *
156          * @return              @c true if the two instances match, or if and only if the two instances contain the same elements, @n
157          *                              else @c false
158          * @param[in]   obj                             The object to compare with the current instance
159          * @see Tizen::Base::Object::Equals()
160          */
161         virtual bool Equals(const Tizen::Base::Object& obj) const;
162
163         /**
164          * Copying of objects using this copy assignment operator is allowed. 
165          *
166          * @since               2.1
167          *
168          * @param[in]   rhs                     An instance of the %BookmarkItem class to assign
169          */
170         BookmarkItem& operator =(const BookmarkItem& rhs);
171
172 private:
173         //
174         // This default constructor is intentionally declared as private to implement the Singleton semantic
175         //
176         // @remarks     This constructor is hidden.
177         //
178         BookmarkItem(void);
179
180 private:
181         _BookmarkItemImpl* __pBookmarkItemImpl;
182
183         friend class _BookmarkItemImpl;
184
185         friend class _WebBookmarkImpl;
186 };
187
188 }}
189 #endif // _FWEB_BOOKMARK_ITEM_H_