1 /*
2  * Distributed under the Boost Software License, Version 1.0.
3  *    (See accompanying file LICENSE_1_0.txt or copy at
4  *          http://www.boost.org/LICENSE_1_0.txt)
5  */
6 module glib.gbookmarkfile;
7 
8 import glib.gtypes;
9 import glib.gerror;
10 
11 import core.stdc.time;
12 
13 //enum G_BOOKMARK_FILE_ERROR = g_bookmark_file_error_quark ();
14 
15 
16 enum GBookmarkFileError
17 {
18   G_BOOKMARK_FILE_ERROR_INVALID_URI,
19   G_BOOKMARK_FILE_ERROR_INVALID_VALUE,
20   G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
21   G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
22   G_BOOKMARK_FILE_ERROR_READ,
23   G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
24   G_BOOKMARK_FILE_ERROR_WRITE,
25   G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
26 }
27 
28 struct GBookmarkFile;
29 
30 
31 
32 extern(C) {
33 
34     GQuark g_bookmark_file_error_quark ();
35 
36 
37     GBookmarkFile *g_bookmark_file_new ();
38 
39     void g_bookmark_file_free (GBookmarkFile  *bookmark);
40 
41 
42     gboolean g_bookmark_file_load_from_file (GBookmarkFile  *bookmark,
43                                 const(gchar)   *filename,
44                                 GError        **error);
45 
46     gboolean g_bookmark_file_load_from_data (GBookmarkFile  *bookmark,
47                                 const(gchar)   *data,
48                                 gsize           length,
49                                 GError        **error);
50 
51     gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile  *bookmark,
52                                 const(gchar)   *file,
53                                 gchar         **full_path,
54                                 GError        **error);
55 
56     gchar *  g_bookmark_file_to_data (GBookmarkFile  *bookmark,
57                                 gsize          *length,
58                                 GError        **error);
59 
60     gboolean g_bookmark_file_to_file (GBookmarkFile  *bookmark,
61                                 const(gchar)   *filename,
62                                 GError        **error);
63 
64 
65     void     g_bookmark_file_set_title (GBookmarkFile  *bookmark,
66                                 const(gchar)    *uri,
67                                 const(gchar)    *title);
68 
69     gchar *  g_bookmark_file_get_title (GBookmarkFile  *bookmark,
70                                 const(gchar)   *uri,
71                                 GError        **error);
72 
73     void     g_bookmark_file_set_description (GBookmarkFile  *bookmark,
74                                 const(gchar)   *uri,
75                                 const(gchar)   *description);
76 
77     gchar * g_bookmark_file_get_description (GBookmarkFile  *bookmark,
78                                 const(gchar)   *uri,
79                                 GError        **error);
80 
81     void g_bookmark_file_set_mime_type (GBookmarkFile  *bookmark,
82                                 const(gchar)   *uri,
83                                 const(gchar)   *mime_type);
84 
85     gchar * g_bookmark_file_get_mime_type (GBookmarkFile  *bookmark,
86                                 const(gchar)   *uri,
87                                 GError        **error);
88 
89     void g_bookmark_file_set_groups (GBookmarkFile  *bookmark,
90                                 const(gchar)   *uri,
91                                 const(gchar)  **groups,
92                                 gsize           length);
93 
94     void g_bookmark_file_add_group (GBookmarkFile  *bookmark,
95                                 const(gchar)   *uri,
96                                 const(gchar)   *group);
97 
98     gboolean g_bookmark_file_has_group (GBookmarkFile  *bookmark,
99                                 const(gchar)   *uri,
100                                 const(gchar)   *group,
101                                 GError        **error);
102 
103     gchar ** g_bookmark_file_get_groups (GBookmarkFile  *bookmark,
104                                 const(gchar)   *uri,
105                                 gsize          *length,
106                                 GError        **error);
107 
108     void g_bookmark_file_add_application (GBookmarkFile  *bookmark,
109                                 const(gchar)   *uri,
110                                 const(gchar)   *name,
111                                 const(gchar)   *exec);
112 
113     gboolean g_bookmark_file_has_application (GBookmarkFile  *bookmark,
114                                 const(gchar)   *uri,
115                                 const(gchar)   *name,
116                                 GError        **error);
117 
118     gchar ** g_bookmark_file_get_applications (GBookmarkFile  *bookmark,
119                                 const(gchar)   *uri,
120                                 gsize          *length,
121                                 GError        **error);
122 
123     gboolean g_bookmark_file_set_app_info (GBookmarkFile  *bookmark,
124                                 const(gchar)   *uri,
125                                 const(gchar)   *name,
126                                 const(gchar)   *exec,
127                                 gint            count,
128                                 time_t          stamp,
129                                 GError        **error);
130 
131     gboolean g_bookmark_file_get_app_info (GBookmarkFile  *bookmark,
132                                 const(gchar)   *uri,
133                                 const(gchar)   *name,
134                                 gchar         **exec,
135                                 guint          *count,
136                                 time_t         *stamp,
137                                 GError        **error);
138 
139     void g_bookmark_file_set_is_private (GBookmarkFile  *bookmark,
140                                 const(gchar)   *uri,
141                                 gboolean        is_private);
142 
143     gboolean g_bookmark_file_get_is_private (GBookmarkFile  *bookmark,
144                                 const(gchar)    *uri,
145                                 GError        **error);
146 
147     void g_bookmark_file_set_icon (GBookmarkFile  *bookmark,
148                                 const(gchar)   *uri,
149                                 const(gchar)   *href,
150                                 const(gchar)   *mime_type);
151 
152     gboolean g_bookmark_file_get_icon (GBookmarkFile  *bookmark,
153                                 const(gchar)   *uri,
154                                 gchar         **href,
155                                 gchar         **mime_type,
156                                 GError        **error);
157 
158     void g_bookmark_file_set_added (GBookmarkFile  *bookmark,
159                                 const(gchar)   *uri,
160                                 time_t          added);
161 
162     time_t g_bookmark_file_get_added (GBookmarkFile  *bookmark,
163                                 const(gchar)   *uri,
164                                 GError        **error);
165 
166     void g_bookmark_file_set_modified (GBookmarkFile  *bookmark,
167                                 const(gchar)   *uri,
168                                 time_t          modified);
169 
170     time_t g_bookmark_file_get_modified (GBookmarkFile  *bookmark,
171                                 const(gchar)   *uri,
172                                 GError        **error);
173 
174     void g_bookmark_file_set_visited (GBookmarkFile  *bookmark,
175                                 const(gchar)   *uri,
176                                 time_t          visited);
177 
178     time_t g_bookmark_file_get_visited (GBookmarkFile  *bookmark,
179                                 const(gchar)   *uri,
180                                 GError        **error);
181 
182     gboolean g_bookmark_file_has_item (GBookmarkFile  *bookmark,
183                                 const(gchar)   *uri);
184 
185     gint g_bookmark_file_get_size (GBookmarkFile  *bookmark);
186 
187     gchar ** g_bookmark_file_get_uris (GBookmarkFile  *bookmark,
188                                 gsize          *length);
189 
190     gboolean g_bookmark_file_remove_group (GBookmarkFile  *bookmark,
191                                 const(gchar)   *uri,
192                                 const(gchar)   *group,
193                                 GError        **error);
194 
195     gboolean g_bookmark_file_remove_application (GBookmarkFile  *bookmark,
196                                 const(gchar)   *uri,
197                                 const(gchar)   *name,
198                                 GError        **error);
199 
200     gboolean g_bookmark_file_remove_item (GBookmarkFile  *bookmark,
201                                 const(gchar)   *uri,
202                                 GError        **error);
203 
204     gboolean g_bookmark_file_move_item (GBookmarkFile  *bookmark,
205                                 const(gchar)   *old_uri,
206                                 const(gchar)   *new_uri,
207                                 GError        **error);
208 }
209