gtkbookmarksmanager.h 3.19 KB
Newer Older
1 2 3 4 5 6 7 8 9
/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
/* GTK - The GIMP Toolkit
 * gtkbookmarksmanager.h: Utilities to manage and monitor ~/.gtk-bookmarks
 * Copyright (C) 2003, Red Hat, Inc.
 * Copyright (C) 2007-2008 Carlos Garnacho
 * Copyright (C) 2011 Suse
 *
 * This program is free software; you can redistribute it and/or modify
 * 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 12 13 14 15
 * License, or (at your option) any later version.
 *
 * This program 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
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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
 *
 * Authors: Federico Mena Quintero <federico@gnome.org>
 */

#ifndef __GTK_BOOKMARKS_MANAGER_H__
#define __GTK_BOOKMARKS_MANAGER_H__

#include <gio/gio.h>

typedef void (* GtkBookmarksChangedFunc) (gpointer data);

typedef struct
{
  /* This list contains GtkBookmark structs */
  GSList *bookmarks;

  GFileMonitor *bookmarks_monitor;
37
  gulong bookmarks_monitor_changed_id;
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

  gpointer changed_func_data;
  GtkBookmarksChangedFunc changed_func;
} GtkBookmarksManager;

typedef struct
{
  GFile *file;
  gchar *label;
} GtkBookmark;

GtkBookmarksManager *_gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func,
						 gpointer                changed_func_data);


void _gtk_bookmarks_manager_free (GtkBookmarksManager *manager);

GSList *_gtk_bookmarks_manager_list_bookmarks (GtkBookmarksManager *manager);

gboolean _gtk_bookmarks_manager_insert_bookmark (GtkBookmarksManager *manager,
						 GFile               *file,
						 gint                 position,
						 GError             **error);

gboolean _gtk_bookmarks_manager_remove_bookmark (GtkBookmarksManager *manager,
						 GFile               *file,
						 GError             **error);

66 67 68 69 70
gboolean _gtk_bookmarks_manager_reorder_bookmark (GtkBookmarksManager *manager,
						  GFile               *file,
						  gint                 new_position,
						  GError             **error);

71 72 73
gboolean _gtk_bookmarks_manager_has_bookmark (GtkBookmarksManager *manager,
                                              GFile               *file);

74 75 76
gchar * _gtk_bookmarks_manager_get_bookmark_label (GtkBookmarksManager *manager,
						   GFile               *file);

77 78 79 80
gboolean _gtk_bookmarks_manager_set_bookmark_label (GtkBookmarksManager *manager,
						    GFile               *file,
						    const gchar         *label,
						    GError             **error);
81

82 83 84 85 86 87 88 89
gboolean _gtk_bookmarks_manager_get_xdg_type (GtkBookmarksManager *manager,
                                              GFile               *file,
                                              GUserDirectory      *directory);
gboolean _gtk_bookmarks_manager_get_is_builtin (GtkBookmarksManager *manager,
                                                GFile               *file);

gboolean _gtk_bookmarks_manager_get_is_xdg_dir_builtin (GUserDirectory xdg_type);

90
#endif /* __GTK_BOOKMARKS_MANAGER_H__ */