1 | /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */ |
2 | /* GTK - The GIMP Toolkit |
3 | * gtkbookmarksmanager.h: Utilities to manage and monitor ~/.gtk-bookmarks |
4 | * Copyright (C) 2003, Red Hat, Inc. |
5 | * Copyright (C) 2007-2008 Carlos Garnacho |
6 | * Copyright (C) 2011 Suse |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU Lesser General Public License as |
10 | * published by the Free Software Foundation; either version 2.1 of the |
11 | * License, or (at your option) any later version. |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU Lesser General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU Lesser General Public License |
19 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
20 | * |
21 | * Authors: Federico Mena Quintero <federico@gnome.org> |
22 | */ |
23 | |
24 | #ifndef __GTK_BOOKMARKS_MANAGER_H__ |
25 | #define __GTK_BOOKMARKS_MANAGER_H__ |
26 | |
27 | #include <gio/gio.h> |
28 | |
29 | typedef void (* GtkBookmarksChangedFunc) (gpointer data); |
30 | |
31 | typedef struct |
32 | { |
33 | /* This list contains GtkBookmark structs */ |
34 | GSList *bookmarks; |
35 | |
36 | GFileMonitor *bookmarks_monitor; |
37 | gulong bookmarks_monitor_changed_id; |
38 | |
39 | gpointer changed_func_data; |
40 | GtkBookmarksChangedFunc changed_func; |
41 | |
42 | GCancellable *cancellable; |
43 | } GtkBookmarksManager; |
44 | |
45 | typedef struct |
46 | { |
47 | GFile *file; |
48 | char *label; |
49 | } GtkBookmark; |
50 | |
51 | GtkBookmarksManager *_gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, |
52 | gpointer changed_func_data); |
53 | |
54 | |
55 | void _gtk_bookmarks_manager_free (GtkBookmarksManager *manager); |
56 | |
57 | GSList *_gtk_bookmarks_manager_list_bookmarks (GtkBookmarksManager *manager); |
58 | |
59 | gboolean _gtk_bookmarks_manager_insert_bookmark (GtkBookmarksManager *manager, |
60 | GFile *file, |
61 | int position, |
62 | GError **error); |
63 | |
64 | gboolean _gtk_bookmarks_manager_remove_bookmark (GtkBookmarksManager *manager, |
65 | GFile *file, |
66 | GError **error); |
67 | |
68 | gboolean _gtk_bookmarks_manager_reorder_bookmark (GtkBookmarksManager *manager, |
69 | GFile *file, |
70 | int new_position, |
71 | GError **error); |
72 | |
73 | gboolean _gtk_bookmarks_manager_has_bookmark (GtkBookmarksManager *manager, |
74 | GFile *file); |
75 | |
76 | char * _gtk_bookmarks_manager_get_bookmark_label (GtkBookmarksManager *manager, |
77 | GFile *file); |
78 | |
79 | gboolean _gtk_bookmarks_manager_set_bookmark_label (GtkBookmarksManager *manager, |
80 | GFile *file, |
81 | const char *label, |
82 | GError **error); |
83 | |
84 | gboolean _gtk_bookmarks_manager_get_is_builtin (GtkBookmarksManager *manager, |
85 | GFile *file); |
86 | |
87 | gboolean _gtk_bookmarks_manager_get_is_xdg_dir_builtin (GUserDirectory xdg_type); |
88 | |
89 | #endif /* __GTK_BOOKMARKS_MANAGER_H__ */ |
90 | |