3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
20 /*@file: IntHistoryPresentationModel.h
21 *@brief: This is the header file for HistoryPresentationModel class
25 #ifndef _INT_HISTORY_PRESENTATION_MODEL_H
26 #define _INT_HISTORY_PRESENTATION_MODEL_H
33 #include "IntHistoryData.h"
34 #include "IntPresentationModelBase.h"
50 * @class HistoryPresentationModel
51 * @brief This class declares functions which will manage Browser History
53 class HistoryPresentationModel
54 :public PresentationModelBase
58 * @brief The method used to get the already created instance of the HistoryPresentationModel
60 static HistoryPresentationModel* GetInstance(void);
63 * This function deletes all the histories.
65 * @return An error code
68 result ClearHistory(void);
71 * This function creates the list of History
73 * @return An error code
74 * @param nHistoryCount The no of History present
75 * @param historyList An ArrayList where the History will be stored
76 * @param maxCount is used for maximum most visited site else its value is default to -1
77 * @exception E_SUCCESS The method is successful
78 * @exception E_FAILURE The method is not successful as the list is not being created
79 * @remarks To work properly , the history count and and existing list should be passed
81 result CreateHistoryList(int nHistoryCount, Tizen::Base::Collection::ArrayList& historyList, int maxCount = -1);
84 * This function deletes particular history of history ID from the history table
86 * @return An error code
87 * @param historyId The historyId
88 * @exception E_SUCCESS The history is successfully deleted
89 * @exception E_FAILURE The history deletion is unsuccessful
91 result DeleteHistory(int historyId);
94 * This function deletes particular history of history URL.
96 * @return An error code
99 result DeleteHistory(Tizen::Base::String& historyUrl);
102 * This function deletes Multiple histories from the history table
104 * @return An error code
105 * @param pHistoryIdList The Arraylist of ids of history to be deleted
106 * @exception E_SUCCESS The history is successfully deleted
107 * @exception E_FAILURE The history deletion is unsuccessful
109 result DeleteMultipleHistory(Tizen::Base::Collection::ArrayList* pHistoryIdList);
112 * This function adds the history to the history table
114 * @return An error code
115 * @param history The history
116 * @exception E_SUCCESS The history is inserted successfully to the table
117 * @exception E_FAILURE The history is not inserted successfully
119 result SaveHistory(History& history);
122 * This function selects the history from the table
124 * @return An error code
125 * @param startIndex the OFFSET value
126 * @param limit The LIMIT till which the select statement will be executed
127 * @param historyList The arraylist where the selected history will be saved
129 result GetHistory( int startIndex, int limit, Tizen::Base::Collection::ArrayList& historyList);
132 * This function returns the no of history
134 * @return An error code
135 * @param count The no of History present will be saved in count.
137 result GetHistoryCount(int& count);
140 * This function returns the history count from the table on the basis of the time range
142 * @return An error code
143 * @param startTime the startTime
144 * @param endTime the end time
146 result GetHistoryCountWithTimeRange(Tizen::Base::DateTime& startTime, Tizen::Base::DateTime& endTime, int& count);
149 * This function selects the history from the table within given time range
151 * @return An error code
152 * @param startTime start value of time
153 * @param endTime end value of time
154 * @param startIndex the OFFSET value
155 * @param limit The LIMIT till which the select statement will be executed
156 * @param historyList The arraylist where the selected history will be saved
158 result GetHistoryWithTimeRange(Tizen::Base::DateTime& startTime, Tizen::Base::DateTime& endTime,int startIndex,int limit, Tizen::Base::Collection::ArrayList& pHistoryList);
161 * This function used to get most visited site in a arraylist
163 * @return An error code
164 * @param historyList The arraylist where the most visited sites will be saved.
166 result GetMostVisitedSites(Tizen::Base::Collection::ArrayList& historyList);
169 * This function returns the no of searched text history
171 * @return An error code
172 * @param count The no of History present will be saved in count.
173 * @param text text entered for search
175 result GetSearchHistoryCount(int& count, Tizen::Base::String& text);
178 * This function selects the searched history from the table
180 * @return An error code
181 * @param startIndex the OFFSET value
182 * @param limit The LIMIT till which the select statement will be executed
183 * @param text text entered for search
184 * @param historyList The arraylist where the selected history will be saved
186 result GetSearchHistory(int startIndex,int limit, Tizen::Base::Collection::ArrayList& historyList, Tizen::Base::String& text);
189 * This function used to given URL count
191 * @return An error code
192 * @param url URL to get its count
193 * @param count count of a URL
195 result GetUrlCount(const Tizen::Base::String& url, int& count);
200 * @brief The Default Constructor
202 HistoryPresentationModel(void);
205 * @brief The Default Destructor
207 ~HistoryPresentationModel(void);
212 HistoryPresentationModel(const HistoryPresentationModel& settingModelObj);
215 * assignment operator
218 HistoryPresentationModel& operator=(const HistoryPresentationModel& settingModelObj);
221 *@brief Initialize storage service
223 result Construct(void);
226 * @brief The method used to create the instance of the SettingsManager class
228 static void CreateInstance(void);
231 * @brief The method used to remove the already created instance of the SettingsManager
233 static void DestroyInstance(void);
236 * This function is used to generate file name
238 * @return filename name of a file
239 * @param No parameter
241 Tizen::Base::String GenerateFileName(void);
243 Tizen::Base::String GetStringFromDate(Tizen::Base::DateTime& date);
245 static HistoryPresentationModel* __pHistoryPresentationModel;
248 #endif //_INT_HISTORY_PRESENTATION_MODEL_H