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 (__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>
33 * G_BOOKMARK_FILE_ERROR:
35 * Error domain for bookmark file parsing.
36 * Errors in this domain will be from the #GBookmarkFileError
37 * enumeration. See #GError for information on error domains.
39 #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
44 * @G_BOOKMARK_FILE_ERROR_INVALID_URI: URI was ill-formed
45 * @G_BOOKMARK_FILE_ERROR_INVALID_VALUE: a requested field was not found
46 * @G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: a requested application did
47 * not register a bookmark
48 * @G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: a requested URI was not found
49 * @G_BOOKMARK_FILE_ERROR_READ: document was ill formed
50 * @G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: the text being parsed was
51 * in an unknown encoding
52 * @G_BOOKMARK_FILE_ERROR_WRITE: an error occurred while writing
53 * @G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: requested file was not found
55 * Error codes returned by bookmark file parsing.
59 G_BOOKMARK_FILE_ERROR_INVALID_URI
,
60 G_BOOKMARK_FILE_ERROR_INVALID_VALUE
,
61 G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED
,
62 G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND
,
63 G_BOOKMARK_FILE_ERROR_READ
,
64 G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING
,
65 G_BOOKMARK_FILE_ERROR_WRITE
,
66 G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
69 GQuark
g_bookmark_file_error_quark (void);
74 * The <structname>GBookmarkFile</structname> struct contains only
75 * private data and should not be directly accessed.
77 typedef struct _GBookmarkFile GBookmarkFile
;
79 GBookmarkFile
*g_bookmark_file_new (void);
80 void g_bookmark_file_free (GBookmarkFile
*bookmark
);
82 gboolean
g_bookmark_file_load_from_file (GBookmarkFile
*bookmark
,
83 const gchar
*filename
,
85 gboolean
g_bookmark_file_load_from_data (GBookmarkFile
*bookmark
,
89 gboolean
g_bookmark_file_load_from_data_dirs (GBookmarkFile
*bookmark
,
93 gchar
* g_bookmark_file_to_data (GBookmarkFile
*bookmark
,
95 GError
**error
) G_GNUC_MALLOC
;
96 gboolean
g_bookmark_file_to_file (GBookmarkFile
*bookmark
,
97 const gchar
*filename
,
100 void g_bookmark_file_set_title (GBookmarkFile
*bookmark
,
103 gchar
* g_bookmark_file_get_title (GBookmarkFile
*bookmark
,
105 GError
**error
) G_GNUC_MALLOC
;
106 void g_bookmark_file_set_description (GBookmarkFile
*bookmark
,
108 const gchar
*description
);
109 gchar
* g_bookmark_file_get_description (GBookmarkFile
*bookmark
,
111 GError
**error
) G_GNUC_MALLOC
;
112 void g_bookmark_file_set_mime_type (GBookmarkFile
*bookmark
,
114 const gchar
*mime_type
);
115 gchar
* g_bookmark_file_get_mime_type (GBookmarkFile
*bookmark
,
117 GError
**error
) G_GNUC_MALLOC
;
118 void g_bookmark_file_set_groups (GBookmarkFile
*bookmark
,
120 const gchar
**groups
,
122 void g_bookmark_file_add_group (GBookmarkFile
*bookmark
,
125 gboolean
g_bookmark_file_has_group (GBookmarkFile
*bookmark
,
129 gchar
** g_bookmark_file_get_groups (GBookmarkFile
*bookmark
,
132 GError
**error
) G_GNUC_MALLOC
;
133 void g_bookmark_file_add_application (GBookmarkFile
*bookmark
,
137 gboolean
g_bookmark_file_has_application (GBookmarkFile
*bookmark
,
141 gchar
** g_bookmark_file_get_applications (GBookmarkFile
*bookmark
,
144 GError
**error
) G_GNUC_MALLOC
;
145 gboolean
g_bookmark_file_set_app_info (GBookmarkFile
*bookmark
,
152 gboolean
g_bookmark_file_get_app_info (GBookmarkFile
*bookmark
,
159 void g_bookmark_file_set_is_private (GBookmarkFile
*bookmark
,
161 gboolean is_private
);
162 gboolean
g_bookmark_file_get_is_private (GBookmarkFile
*bookmark
,
165 void g_bookmark_file_set_icon (GBookmarkFile
*bookmark
,
168 const gchar
*mime_type
);
169 gboolean
g_bookmark_file_get_icon (GBookmarkFile
*bookmark
,
174 void g_bookmark_file_set_added (GBookmarkFile
*bookmark
,
177 time_t g_bookmark_file_get_added (GBookmarkFile
*bookmark
,
180 void g_bookmark_file_set_modified (GBookmarkFile
*bookmark
,
183 time_t g_bookmark_file_get_modified (GBookmarkFile
*bookmark
,
186 void g_bookmark_file_set_visited (GBookmarkFile
*bookmark
,
189 time_t g_bookmark_file_get_visited (GBookmarkFile
*bookmark
,
192 gboolean
g_bookmark_file_has_item (GBookmarkFile
*bookmark
,
194 gint
g_bookmark_file_get_size (GBookmarkFile
*bookmark
);
195 gchar
** g_bookmark_file_get_uris (GBookmarkFile
*bookmark
,
196 gsize
*length
) G_GNUC_MALLOC
;
197 gboolean
g_bookmark_file_remove_group (GBookmarkFile
*bookmark
,
201 gboolean
g_bookmark_file_remove_application (GBookmarkFile
*bookmark
,
205 gboolean
g_bookmark_file_remove_item (GBookmarkFile
*bookmark
,
208 gboolean
g_bookmark_file_move_item (GBookmarkFile
*bookmark
,
209 const gchar
*old_uri
,
210 const gchar
*new_uri
,
215 #endif /* __G_BOOKMARK_FILE_H__ */