aboutsummaryrefslogtreecommitdiffstats
path: root/lib/history/ephy-history-service-private.h
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-11-25 20:39:50 +0800
committerXan Lopez <xan@igalia.com>2012-03-07 04:49:42 +0800
commit374d66dd260b989f22eba25dad4fabc49da2d586 (patch)
treed32121ea4f1769a3a725c75f1cf01229cb533f95 /lib/history/ephy-history-service-private.h
parent77ee0fdf4c5383f2134608e741b73f51ef30f430 (diff)
downloadgsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar.gz
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar.bz2
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar.lz
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar.xz
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.tar.zst
gsoc2013-epiphany-374d66dd260b989f22eba25dad4fabc49da2d586.zip
Add EphyHistoryService and helper classes
EphyHistoryService provides a high-level API to store history information. It will processed by a worker thread using SQLite to provide a fast, responsive service to the main UI. Based on the code by Martin Robinson (mrobinson@igalia.com) and Claudio Saavedra (csaavedra@igalia.com).
Diffstat (limited to 'lib/history/ephy-history-service-private.h')
-rw-r--r--lib/history/ephy-history-service-private.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service-private.h b/lib/history/ephy-history-service-private.h
new file mode 100644
index 000000000..4cf88d4c0
--- /dev/null
+++ b/lib/history/ephy-history-service-private.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/*
+ * Copyright © 2011 Igalia S.L.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EPHY_HISTORY_SERVICE_PRIVATE_H
+#define EPHY_HISTORY_SERVICE_PRIVATE_H
+
+#include "ephy-sqlite-connection.h"
+
+struct _EphyHistoryServicePrivate {
+ char *history_filename;
+ EphySQLiteConnection *history_database;
+ GThread *history_thread;
+ GAsyncQueue *queue;
+ GMutex history_thread_mutex;
+ gboolean active;
+ gboolean scheduled_to_quit;
+ gboolean scheduled_to_commit;
+};
+
+void ephy_history_service_schedule_commit (EphyHistoryService *self);
+gboolean ephy_history_service_initialize_urls_table (EphyHistoryService *self);
+EphyHistoryURL * ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_string, EphyHistoryURL *url);
+void ephy_history_service_add_url_row (EphyHistoryService *self, EphyHistoryURL *url);
+void ephy_history_service_update_url_row (EphyHistoryService *self, EphyHistoryURL *url);
+GList* ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *query);
+void ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url);
+
+gboolean ephy_history_service_initialize_visits_table (EphyHistoryService *self);
+void ephy_history_service_add_visit_row (EphyHistoryService *self, EphyHistoryPageVisit *visit);
+GList * ephy_history_service_find_visit_rows (EphyHistoryService *self, EphyHistoryQuery *query);
+
+gboolean ephy_history_service_initialize_hosts_table (EphyHistoryService *self);
+void ephy_history_service_add_host_row (EphyHistoryService *self, EphyHistoryHost *host);
+void ephy_history_service_update_host_row (EphyHistoryService *self, EphyHistoryHost *host);
+EphyHistoryHost * ephy_history_service_get_host_row (EphyHistoryService *self, const gchar *url_string, EphyHistoryHost *host);
+GList * ephy_history_service_get_all_hosts (EphyHistoryService *self);
+EphyHistoryHost * ephy_history_service_get_host_row_from_url (EphyHistoryService *self, const gchar *url);
+
+#endif /* EPHY_HISTORY_SERVICE_PRIVATE_H */