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 #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
21 #error "Only <glib.h> can be included directly."
24 #ifndef __G_BOOKMARK_FILE_H__
25 #define __G_BOOKMARK_FILE_H__
27 #include <glib/gerror.h>
34 #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
38 G_BOOKMARK_FILE_ERROR_INVALID_URI
,
39 G_BOOKMARK_FILE_ERROR_INVALID_VALUE
,
40 G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED
,
41 G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND
,
42 G_BOOKMARK_FILE_ERROR_READ
,
43 G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING
,
44 G_BOOKMARK_FILE_ERROR_WRITE
,
45 G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
48 GQuark
g_bookmark_file_error_quark (void);
53 typedef struct _GBookmarkFile GBookmarkFile
;
55 GBookmarkFile
*g_bookmark_file_new (void);
56 void g_bookmark_file_free (GBookmarkFile
*bookmark
);
58 gboolean
g_bookmark_file_load_from_file (GBookmarkFile
*bookmark
,
59 const gchar
*filename
,
61 gboolean
g_bookmark_file_load_from_data (GBookmarkFile
*bookmark
,
65 gboolean
g_bookmark_file_load_from_data_dirs (GBookmarkFile
*bookmark
,
69 gchar
* g_bookmark_file_to_data (GBookmarkFile
*bookmark
,
71 GError
**error
) G_GNUC_MALLOC
;
72 gboolean
g_bookmark_file_to_file (GBookmarkFile
*bookmark
,
73 const gchar
*filename
,
76 void g_bookmark_file_set_title (GBookmarkFile
*bookmark
,
79 gchar
* g_bookmark_file_get_title (GBookmarkFile
*bookmark
,
81 GError
**error
) G_GNUC_MALLOC
;
82 void g_bookmark_file_set_description (GBookmarkFile
*bookmark
,
84 const gchar
*description
);
85 gchar
* g_bookmark_file_get_description (GBookmarkFile
*bookmark
,
87 GError
**error
) G_GNUC_MALLOC
;
88 void g_bookmark_file_set_mime_type (GBookmarkFile
*bookmark
,
90 const gchar
*mime_type
);
91 gchar
* g_bookmark_file_get_mime_type (GBookmarkFile
*bookmark
,
93 GError
**error
) G_GNUC_MALLOC
;
94 void g_bookmark_file_set_groups (GBookmarkFile
*bookmark
,
98 void g_bookmark_file_add_group (GBookmarkFile
*bookmark
,
101 gboolean
g_bookmark_file_has_group (GBookmarkFile
*bookmark
,
105 gchar
** g_bookmark_file_get_groups (GBookmarkFile
*bookmark
,
108 GError
**error
) G_GNUC_MALLOC
;
109 void g_bookmark_file_add_application (GBookmarkFile
*bookmark
,
113 gboolean
g_bookmark_file_has_application (GBookmarkFile
*bookmark
,
117 gchar
** g_bookmark_file_get_applications (GBookmarkFile
*bookmark
,
120 GError
**error
) G_GNUC_MALLOC
;
121 gboolean
g_bookmark_file_set_app_info (GBookmarkFile
*bookmark
,
128 gboolean
g_bookmark_file_get_app_info (GBookmarkFile
*bookmark
,
135 void g_bookmark_file_set_is_private (GBookmarkFile
*bookmark
,
137 gboolean is_private
);
138 gboolean
g_bookmark_file_get_is_private (GBookmarkFile
*bookmark
,
141 void g_bookmark_file_set_icon (GBookmarkFile
*bookmark
,
144 const gchar
*mime_type
);
145 gboolean
g_bookmark_file_get_icon (GBookmarkFile
*bookmark
,
150 void g_bookmark_file_set_added (GBookmarkFile
*bookmark
,
153 time_t g_bookmark_file_get_added (GBookmarkFile
*bookmark
,
156 void g_bookmark_file_set_modified (GBookmarkFile
*bookmark
,
159 time_t g_bookmark_file_get_modified (GBookmarkFile
*bookmark
,
162 void g_bookmark_file_set_visited (GBookmarkFile
*bookmark
,
165 time_t g_bookmark_file_get_visited (GBookmarkFile
*bookmark
,
168 gboolean
g_bookmark_file_has_item (GBookmarkFile
*bookmark
,
170 gint
g_bookmark_file_get_size (GBookmarkFile
*bookmark
);
171 gchar
** g_bookmark_file_get_uris (GBookmarkFile
*bookmark
,
172 gsize
*length
) G_GNUC_MALLOC
;
173 gboolean
g_bookmark_file_remove_group (GBookmarkFile
*bookmark
,
177 gboolean
g_bookmark_file_remove_application (GBookmarkFile
*bookmark
,
181 gboolean
g_bookmark_file_remove_item (GBookmarkFile
*bookmark
,
184 gboolean
g_bookmark_file_move_item (GBookmarkFile
*bookmark
,
185 const gchar
*old_uri
,
186 const gchar
*new_uri
,
191 #endif /* __G_BOOKMARK_FILE_H__ */