merge with master
[framework/osp/web.git] / inc / FWebWebHistory.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                FWebWebHistory.h
20  * @brief               This is the header file for the %WebHistory class.
21  * @since               2.0
22  *
23  * This header file contains the declarations of the %WebHistory class.
24  */
25 #ifndef _FWEB_WEB_HISTORY_H_
26 #define _FWEB_WEB_HISTORY_H_
27
28 #include <FBaseObject.h>
29
30 namespace Tizen { namespace Web
31 {
32 class HistoryItem;
33 class _WebHistoryImpl;
34 }} // Tizen::Web
35
36 namespace Tizen { namespace Web
37 {
38
39 /**
40  * @class               WebHistory
41  * @brief               This class contains the pages visited by users in a browser.
42  *
43  * @since               2.0
44  *
45  * The %WebHistory class is used to retrieve the pages visited by users in a browser. The visited pages are represented by the HistoryItem class.
46  * The WEB_PRIVACY privilege is required to use this class.
47  *
48  */
49 class _OSP_EXPORT_ WebHistory
50         : public Tizen::Base::Object
51 {
52 public:
53         /**
54          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
55          *
56          * @since               2.0
57          */
58         WebHistory(void);
59
60         /**
61          * This destructor overrides Tizen::Base::Object::~Object().
62          *
63          * @since               2.0
64          */
65         virtual ~WebHistory(void);
66
67         /**
68          * Initializes this instance of %WebHistory.
69          *
70          * @since               2.0
71          *
72          * @privlevel   public
73          * @privilege   http://tizen.org/privilege/web.privacy
74          *
75          * @return              An error code
76          * @exception   E_SUCCESS                       The method is successful.
77          * @exception   E_SYSTEM                        A system error has occurred.
78          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
79          */
80         result Construct(void);
81
82         /**
83          * Gets the history item pointed to by the specified @c index.
84          *
85          * @since               2.0
86          *
87          * @privlevel   public
88          * @privilege   http://tizen.org/privilege/web.privacy
89          *
90          * @return              The history item at the specified @c index
91          * @param[in]   index                   The index of an element @n
92          *                                                              The value of the index must be greater than or equal to @c 0.
93          * @exception   E_SUCCESS                       The method is successful.
94          * @exception   E_OUT_OF_RANGE          The specified @c index is out of range.
95          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
96          * @remarks             The specific error code can be accessed using the GetLastResult() method.
97          */
98         const HistoryItem* GetItemAt(int index) const;
99
100         /**
101          * Gets the total number of items.
102          *
103          * @since               2.0
104          *
105          * @privlevel   public
106          * @privilege   http://tizen.org/privilege/web.privacy
107          *
108          * @return              The total number of items
109          * @exception   E_SUCCESS                       The method is successful.
110          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
111          * @remarks             The specific error code can be accessed using the GetLastResult() method.
112          */
113         int GetItemCount(void) const;
114
115 private:
116         //
117         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
118         //
119         // @param[in]   item                    The instance of the %WebHistory class to copy from
120         // @remarks             This constructor is hidden.
121         //
122         WebHistory(const WebHistory& item);
123
124         //
125         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
126         //
127         // @param[in]   item                    The instance of the %WebHistory class to assign from
128         // @remarks             This operator is hidden.
129         //
130         WebHistory& operator =(const WebHistory& item);
131
132 private:
133         _WebHistoryImpl* __pWebHistoryImpl;
134
135         friend class _WebHistoryImpl;
136 }; // WebHistory
137
138 }} // Tizen::Web
139 #endif // _FWEB_WEB_HISTORY_H_