1 /* gbookmarkfile.h: parsing and building desktop bookmarks
3 * Copyright (C) 2005-2006 Emmanuele Bassi
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 #ifndef __G_BOOKMARK_FILE_H__
21 #define __G_BOOKMARK_FILE_H__
23 #include <glib/gerror.h>
30 #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
34 G_BOOKMARK_FILE_ERROR_INVALID_URI,
35 G_BOOKMARK_FILE_ERROR_INVALID_VALUE,
36 G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
37 G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
38 G_BOOKMARK_FILE_ERROR_READ,
39 G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
40 G_BOOKMARK_FILE_ERROR_WRITE,
41 G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
44 GQuark g_bookmark_file_error_quark (void);
49 typedef struct _GBookmarkFile GBookmarkFile;
51 GBookmarkFile *g_bookmark_file_new (void);
52 void g_bookmark_file_free (GBookmarkFile *bookmark);
54 gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark,
55 const gchar *filename,
57 gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark,
61 gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark,
65 gchar * g_bookmark_file_to_data (GBookmarkFile *bookmark,
67 GError **error) G_GNUC_MALLOC;
68 gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark,
69 const gchar *filename,
72 void g_bookmark_file_set_title (GBookmarkFile *bookmark,
75 gchar * g_bookmark_file_get_title (GBookmarkFile *bookmark,
77 GError **error) G_GNUC_MALLOC;
78 void g_bookmark_file_set_description (GBookmarkFile *bookmark,
80 const gchar *description);
81 gchar * g_bookmark_file_get_description (GBookmarkFile *bookmark,
83 GError **error) G_GNUC_MALLOC;
84 void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
86 const gchar *mime_type);
87 gchar * g_bookmark_file_get_mime_type (GBookmarkFile *bookmark,
89 GError **error) G_GNUC_MALLOC;
90 void g_bookmark_file_set_groups (GBookmarkFile *bookmark,
94 void g_bookmark_file_add_group (GBookmarkFile *bookmark,
97 gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark,
101 gchar ** g_bookmark_file_get_groups (GBookmarkFile *bookmark,
104 GError **error) G_GNUC_MALLOC;
105 void g_bookmark_file_add_application (GBookmarkFile *bookmark,
109 gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark,
113 gchar ** g_bookmark_file_get_applications (GBookmarkFile *bookmark,
116 GError **error) G_GNUC_MALLOC;
117 gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
124 gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
131 void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
133 gboolean is_private);
134 gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark,
137 void g_bookmark_file_set_icon (GBookmarkFile *bookmark,
140 const gchar *mime_type);
141 gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
146 void g_bookmark_file_set_added (GBookmarkFile *bookmark,
149 time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
152 void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
155 time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
158 void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
161 time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
164 gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
166 gint g_bookmark_file_get_size (GBookmarkFile *bookmark);
167 gchar ** g_bookmark_file_get_uris (GBookmarkFile *bookmark,
168 gsize *length) G_GNUC_MALLOC;
169 gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark,
173 gboolean g_bookmark_file_remove_application (GBookmarkFile *bookmark,
177 gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark,
180 gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark,
181 const gchar *old_uri,
182 const gchar *new_uri,
187 #endif /* __G_BOOKMARK_FILE_H__ */