1 /*
2  * GNOME Online Miners - crawls through your online content
3  * Copyright (c) 2011, 2012 Red Hat, Inc.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA.
19  *
20  * Author: Cosimo Cecchi <cosimoc@redhat.com>
21  *
22  */
23 
24 #ifndef __GOM_TRACKER_H__
25 #define __GOM_TRACKER_H__
26 
27 #include <gio/gio.h>
28 #include <libtracker-sparql/tracker-sparql.h>
29 
30 G_BEGIN_DECLS
31 
32 gchar *gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connection,
33                                                       GCancellable *cancellable,
34                                                       GError **error,
35                                                       gboolean *resource_exists,
36                                                       const gchar *graph,
37                                                       const gchar *identifier,
38                                                       const gchar *class,
39                                                       ...);
40 
41 gboolean gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection *connection,
42                                                                  GCancellable *cancellable,
43                                                                  GError **error,
44                                                                  const gchar *graph,
45                                                                  const gchar *resource,
46                                                                  const gchar *property_name,
47                                                                  const gchar *property_value);
48 
49 gboolean gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *connection,
50                                                    GCancellable *cancellable,
51                                                    GError **error,
52                                                    const gchar *graph,
53                                                    const gchar *resource,
54                                                    const gchar *property_name,
55                                                    const gchar *property_value);
56 
57 gboolean gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection,
58                                                         GCancellable *cancellable,
59                                                         GError **error,
60                                                         const gchar *resource,
61                                                         gboolean favorite);
62 
63 gchar* gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
64                                                   GCancellable *cancellable,
65                                                   GError **error,
66                                                   const gchar *email,
67                                                   const gchar *fullname);
68 
69 gchar *gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection,
70                                                     GCancellable *cancellable,
71                                                     GError **error,
72                                                     const gchar *make,
73                                                     const gchar *model);
74 
75 void gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
76                                     const gchar              *datasource_urn,
77                                     gboolean                  resource_exists,
78                                     const gchar              *identifier,
79                                     const gchar              *resource,
80                                     GCancellable             *cancellable,
81                                     GError                  **error);
82 gboolean gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
83                                    gint64                    new_mtime,
84                                    gboolean                  resource_exists,
85                                    const gchar              *identifier,
86                                    const gchar              *resource,
87                                    GCancellable             *cancellable,
88                                    GError                  **error);
89 
90 G_END_DECLS
91 
92 #endif /* __GOM_TRACKER_H__ */
93