int freq;
bp_history_adaptor_get_frequency(ids[i], &freq);
bp_history_adaptor_set_frequency(ids[i], freq + 1);
+ bp_history_adaptor_set_date_visited(ids[i],-1);
return true;
}
}
}
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryAll()
+{
+ return getHistoryItems(BP_HISTORY_DATE_ALL);
+}
+
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryToday()
+{
+ return getHistoryItems(BP_HISTORY_DATE_TODAY);
+}
+
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryYesterday()
+{
+ return getHistoryItems(BP_HISTORY_DATE_YESTERDAY);
+}
+
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryLastWeek()
+{
+ return getHistoryItems(BP_HISTORY_DATE_LAST_7_DAYS);
+}
+
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryLastMonth()
+{
+ return getHistoryItems(BP_HISTORY_DATE_LAST_MONTH);
+}
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryOlder()
+{
+ return getHistoryItems(BP_HISTORY_DATE_OLDER);
+}
std::shared_ptr<HistoryItemVector> HistoryService::getMostVisitedHistoryItems()
{
std::shared_ptr<HistoryItem> HistoryService::getHistoryItem(int * ids, int idNumber)
{
- bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_CREATED);
+ bp_history_offset offset = (BP_HISTORY_O_URL | BP_HISTORY_O_TITLE | BP_HISTORY_O_FAVICON | BP_HISTORY_O_DATE_VISITED);
bp_history_info_fmt history_info;
bp_history_adaptor_get_info(ids[idNumber], offset, &history_info);
conds.offset = -1; //the first row's index
conds.order_offset = BP_HISTORY_O_DATE_VISITED; // property to sort
conds.ordering = 1; //way of ordering 0 asc 1 desc
- conds.period_offset = BP_HISTORY_O_DATE_CREATED;
+ conds.period_offset = BP_HISTORY_O_DATE_VISITED;
conds.period_type = BP_HISTORY_DATE_TODAY;
int ret = bp_history_adaptor_get_cond_ids_p(&ids , &count, &conds, 0, nullptr, 0);
return getHistoryItem(ids);
}
-std::shared_ptr<HistoryItemVector> HistoryService::getHistoryItems(bp_history_date_defs period, int maxItems)
+std::shared_ptr<HistoryItemVector> HistoryService::getHistoryItems(bp_history_date_defs period)
{
std::shared_ptr<HistoryItemVector> ret_history_list(new HistoryItemVector);
conds.offset = -1; //the first row's index
conds.order_offset = BP_HISTORY_O_DATE_VISITED; // property to sort
conds.ordering = 1; //way of ordering 0 asc 1 desc
- conds.period_offset = BP_HISTORY_O_DATE_CREATED;
+ conds.period_offset = BP_HISTORY_O_DATE_VISITED;
conds.period_type = period;
int ret = bp_history_adaptor_get_cond_ids_p(&ids ,&count, &conds, 0, nullptr, 0);
/**
* @throws HistoryException on error
*/
- std::shared_ptr<HistoryItemVector> getHistoryItems(bp_history_date_defs period = BP_HISTORY_DATE_TODAY, int maxItems = 50);
+ std::shared_ptr<HistoryItemVector> getHistoryAll();
+ std::shared_ptr<HistoryItemVector> getHistoryToday();
+ std::shared_ptr<HistoryItemVector> getHistoryYesterday();
+ std::shared_ptr<HistoryItemVector> getHistoryLastWeek();
+ std::shared_ptr<HistoryItemVector> getHistoryLastMonth();
+ std::shared_ptr<HistoryItemVector> getHistoryOlder();
std::shared_ptr<HistoryItem> getCurrentTab();
std::shared_ptr<HistoryItemVector> getMostVisitedHistoryItems();
void initDatabaseBookmark(const std::string & db_str);
std::shared_ptr<HistoryItem> getHistoryItem(int* ids, int idNumber = 0);
+ std::shared_ptr<HistoryItemVector> getHistoryItems(bp_history_date_defs period = BP_HISTORY_DATE_TODAY);
std::shared_ptr<tizen_browser::services::StorageService> getStorageManager();
};
return m_favoriteService->getBookmarks(folder_id);
}
-std::shared_ptr<services::HistoryItemVector> SimpleUI::getHistory()
+std::shared_ptr<services::HistoryItemVector> SimpleUI::getMostVisitedItems()
{
return m_historyService->getMostVisitedHistoryItems();
}
+std::shared_ptr<services::HistoryItemVector> SimpleUI::getHistory()
+{
+ return m_historyService->getHistoryToday();
+}
+
std::vector<std::shared_ptr<tizen_browser::services::BookmarkItem> > SimpleUI::getBookmarkFolders(int folder_id)
{
BROWSER_LOGD("[%s]", __func__);
m_mainUI->clearHistoryGenlist();
m_mainUI->clearBookmarkGengrid();
- m_mainUI->addHistoryItems(getHistory());
+ m_mainUI->addHistoryItems(getMostVisitedItems());
m_mainUI->showHistory();
}
M_ASSERT(m_mainUI);
hideWebView();
m_mainUI->show(m_window.get());
- m_mainUI->addHistoryItems(getHistory());
+ m_mainUI->addHistoryItems(getMostVisitedItems());
m_mainUI->addBookmarkItems(getBookmarks());
m_isHomePageActive = true;
}