diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-07-10 23:58:21 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-07-11 19:15:07 +0200 |
commit | 1b312602920959649befce085fe5365b38370196 (patch) | |
tree | af3cb8e7132025347cb0d60b88604d2f9702e344 /src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi | |
parent | c36addc963768994d569623a1ddaeeff051720d5 (diff) | |
download | tracker-1b312602920959649befce085fe5365b38370196.tar.gz |
libtracker-sparql: Add vapi file for the C portions
Just like we do with girs, merge together the vapi for the C portions and
the generated vapi for the vala bits. This allows using
TrackerNamespaceManager and TrackerResource from vala code.
Diffstat (limited to 'src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi')
-rw-r--r-- | src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi b/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi new file mode 100644 index 000000000..4dc894a27 --- /dev/null +++ b/src/libtracker-sparql/libtracker-sparql-intermediate-c.vapi @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2017 - Red Hat Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +namespace Tracker { + [CCode (cheader_filename = "libtracker-sparql/tracker-namespace-manager.h")] + public class NamespaceManager : GLib.Object { + public NamespaceManager (); + public void add_prefix (string prefix, string namespace); + public bool has_prefix (string prefix); + public string lookup_prefix (string prefix); + public string expand_uri (string compact_uri); + + public static NamespaceManager get_default (); + } + + [CCode (cheader_filename = "libtracker-sparql/tracker-resource.h")] + public class Resource : GLib.Object { + public Resource (string identifier); + + public void set_value (string predicate, GLib.Value value); + public void set_boolean (string predicate, bool object); + public void set_double (string predicate, double object); + public void set_int (string predicate, int object); + public void set_int64 (string predicate, int64 object); + public void set_relation (string predicate, Resource object); + public void set_string (string predicate, string object); + public void set_uri (string predicate, string object); + + public void add_value (string predicate, GLib.Value value); + public void add_boolean (string predicate, bool object); + public void add_double (string predicate, double object); + public void add_int (string predicate, int object); + public void add_int64 (string predicate, int64 object); + public void add_relation (string predicate, Resource object); + public void add_string (string predicate, string object); + public void add_uri (string predicate, string object); + + public GLib.List<GLib.Value> get_values (string predicate); + + public bool get_first_boolean (string predicate); + public double get_first_double (string predicate); + public int get_first_int (string predicate); + public int64 get_first_int64 (string predicate); + public unowned Resource get_first_relation (string predicate); + public string get_first_string (string predicate); + public string get_first_uri (string predicate); + + public string get_identifier (); + public void set_identifier (string identifier); + + public int identifier_compare_func (string identifier); + + public string print_turtle (NamespaceManager? namespace_manager); + public string print_sparql_update (NamespaceManager? namespace_manager, string graph); + } + + [CCode (cprefix = "TRACKER_NOTIFIER_FLAG_", cheader_filename = "libtracker-sparql/tracker-notifier.h")] + public enum NotifierFlags { + QUERY_URN, + QUERY_LOCATION, + NOTIFY_UNEXTRACTED + } + + public enum NotifierEventType { + QUERY_URN, + QUERY_LOCATION, + NOTIFY_UNEXTRACTED + } + + [CCode (cheader_filename = "libtracker-sparql/tracker-notifier.h")] + public class Notifier : GLib.Object, GLib.Initable { + public Notifier (string[] classes, NotifierFlags flags, GLib.Cancellable? cancellable) throws GLib.Error; + + public class NotifierEvent { + public enum Type { + CREATE, + DELETE, + UPDATE + } + + public int64 get_id (); + public string get_type (); + public string get_urn (); + public string get_location (); + } + } +} |