[tracker/gdbus: 6/92] libtracker-data: Add more bindings to the VAPI



commit 8f668fe11cf2ecf7ed794d02b12555864a830113
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jan 12 11:46:36 2011 +0100

    libtracker-data: Add more bindings to the VAPI

 src/libtracker-data/libtracker-data.vapi |   63 +++++++++++++++++++++++++++---
 1 files changed, 57 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index 27955a0..d5bba5a 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -85,14 +85,38 @@ namespace Tracker {
 		public abstract DBCursor start_sparql_cursor (PropertyType[] types, string[] variable_names, bool threadsafe) throws DBInterfaceError;
 	}
 
+	[CCode (cheader_filename = "libtracker-data/tracker-db-config.h")]
+	public class DBConfig : ConfigFile {
+		public DBConfig ();
+		public bool save ();
+		public int journal_chunk_size { get; set; }
+		public string journal_rotate_destination { get; set; }
+	}
+
+	[CCode (cheader_filename = "libtracker-data/tracker-db-config.h")]
+	namespace DBJournal {
+		public void set_rotating (bool do_rotating, size_t chunk_size, string? rotate_to);
+	}
+
 	[CCode (cheader_filename = "libtracker-data/tracker-class.h")]
 	public class Class : GLib.Object {
 		public string name { get; set; }
 		public string uri { get; set; }
+		public int count { get; set; }
 		[CCode (array_length = false, array_null_terminated = true)]
 		public unowned Class[] get_super_classes ();
+		public void transact_events ();
+
+		public bool has_insert_events ();
+		public bool has_delete_events ();
+		public void foreach_delete_event (EventsForeach func);
+		public void foreach_insert_event (EventsForeach func);
+		public void reset_ready_events ();
 	}
 
+	[CCode (cheader_filename = "libtracker-data/tracker-class.h")]
+	public delegate void EventsForeach (int graph_id, int subject_id, int pred_id, int object_id);
+
 	[CCode (cheader_filename = "libtracker-data/tracker-namespace.h")]
 	public class Namespace : GLib.Object {
 		public string prefix { get; set; }
@@ -134,20 +158,45 @@ namespace Tracker {
 		public unowned Property[] get_properties ();
 	}
 
-	[CCode (cheader_filename = "libtracker-data/tracker-data-query.h,libtracker-data/tracker-data-update.h")]
+	public delegate void StatementCallback (int graph_id, string? graph, int subject_id, string subject, int predicate_id, int object_id, string object, GLib.PtrArray rdf_types);
+	public delegate void CommitCallback (bool start_timer);
+
+	[CCode (cheader_filename = "libtracker-data/tracker-data-query.h,libtracker-data/tracker-data-update.h,libtracker-data/tracker-data-backup.h")]
 	namespace Data {
 		public int query_resource_id (string uri);
+		public DBResultSet query_sparql (string query) throws Sparql.Error;
+		public DBCursor query_sparql_cursor (string query) throws Sparql.Error;
 		public void begin_db_transaction ();
 		public void commit_db_transaction ();
 		public void begin_transaction () throws DBInterfaceError;
 		public void commit_transaction () throws DBInterfaceError;
 		public void rollback_transaction ();
-		public void delete_statement (string graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
-		public void insert_statement (string graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
-		public void insert_statement_with_uri (string graph, string subject, string predicate, string object) throws Sparql.Error;
-		public void insert_statement_with_string (string graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
+		public void update_sparql (string update) throws Sparql.Error;
+		public GLib.GenericArray<GLib.GenericArray<GLib.HashTable<string,string>>> update_sparql_blank (string update) throws Sparql.Error;
+		public void load_turtle_file (GLib.File file) throws Sparql.Error;
+		public void notify_transaction (bool start_timer);
+		public void delete_statement (string? graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
+		public void insert_statement (string? graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
+		public void insert_statement_with_uri (string? graph, string subject, string predicate, string object) throws Sparql.Error;
+		public void insert_statement_with_string (string? graph, string subject, string predicate, string object) throws Sparql.Error, DateError;
 		public void update_buffer_flush () throws DBInterfaceError;
 		public void update_buffer_might_flush () throws DBInterfaceError;
+		public void sync ();
+
+		public void add_insert_statement_callback (StatementCallback callback);
+		public void add_delete_statement_callback (StatementCallback callback);
+		public void add_commit_statement_callback (CommitCallback callback);
+		public void add_rollback_statement_callback (CommitCallback callback);
+		public void remove_insert_statement_callback (StatementCallback callback);
+		public void remove_delete_statement_callback (StatementCallback callback);
+		public void remove_commit_statement_callback (CommitCallback callback);
+		public void remove_rollback_statement_callback (CommitCallback callback);
+
+		[CCode (cheader_filename = "libtracker-data/tracker-data-backup.h")]
+		public delegate void BackupFinished (GLib.Error error);
+
+		public void backup_save (GLib.File destination, owned BackupFinished callback);
+		public void backup_restore (GLib.File journal, owned BackupFinished callback, [CCode (array_length = false)] string[]? test_schema, BusyCallback busy_callback);
 	}
 
 	[CCode (cheader_filename = "libtracker-data/tracker-data-manager.h")]
@@ -158,5 +207,7 @@ namespace Tracker {
 
 	[CCode (cheader_filename = "libtracker-data/tracker-db-interface-sqlite.h")]
 	public const string COLLATION_NAME;
-}
 
+	[CCode (cheader_filename = "libtracker-data/tracker-db-dbus.h")]
+	public string[] dbus_query_result_to_strv (DBResultSet result_set, int column);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]