1 /* biji-tracker.h
2  * Copyright (C) Pierre-Yves LUYTEN 2012,2013 <py@luyten.fr>
3  *
4  * bijiben is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * bijiben is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 
19 #pragma once
20 
21 #include <gtk/gtk.h>
22 #include <tracker-sparql.h>
23 
24 #include "libbiji.h"
25 #include "biji-info-set.h"
26 
27 
28 /* All possible query return
29  * Free the containers for list & hash<BijiInfoSets> */
30 
31 
32 typedef void       (*BijiBoolCallback)          (gboolean result, gpointer user_data);
33 
34 
35 typedef void       (*BijiItemCallback)          (BijiItem *item, gpointer user_data);
36 
37 
38 typedef void       (*BijiItemsListCallback)     (GList *items, gpointer user_data);
39 
40 
41 typedef void       (*BijiInfoSetsHCallback)     (GHashTable *info_sets, gpointer user_data);
42 
43 
44 /* CALLER IS RESPONSIBLE FOR FREEING INFO SET */
45 
46 typedef void       (*BijiInfoCallback)          (BijiInfoSet *info, gpointer user_data);
47 
48 
49 
50 void        biji_get_items_with_notebook_async       (BijiManager *manager,
51                                                         const gchar *needle,
52                                                         BijiItemsListCallback cb,
53                                                         gpointer user_data);
54 
55 
56 void        biji_get_items_matching_async              (BijiManager *manager,
57                                                         BijiItemsGroup group,
58                                                         gchar *needle,
59                                                         BijiItemsListCallback cb,
60                                                         gpointer user_data);
61 
62 
63 
64 void        biji_get_all_notebooks_async             (BijiManager *manager,
65                                                         BijiInfoSetsHCallback cb,
66                                                         gpointer user_data);
67 
68 
69 
70 void        biji_create_new_notebook_async           (BijiManager *manager,
71                                                         const gchar *tag,
72                                                         BijiItemCallback afterward,
73                                                         gpointer user_data);
74 
75 
76 
77 void        biji_remove_notebook_from_tracker        (BijiManager *manager,
78                                                         const gchar *urn);
79 
80 
81 
82 
83 void        biji_push_existing_notebook_to_note      (BijiNoteObj      *note,
84                                                         gchar            *title,
85                                                         BijiBoolCallback  bool_cb,
86                                                         gpointer          user_data);
87 
88 
89 
90 void        biji_remove_notebook_from_note           (BijiNoteObj      *note,
91                                                         BijiItem         *coll,
92                                                         BijiBoolCallback  bool_cb,
93                                                         gpointer          user_data);
94 
95 
96 
97 void        biji_note_delete_from_tracker              (BijiNoteObj *note);
98 
99 
100 void        biji_tracker_trash_resource               (BijiManager *manager,
101                                                         gchar *tracker_urn);
102 
103 
104 void        biji_tracker_ensure_resource_from_info    (BijiManager     *manager,
105                                                         BijiInfoSet *info);
106 
107 
108 void        biji_tracker_ensure_datasource             (BijiManager *manager,
109                                                         const gchar *datasource_id,
110                                                         const gchar *identifier,
111                                                         BijiBoolCallback cb,
112                                                         gpointer user_data);
113 
114 
115 void        biji_tracker_check_for_info                (BijiManager *manager,
116                                                         gchar *url,
117                                                         gint64 mtime,
118                                                         BijiInfoCallback callback,
119                                                         gpointer user_data);
120