File indexing completed on 2025-07-02 08:36:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef __G_BOOKMARK_FILE_H__
0022 #define __G_BOOKMARK_FILE_H__
0023
0024 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0025 #error "Only <glib.h> can be included directly."
0026 #endif
0027
0028 #include <glib/gdatetime.h>
0029 #include <glib/gerror.h>
0030 #include <time.h>
0031
0032 G_BEGIN_DECLS
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 typedef enum
0061 {
0062 G_BOOKMARK_FILE_ERROR_INVALID_URI,
0063 G_BOOKMARK_FILE_ERROR_INVALID_VALUE,
0064 G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
0065 G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
0066 G_BOOKMARK_FILE_ERROR_READ,
0067 G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
0068 G_BOOKMARK_FILE_ERROR_WRITE,
0069 G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
0070 } GBookmarkFileError;
0071
0072 GLIB_AVAILABLE_IN_ALL
0073 GQuark g_bookmark_file_error_quark (void);
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 typedef struct _GBookmarkFile GBookmarkFile;
0119
0120 GLIB_AVAILABLE_IN_ALL
0121 GBookmarkFile *g_bookmark_file_new (void);
0122 GLIB_AVAILABLE_IN_ALL
0123 void g_bookmark_file_free (GBookmarkFile *bookmark);
0124
0125 GLIB_AVAILABLE_IN_2_76
0126 GBookmarkFile *g_bookmark_file_copy (GBookmarkFile *bookmark);
0127
0128 GLIB_AVAILABLE_IN_ALL
0129 gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark,
0130 const gchar *filename,
0131 GError **error);
0132 GLIB_AVAILABLE_IN_ALL
0133 gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark,
0134 const gchar *data,
0135 gsize length,
0136 GError **error);
0137 GLIB_AVAILABLE_IN_ALL
0138 gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark,
0139 const gchar *file,
0140 gchar **full_path,
0141 GError **error);
0142 GLIB_AVAILABLE_IN_ALL
0143 gchar * g_bookmark_file_to_data (GBookmarkFile *bookmark,
0144 gsize *length,
0145 GError **error) G_GNUC_MALLOC;
0146 GLIB_AVAILABLE_IN_ALL
0147 gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark,
0148 const gchar *filename,
0149 GError **error);
0150
0151 GLIB_AVAILABLE_IN_ALL
0152 void g_bookmark_file_set_title (GBookmarkFile *bookmark,
0153 const gchar *uri,
0154 const gchar *title);
0155 GLIB_AVAILABLE_IN_ALL
0156 gchar * g_bookmark_file_get_title (GBookmarkFile *bookmark,
0157 const gchar *uri,
0158 GError **error) G_GNUC_MALLOC;
0159 GLIB_AVAILABLE_IN_ALL
0160 void g_bookmark_file_set_description (GBookmarkFile *bookmark,
0161 const gchar *uri,
0162 const gchar *description);
0163 GLIB_AVAILABLE_IN_ALL
0164 gchar * g_bookmark_file_get_description (GBookmarkFile *bookmark,
0165 const gchar *uri,
0166 GError **error) G_GNUC_MALLOC;
0167 GLIB_AVAILABLE_IN_ALL
0168 void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
0169 const gchar *uri,
0170 const gchar *mime_type);
0171 GLIB_AVAILABLE_IN_ALL
0172 gchar * g_bookmark_file_get_mime_type (GBookmarkFile *bookmark,
0173 const gchar *uri,
0174 GError **error) G_GNUC_MALLOC;
0175 GLIB_AVAILABLE_IN_ALL
0176 void g_bookmark_file_set_groups (GBookmarkFile *bookmark,
0177 const gchar *uri,
0178 const gchar **groups,
0179 gsize length);
0180 GLIB_AVAILABLE_IN_ALL
0181 void g_bookmark_file_add_group (GBookmarkFile *bookmark,
0182 const gchar *uri,
0183 const gchar *group);
0184 GLIB_AVAILABLE_IN_ALL
0185 gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark,
0186 const gchar *uri,
0187 const gchar *group,
0188 GError **error);
0189 GLIB_AVAILABLE_IN_ALL
0190 gchar ** g_bookmark_file_get_groups (GBookmarkFile *bookmark,
0191 const gchar *uri,
0192 gsize *length,
0193 GError **error);
0194 GLIB_AVAILABLE_IN_ALL
0195 void g_bookmark_file_add_application (GBookmarkFile *bookmark,
0196 const gchar *uri,
0197 const gchar *name,
0198 const gchar *exec);
0199 GLIB_AVAILABLE_IN_ALL
0200 gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark,
0201 const gchar *uri,
0202 const gchar *name,
0203 GError **error);
0204 GLIB_AVAILABLE_IN_ALL
0205 gchar ** g_bookmark_file_get_applications (GBookmarkFile *bookmark,
0206 const gchar *uri,
0207 gsize *length,
0208 GError **error);
0209 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_application_info)
0210 gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
0211 const gchar *uri,
0212 const gchar *name,
0213 const gchar *exec,
0214 gint count,
0215 time_t stamp,
0216 GError **error);
0217 GLIB_AVAILABLE_IN_2_66
0218 gboolean g_bookmark_file_set_application_info (GBookmarkFile *bookmark,
0219 const char *uri,
0220 const char *name,
0221 const char *exec,
0222 int count,
0223 GDateTime *stamp,
0224 GError **error);
0225 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_application_info)
0226 gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
0227 const gchar *uri,
0228 const gchar *name,
0229 gchar **exec,
0230 guint *count,
0231 time_t *stamp,
0232 GError **error);
0233 GLIB_AVAILABLE_IN_2_66
0234 gboolean g_bookmark_file_get_application_info (GBookmarkFile *bookmark,
0235 const char *uri,
0236 const char *name,
0237 char **exec,
0238 unsigned int *count,
0239 GDateTime **stamp,
0240 GError **error);
0241 GLIB_AVAILABLE_IN_ALL
0242 void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
0243 const gchar *uri,
0244 gboolean is_private);
0245 GLIB_AVAILABLE_IN_ALL
0246 gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark,
0247 const gchar *uri,
0248 GError **error);
0249 GLIB_AVAILABLE_IN_ALL
0250 void g_bookmark_file_set_icon (GBookmarkFile *bookmark,
0251 const gchar *uri,
0252 const gchar *href,
0253 const gchar *mime_type);
0254 GLIB_AVAILABLE_IN_ALL
0255 gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
0256 const gchar *uri,
0257 gchar **href,
0258 gchar **mime_type,
0259 GError **error);
0260 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_added_date_time)
0261 void g_bookmark_file_set_added (GBookmarkFile *bookmark,
0262 const gchar *uri,
0263 time_t added);
0264 GLIB_AVAILABLE_IN_2_66
0265 void g_bookmark_file_set_added_date_time (GBookmarkFile *bookmark,
0266 const char *uri,
0267 GDateTime *added);
0268 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_added_date_time)
0269 time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
0270 const gchar *uri,
0271 GError **error);
0272 GLIB_AVAILABLE_IN_2_66
0273 GDateTime *g_bookmark_file_get_added_date_time (GBookmarkFile *bookmark,
0274 const char *uri,
0275 GError **error);
0276 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_modified_date_time)
0277 void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
0278 const gchar *uri,
0279 time_t modified);
0280 GLIB_AVAILABLE_IN_2_66
0281 void g_bookmark_file_set_modified_date_time (GBookmarkFile *bookmark,
0282 const char *uri,
0283 GDateTime *modified);
0284 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_modified_date_time)
0285 time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
0286 const gchar *uri,
0287 GError **error);
0288 GLIB_AVAILABLE_IN_2_66
0289 GDateTime *g_bookmark_file_get_modified_date_time (GBookmarkFile *bookmark,
0290 const char *uri,
0291 GError **error);
0292 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_visited_date_time)
0293 void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
0294 const gchar *uri,
0295 time_t visited);
0296 GLIB_AVAILABLE_IN_2_66
0297 void g_bookmark_file_set_visited_date_time (GBookmarkFile *bookmark,
0298 const char *uri,
0299 GDateTime *visited);
0300 GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_visited_date_time)
0301 time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
0302 const gchar *uri,
0303 GError **error);
0304 GLIB_AVAILABLE_IN_2_66
0305 GDateTime *g_bookmark_file_get_visited_date_time (GBookmarkFile *bookmark,
0306 const char *uri,
0307 GError **error);
0308 GLIB_AVAILABLE_IN_ALL
0309 gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
0310 const gchar *uri);
0311 GLIB_AVAILABLE_IN_ALL
0312 gint g_bookmark_file_get_size (GBookmarkFile *bookmark);
0313 GLIB_AVAILABLE_IN_ALL
0314 gchar ** g_bookmark_file_get_uris (GBookmarkFile *bookmark,
0315 gsize *length);
0316 GLIB_AVAILABLE_IN_ALL
0317 gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark,
0318 const gchar *uri,
0319 const gchar *group,
0320 GError **error);
0321 GLIB_AVAILABLE_IN_ALL
0322 gboolean g_bookmark_file_remove_application (GBookmarkFile *bookmark,
0323 const gchar *uri,
0324 const gchar *name,
0325 GError **error);
0326 GLIB_AVAILABLE_IN_ALL
0327 gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark,
0328 const gchar *uri,
0329 GError **error);
0330 GLIB_AVAILABLE_IN_ALL
0331 gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark,
0332 const gchar *old_uri,
0333 const gchar *new_uri,
0334 GError **error);
0335
0336 G_END_DECLS
0337
0338 #endif