/src/wrappers/glib/library/utilities/glib_bookmark_file_parser.e

http://github.com/tybor/Liberty · Specman e · 1098 lines · 2 code · 306 blank · 790 comment · 0 complexity · 77247a10de09f109a279fbf40d02b8be MD5 · raw file

  1. deferred class GLIB_BOOKMARK_FILE_PARSER
  2. -- Bookmark file parser
  3. -- Bookmark file parser -- parses files containing bookmarks
  4. -- Synopsis
  5. -- #include <glib.h>
  6. -- GBookmarkFile;
  7. -- #define G_BOOKMARK_FILE_ERROR
  8. -- enum GBookmarkFileError;
  9. -- GBookmarkFile* g_bookmark_file_new (void);
  10. -- void g_bookmark_file_free (GBookmarkFile *bookmark);
  11. -- gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark,
  12. -- const gchar *filename,
  13. -- GError **error);
  14. -- gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark,
  15. -- const gchar *data,
  16. -- gsize length,
  17. -- GError **error);
  18. -- gboolean g_bookmark_file_load_from_data_dirs
  19. -- (GBookmarkFile *bookmark,
  20. -- const gchar *file,
  21. -- gchar **full_path,
  22. -- GError **error);
  23. -- gchar* g_bookmark_file_to_data (GBookmarkFile *bookmark,
  24. -- gsize *length,
  25. -- GError **error);
  26. -- gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark,
  27. -- const gchar *filename,
  28. -- GError **error);
  29. -- gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
  30. -- const gchar *uri);
  31. -- gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark,
  32. -- const gchar *uri,
  33. -- const gchar *group,
  34. -- GError **error);
  35. -- gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark,
  36. -- const gchar *uri,
  37. -- const gchar *name,
  38. -- GError **error);
  39. -- gint g_bookmark_file_get_size (GBookmarkFile *bookmark);
  40. -- gchar** g_bookmark_file_get_uris (GBookmarkFile *bookmark,
  41. -- gsize *length);
  42. -- gchar* g_bookmark_file_get_title (GBookmarkFile *bookmark,
  43. -- const gchar *uri,
  44. -- GError **error);
  45. -- gchar* g_bookmark_file_get_description (GBookmarkFile *bookmark,
  46. -- const gchar *uri,
  47. -- GError **error);
  48. -- gchar* g_bookmark_file_get_mime_type (GBookmarkFile *bookmark,
  49. -- const gchar *uri,
  50. -- GError **error);
  51. -- gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark,
  52. -- const gchar *uri,
  53. -- GError **error);
  54. -- gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
  55. -- const gchar *uri,
  56. -- gchar **href,
  57. -- gchar **mime_type,
  58. -- GError **error);
  59. -- time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
  60. -- const gchar *uri,
  61. -- GError **error);
  62. -- time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
  63. -- const gchar *uri,
  64. -- GError **error);
  65. -- time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
  66. -- const gchar *uri,
  67. -- GError **error);
  68. -- gchar** g_bookmark_file_get_groups (GBookmarkFile *bookmark,
  69. -- const gchar *uri,
  70. -- gsize *length,
  71. -- GError **error);
  72. -- gchar** g_bookmark_file_get_applications
  73. -- (GBookmarkFile *bookmark,
  74. -- const gchar *uri,
  75. -- gsize *length,
  76. -- GError **error);
  77. -- gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
  78. -- const gchar *uri,
  79. -- const gchar *name,
  80. -- gchar **exec,
  81. -- guint *count,
  82. -- time_t *stamp,
  83. -- GError **error);
  84. -- void g_bookmark_file_set_title (GBookmarkFile *bookmark,
  85. -- const gchar *uri,
  86. -- const gchar *title);
  87. -- void g_bookmark_file_set_description (GBookmarkFile *bookmark,
  88. -- const gchar *uri,
  89. -- const gchar *description);
  90. -- void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
  91. -- const gchar *uri,
  92. -- const gchar *mime_type);
  93. -- void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
  94. -- const gchar *uri,
  95. -- gboolean is_private);
  96. -- void g_bookmark_file_set_icon (GBookmarkFile *bookmark,
  97. -- const gchar *uri,
  98. -- const gchar *href,
  99. -- const gchar *mime_type);
  100. -- void g_bookmark_file_set_added (GBookmarkFile *bookmark,
  101. -- const gchar *uri,
  102. -- time_t added);
  103. -- void g_bookmark_file_set_groups (GBookmarkFile *bookmark,
  104. -- const gchar *uri,
  105. -- const gchar **groups,
  106. -- gsize length);
  107. -- void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
  108. -- const gchar *uri,
  109. -- time_t modified);
  110. -- void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
  111. -- const gchar *uri,
  112. -- time_t visited);
  113. -- gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
  114. -- const gchar *uri,
  115. -- const gchar *name,
  116. -- const gchar *exec,
  117. -- gint count,
  118. -- time_t stamp,
  119. -- GError **error);
  120. -- void g_bookmark_file_add_group (GBookmarkFile *bookmark,
  121. -- const gchar *uri,
  122. -- const gchar *group);
  123. -- void g_bookmark_file_add_application (GBookmarkFile *bookmark,
  124. -- const gchar *uri,
  125. -- const gchar *name,
  126. -- const gchar *exec);
  127. -- gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark,
  128. -- const gchar *uri,
  129. -- const gchar *group,
  130. -- GError **error);
  131. -- gboolean g_bookmark_file_remove_application
  132. -- (GBookmarkFile *bookmark,
  133. -- const gchar *uri,
  134. -- const gchar *name,
  135. -- GError **error);
  136. -- gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark,
  137. -- const gchar *uri,
  138. -- GError **error);
  139. -- gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark,
  140. -- const gchar *old_uri,
  141. -- const gchar *new_uri,
  142. -- GError **error);
  143. -- Description
  144. -- GBookmarkFile lets you parse, edit or create files containing bookmarks to URI,
  145. -- along with some meta-data about the resource pointed by the URI like its MIME
  146. -- type, the application that is registering the bookmark and the icon that should
  147. -- be used to represent the bookmark. The data is stored using the Desktop Bookmark
  148. -- Specification.
  149. -- The syntax of the bookmark files is described in detail inside the Desktop
  150. -- Bookmark Specification, here is a quick summary: bookmark files use a sub-class
  151. -- of the XML Bookmark Exchange Language specification, consisting of valid UTF-8
  152. -- encoded XML, under the xbel root element; each bookmark is stored inside a
  153. -- bookmark element, using its URI: no relative paths can be used inside a bookmark
  154. -- file. The bookmark may have a user defined title and description, to be used
  155. -- instead of the URI. Under the metadata element, with its owner attribute set to
  156. -- http://freedesktop.org, is stored the meta-data about a resource pointed by its
  157. -- URI. The meta-data consists of the resource's MIME type; the applications that
  158. -- have registered a bookmark; the groups to which a bookmark belongs to; a
  159. -- visibility flag, used to set the bookmark as "private" to the applications and
  160. -- groups that has it registered; the URI and MIME type of an icon, to be used when
  161. -- displaying the bookmark inside a GUI.
  162. -- <?xml version="1.0"?>
  163. -- <!DOCTYPE xbel PUBLIC
  164. -- "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
  165. -- "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
  166. -- <xbel version="1.0"
  167. -- xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
  168. -- xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks">
  169. -- <bookmark href="file:///home/ebassi/bookmark-spec/bookmark-spec.xml">
  170. -- <title>Desktop Bookmarks Spec</title>
  171. -- <info>
  172. -- <metadata owner="http://freedesktop.org">
  173. -- <mime:mime-type>text/xml</mime:mime-type>
  174. -- <bookmark:applications>
  175. -- <bookmark:application name="GEdit" count="2" exec="gedit <link linkend="u"><literal>u</literal></link>" timestamp="1115726763"/>
  176. -- <bookmark:application name="GViM" count="7" exec="gvim <link linkend="f"><literal>f</literal></link>" timestamp="1115726812"/>
  177. -- </bookmark:applications>
  178. -- <bookmark:groups>
  179. -- <bookmark:group>Editors</bookmark:group>
  180. -- </bookmark:groups>
  181. -- </metadata>
  182. -- </info>
  183. -- </bookmark>
  184. -- </xbel>
  185. -- A bookmark file might contain more than one bookmark; each bookmark is accessed
  186. -- through its URI.
  187. -- The important caveat of bookmark files is that when you add a new bookmark you
  188. -- must also add the application that is registering it, using
  189. -- g_bookmark_file_add_application() or g_bookmark_file_set_app_info(). If a
  190. -- bookmark has no applications then it won't be dumped when creating the on disk
  191. -- representation, using g_bookmark_file_to_data() or g_bookmark_file_to_file().
  192. -- The GBookmarkFile parser was added in GLib 2.12.
  193. -- Details
  194. -- GBookmarkFile
  195. -- typedef struct _GBookmarkFile GBookmarkFile;
  196. -- The GBookmarkFile struct contains only private data and should not be used
  197. -- directly.
  198. -- ---------------------------------------------------------------------------------
  199. -- G_BOOKMARK_FILE_ERROR
  200. -- #define G_BOOKMARK_FILE_ERROR (g_bookmark_file_error_quark ())
  201. -- Error domain for bookmark file parsing. Errors in this domain will be from the
  202. -- GBookmarkFileError enumeration. See GError for informations on error domains.
  203. -- ---------------------------------------------------------------------------------
  204. -- enum GBookmarkFileError
  205. -- typedef enum
  206. -- {
  207. -- G_BOOKMARK_FILE_ERROR_INVALID_URI,
  208. -- G_BOOKMARK_FILE_ERROR_INVALID_VALUE,
  209. -- G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED,
  210. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND,
  211. -- G_BOOKMARK_FILE_ERROR_READ,
  212. -- G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING,
  213. -- G_BOOKMARK_FILE_ERROR_WRITE,
  214. -- G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND
  215. -- } GBookmarkFileError;
  216. -- Error codes returned by bookmark file parsing.
  217. -- G_BOOKMARK_FILE_ERROR_INVALID_URI URI was ill-formed
  218. -- G_BOOKMARK_FILE_ERROR_INVALID_VALUE a requested field was not found
  219. -- G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED a requested application did not register
  220. -- a bookmark
  221. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND a requested URI was not found
  222. -- G_BOOKMARK_FILE_ERROR_READ document was ill formed
  223. -- G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING the text being parsed was in an unknown
  224. -- encoding
  225. -- G_BOOKMARK_FILE_ERROR_WRITE an error occurred while writing
  226. -- G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND requested file was not found
  227. -- ---------------------------------------------------------------------------------
  228. -- g_bookmark_file_new ()
  229. -- GBookmarkFile* g_bookmark_file_new (void);
  230. -- Creates a new empty GBookmarkFile object.
  231. -- Use g_bookmark_file_load_from_file(), g_bookmark_file_load_from_data() or
  232. -- g_bookmark_file_load_from_data_dirs() to read an existing bookmark file.
  233. -- Returns : an empty GBookmarkFile
  234. -- Since 2.12
  235. -- ---------------------------------------------------------------------------------
  236. -- g_bookmark_file_free ()
  237. -- void g_bookmark_file_free (GBookmarkFile *bookmark);
  238. -- Frees a GBookmarkFile.
  239. -- bookmark : a GBookmarkFile
  240. -- Since 2.12
  241. -- ---------------------------------------------------------------------------------
  242. -- g_bookmark_file_load_from_file ()
  243. -- gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark,
  244. -- const gchar *filename,
  245. -- GError **error);
  246. -- Loads a desktop bookmark file into an empty GBookmarkFile structure. If the file
  247. -- could not be loaded then error is set to either a GFileError or
  248. -- GBookmarkFileError.
  249. -- bookmark : an empty GBookmarkFile struct
  250. -- filename : the path of a filename to load, in the GLib file name encoding
  251. -- error : return location for a GError, or NULL
  252. -- Returns : TRUE if a desktop bookmark file could be loaded
  253. -- Since 2.12
  254. -- ---------------------------------------------------------------------------------
  255. -- g_bookmark_file_load_from_data ()
  256. -- gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark,
  257. -- const gchar *data,
  258. -- gsize length,
  259. -- GError **error);
  260. -- Loads a bookmark file from memory into an empty GBookmarkFile structure. If the
  261. -- object cannot be created then error is set to a GBookmarkFileError.
  262. -- bookmark : an empty GBookmarkFile struct
  263. -- data : desktop bookmarks loaded in memory
  264. -- length : the length of data in bytes
  265. -- error : return location for a GError, or NULL
  266. -- Returns : TRUE if a desktop bookmark could be loaded.
  267. -- Since 2.12
  268. -- ---------------------------------------------------------------------------------
  269. -- g_bookmark_file_load_from_data_dirs ()
  270. -- gboolean g_bookmark_file_load_from_data_dirs
  271. -- (GBookmarkFile *bookmark,
  272. -- const gchar *file,
  273. -- gchar **full_path,
  274. -- GError **error);
  275. -- This function looks for a desktop bookmark file named file in the paths returned
  276. -- from g_get_user_data_dir() and g_get_system_data_dirs(), loads the file into
  277. -- bookmark and returns the file's full path in full_path. If the file could not be
  278. -- loaded then an error is set to either a GFileError or GBookmarkFileError.
  279. -- bookmark : a GBookmarkFile
  280. -- file : a relative path to a filename to open and parse
  281. -- full_path : return location for a string containing the full path of the file, or
  282. -- NULL
  283. -- error : return location for a GError, or NULL
  284. -- Returns : TRUE if a key file could be loaded, FALSE othewise
  285. -- Since 2.12
  286. -- ---------------------------------------------------------------------------------
  287. -- g_bookmark_file_to_data ()
  288. -- gchar* g_bookmark_file_to_data (GBookmarkFile *bookmark,
  289. -- gsize *length,
  290. -- GError **error);
  291. -- This function outputs bookmark as a string.
  292. -- bookmark : a GBookmarkFile
  293. -- length : return location for the length of the returned string, or NULL
  294. -- error : return location for a GError, or NULL
  295. -- Returns : a newly allocated string holding the contents of the GBookmarkFile
  296. -- Since 2.12
  297. -- ---------------------------------------------------------------------------------
  298. -- g_bookmark_file_to_file ()
  299. -- gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark,
  300. -- const gchar *filename,
  301. -- GError **error);
  302. -- This function outputs bookmark into a file. The write process is guaranteed to be
  303. -- atomic by using g_file_set_contents() internally.
  304. -- bookmark : a GBookmarkFile
  305. -- filename : path of the output file
  306. -- error : return location for a GError, or NULL
  307. -- Returns : TRUE if the file was successfully written.
  308. -- Since 2.12
  309. -- ---------------------------------------------------------------------------------
  310. -- g_bookmark_file_has_item ()
  311. -- gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
  312. -- const gchar *uri);
  313. -- Looks whether the desktop bookmark has an item with its URI set to uri.
  314. -- bookmark : a GBookmarkFile
  315. -- uri : a valid URI
  316. -- Returns : TRUE if uri is inside bookmark, FALSE otherwise
  317. -- Since 2.12
  318. -- ---------------------------------------------------------------------------------
  319. -- g_bookmark_file_has_group ()
  320. -- gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark,
  321. -- const gchar *uri,
  322. -- const gchar *group,
  323. -- GError **error);
  324. -- Checks whether group appears in the list of groups to which the bookmark for uri
  325. -- belongs to.
  326. -- In the event the URI cannot be found, FALSE is returned and error is set to
  327. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  328. -- bookmark : a GBookmarkFile
  329. -- uri : a valid URI
  330. -- group : the group name to be searched
  331. -- error : return location for a GError, or NULL
  332. -- Returns : TRUE if group was found.
  333. -- Since 2.12
  334. -- ---------------------------------------------------------------------------------
  335. -- g_bookmark_file_has_application ()
  336. -- gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark,
  337. -- const gchar *uri,
  338. -- const gchar *name,
  339. -- GError **error);
  340. -- Checks whether the bookmark for uri inside bookmark has been registered by
  341. -- application name.
  342. -- In the event the URI cannot be found, FALSE is returned and error is set to
  343. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  344. -- bookmark : a GBookmarkFile
  345. -- uri : a valid URI
  346. -- name : the name of the application
  347. -- error : return location for a GError or NULL
  348. -- Returns : TRUE if the application name was found
  349. -- Since 2.12
  350. -- ---------------------------------------------------------------------------------
  351. -- g_bookmark_file_get_size ()
  352. -- gint g_bookmark_file_get_size (GBookmarkFile *bookmark);
  353. -- Gets the number of bookmarks inside bookmark.
  354. -- bookmark : a GBookmarkFile
  355. -- Returns : the number of bookmarks
  356. -- Since 2.12
  357. -- ---------------------------------------------------------------------------------
  358. -- g_bookmark_file_get_uris ()
  359. -- gchar** g_bookmark_file_get_uris (GBookmarkFile *bookmark,
  360. -- gsize *length);
  361. -- Returns all URIs of the bookmarks in the bookmark file bookmark. The array of
  362. -- returned URIs will be NULL-terminated, so length may optionally be NULL.
  363. -- bookmark : a GBookmarkFile
  364. -- length : return location for the number of returned URIs, or NULL
  365. -- Returns : a newly allocated NULL-terminated array of strings. Use g_strfreev()
  366. -- to free it.
  367. -- Since 2.12
  368. -- ---------------------------------------------------------------------------------
  369. -- g_bookmark_file_get_title ()
  370. -- gchar* g_bookmark_file_get_title (GBookmarkFile *bookmark,
  371. -- const gchar *uri,
  372. -- GError **error);
  373. -- Returns the title of the bookmark for uri.
  374. -- If uri is NULL, the title of bookmark is returned.
  375. -- In the event the URI cannot be found, NULL is returned and error is set to
  376. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  377. -- bookmark : a GBookmarkFile
  378. -- uri : a valid URI or NULL
  379. -- error : return location for a GError, or NULL
  380. -- Returns : a newly allocated string or NULL if the specified URI cannot be found.
  381. -- Since 2.12
  382. -- ---------------------------------------------------------------------------------
  383. -- g_bookmark_file_get_description ()
  384. -- gchar* g_bookmark_file_get_description (GBookmarkFile *bookmark,
  385. -- const gchar *uri,
  386. -- GError **error);
  387. -- Retrieves the description of the bookmark for uri.
  388. -- In the event the URI cannot be found, NULL is returned and error is set to
  389. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  390. -- bookmark : a GBookmarkFile
  391. -- uri : a valid URI
  392. -- error : return location for a GError, or NULL
  393. -- Returns : a newly allocated string or NULL if the specified URI cannot be found.
  394. -- Since 2.12
  395. -- ---------------------------------------------------------------------------------
  396. -- g_bookmark_file_get_mime_type ()
  397. -- gchar* g_bookmark_file_get_mime_type (GBookmarkFile *bookmark,
  398. -- const gchar *uri,
  399. -- GError **error);
  400. -- Retrieves the MIME type of the resource pointed by uri.
  401. -- In the event the URI cannot be found, NULL is returned and error is set to
  402. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that the MIME type cannot be
  403. -- found, NULL is returned and error is set to G_BOOKMARK_FILE_ERROR_INVALID_VALUE.
  404. -- bookmark : a GBookmarkFile
  405. -- uri : a valid URI
  406. -- error : return location for a GError, or NULL
  407. -- Returns : a newly allocated string or NULL if the specified URI cannot be found.
  408. -- Since 2.12
  409. -- ---------------------------------------------------------------------------------
  410. -- g_bookmark_file_get_is_private ()
  411. -- gboolean g_bookmark_file_get_is_private (GBookmarkFile *bookmark,
  412. -- const gchar *uri,
  413. -- GError **error);
  414. -- Gets whether the private flag of the bookmark for uri is set.
  415. -- In the event the URI cannot be found, FALSE is returned and error is set to
  416. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that the private flag cannot be
  417. -- found, FALSE is returned and error is set to G_BOOKMARK_FILE_ERROR_INVALID_VALUE.
  418. -- bookmark : a GBookmarkFile
  419. -- uri : a valid URI
  420. -- error : return location for a GError, or NULL
  421. -- Returns : TRUE if the private flag is set, FALSE otherwise.
  422. -- Since 2.12
  423. -- ---------------------------------------------------------------------------------
  424. -- g_bookmark_file_get_icon ()
  425. -- gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
  426. -- const gchar *uri,
  427. -- gchar **href,
  428. -- gchar **mime_type,
  429. -- GError **error);
  430. -- Gets the icon of the bookmark for uri.
  431. -- In the event the URI cannot be found, FALSE is returned and error is set to
  432. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  433. -- bookmark : a GBookmarkFile
  434. -- uri : a valid URI
  435. -- href : return location for the icon's location or NULL
  436. -- mime_type : return location for the icon's MIME type or NULL
  437. -- error : return location for a GError or NULL
  438. -- Returns : TRUE if the icon for the bookmark for the URI was found. You should
  439. -- free the returned strings.
  440. -- Since 2.12
  441. -- ---------------------------------------------------------------------------------
  442. -- g_bookmark_file_get_added ()
  443. -- time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
  444. -- const gchar *uri,
  445. -- GError **error);
  446. -- Gets the time the bookmark for uri was added to bookmark
  447. -- In the event the URI cannot be found, -1 is returned and error is set to
  448. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  449. -- bookmark : a GBookmarkFile
  450. -- uri : a valid URI
  451. -- error : return location for a GError, or NULL
  452. -- Returns : a timestamp
  453. -- Since 2.12
  454. -- ---------------------------------------------------------------------------------
  455. -- g_bookmark_file_get_modified ()
  456. -- time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
  457. -- const gchar *uri,
  458. -- GError **error);
  459. -- Gets the time when the bookmark for uri was last modified.
  460. -- In the event the URI cannot be found, -1 is returned and error is set to
  461. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  462. -- bookmark : a GBookmarkFile
  463. -- uri : a valid URI
  464. -- error : return location for a GError, or NULL
  465. -- Returns : a timestamp
  466. -- Since 2.12
  467. -- ---------------------------------------------------------------------------------
  468. -- g_bookmark_file_get_visited ()
  469. -- time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
  470. -- const gchar *uri,
  471. -- GError **error);
  472. -- Gets the time the bookmark for uri was last visited.
  473. -- In the event the URI cannot be found, -1 is returned and error is set to
  474. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  475. -- bookmark : a GBookmarkFile
  476. -- uri : a valid URI
  477. -- error : return location for a GError, or NULL
  478. -- Returns : a timestamp.
  479. -- Since 2.12
  480. -- ---------------------------------------------------------------------------------
  481. -- g_bookmark_file_get_groups ()
  482. -- gchar** g_bookmark_file_get_groups (GBookmarkFile *bookmark,
  483. -- const gchar *uri,
  484. -- gsize *length,
  485. -- GError **error);
  486. -- Retrieves the list of group names of the bookmark for uri.
  487. -- In the event the URI cannot be found, NULL is returned and error is set to
  488. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  489. -- The returned array is NULL terminated, so length may optionally be NULL.
  490. -- bookmark : a GBookmarkFile
  491. -- uri : a valid URI
  492. -- length : return location for the length of the returned string, or NULL
  493. -- error : return location for a GError, or NULL
  494. -- Returns : a newly allocated NULL-terminated array of group names. Use
  495. -- g_strfreev() to free it.
  496. -- Since 2.12
  497. -- ---------------------------------------------------------------------------------
  498. -- g_bookmark_file_get_applications ()
  499. -- gchar** g_bookmark_file_get_applications
  500. -- (GBookmarkFile *bookmark,
  501. -- const gchar *uri,
  502. -- gsize *length,
  503. -- GError **error);
  504. -- Retrieves the names of the applications that have registered the bookmark for
  505. -- uri.
  506. -- In the event the URI cannot be found, NULL is returned and error is set to
  507. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  508. -- bookmark : a GBookmarkFile
  509. -- uri : a valid URI
  510. -- length : return location of the length of the returned list, or NULL
  511. -- error : return location for a GError, or NULL
  512. -- Returns : a newly allocated NULL-terminated array of strings. Use g_strfreev()
  513. -- to free it.
  514. -- Since 2.12
  515. -- ---------------------------------------------------------------------------------
  516. -- g_bookmark_file_get_app_info ()
  517. -- gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
  518. -- const gchar *uri,
  519. -- const gchar *name,
  520. -- gchar **exec,
  521. -- guint *count,
  522. -- time_t *stamp,
  523. -- GError **error);
  524. -- Gets the registration informations of app_name for the bookmark for uri. See
  525. -- g_bookmark_file_set_app_info() for more informations about the returned data.
  526. -- The string returned in app_exec must be freed.
  527. -- In the event the URI cannot be found, FALSE is returned and error is set to
  528. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that no application with name
  529. -- app_name has registered a bookmark for uri, FALSE is returned and error is set to
  530. -- G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.
  531. -- bookmark : a GBookmarkFile
  532. -- uri : a valid URI
  533. -- name : an application's name
  534. -- exec : location for the command line of the application, or NULL
  535. -- count : return location for the registration count, or NULL
  536. -- stamp : return location for the last registration time, or NULL
  537. -- error : return location for a GError, or NULL
  538. -- Returns : TRUE on success.
  539. -- Since 2.12
  540. -- ---------------------------------------------------------------------------------
  541. -- g_bookmark_file_set_title ()
  542. -- void g_bookmark_file_set_title (GBookmarkFile *bookmark,
  543. -- const gchar *uri,
  544. -- const gchar *title);
  545. -- Sets title as the title of the bookmark for uri inside the bookmark file
  546. -- bookmark.
  547. -- If uri is NULL, the title of bookmark is set.
  548. -- If a bookmark for uri cannot be found then it is created.
  549. -- bookmark : a GBookmarkFile
  550. -- uri : a valid URI or NULL
  551. -- title : a UTF-8 encoded string
  552. -- Since 2.12
  553. -- ---------------------------------------------------------------------------------
  554. -- g_bookmark_file_set_description ()
  555. -- void g_bookmark_file_set_description (GBookmarkFile *bookmark,
  556. -- const gchar *uri,
  557. -- const gchar *description);
  558. -- Sets description as the description of the bookmark for uri.
  559. -- If uri is NULL, the description of bookmark is set.
  560. -- If a bookmark for uri cannot be found then it is created.
  561. -- bookmark : a GBookmarkFile
  562. -- uri : a valid URI or NULL
  563. -- description : a string
  564. -- Since 2.12
  565. -- ---------------------------------------------------------------------------------
  566. -- g_bookmark_file_set_mime_type ()
  567. -- void g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
  568. -- const gchar *uri,
  569. -- const gchar *mime_type);
  570. -- Sets mime_type as the MIME type of the bookmark for uri.
  571. -- If a bookmark for uri cannot be found then it is created.
  572. -- bookmark : a GBookmarkFile
  573. -- uri : a valid URI
  574. -- mime_type : a MIME type
  575. -- Since 2.12
  576. -- ---------------------------------------------------------------------------------
  577. -- g_bookmark_file_set_is_private ()
  578. -- void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
  579. -- const gchar *uri,
  580. -- gboolean is_private);
  581. -- Sets the private flag of the bookmark for uri.
  582. -- If a bookmark for uri cannot be found then it is created.
  583. -- bookmark : a GBookmarkFile
  584. -- uri : a valid URI
  585. -- is_private : TRUE if the bookmark should be marked as private
  586. -- Since 2.12
  587. -- ---------------------------------------------------------------------------------
  588. -- g_bookmark_file_set_icon ()
  589. -- void g_bookmark_file_set_icon (GBookmarkFile *bookmark,
  590. -- const gchar *uri,
  591. -- const gchar *href,
  592. -- const gchar *mime_type);
  593. -- Sets the icon for the bookmark for uri. If href is NULL, unsets the currently set
  594. -- icon.
  595. -- If no bookmark for uri is found it is created.
  596. -- bookmark : a GBookmarkFile
  597. -- uri : a valid URI
  598. -- href : the URI of the icon for the bookmark, or NULL
  599. -- mime_type : the MIME type of the icon for the bookmark
  600. -- Since 2.12
  601. -- ---------------------------------------------------------------------------------
  602. -- g_bookmark_file_set_added ()
  603. -- void g_bookmark_file_set_added (GBookmarkFile *bookmark,
  604. -- const gchar *uri,
  605. -- time_t added);
  606. -- Sets the time the bookmark for uri was added into bookmark.
  607. -- If no bookmark for uri is found then it is created.
  608. -- bookmark : a GBookmarkFile
  609. -- uri : a valid URI
  610. -- added : a timestamp or -1 to use the current time
  611. -- Since 2.12
  612. -- ---------------------------------------------------------------------------------
  613. -- g_bookmark_file_set_groups ()
  614. -- void g_bookmark_file_set_groups (GBookmarkFile *bookmark,
  615. -- const gchar *uri,
  616. -- const gchar **groups,
  617. -- gsize length);
  618. -- Sets a list of group names for the item with URI uri. Each previously set group
  619. -- name list is removed.
  620. -- If uri cannot be found then an item for it is created.
  621. -- bookmark : a GBookmarkFile
  622. -- uri : an item's URI
  623. -- groups : an array of group names, or NULL to remove all groups
  624. -- length : number of group name values in groups
  625. -- Since 2.12
  626. -- ---------------------------------------------------------------------------------
  627. -- g_bookmark_file_set_modified ()
  628. -- void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
  629. -- const gchar *uri,
  630. -- time_t modified);
  631. -- Sets the last time the bookmark for uri was last modified.
  632. -- If no bookmark for uri is found then it is created.
  633. -- The "modified" time should only be set when the bookmark's meta-data was actually
  634. -- changed. Every function of GBookmarkFile that modifies a bookmark also changes
  635. -- the modification time, except for g_bookmark_file_set_visited().
  636. -- bookmark : a GBookmarkFile
  637. -- uri : a valid URI
  638. -- modified : a timestamp or -1 to use the current time
  639. -- Since 2.12
  640. -- ---------------------------------------------------------------------------------
  641. -- g_bookmark_file_set_visited ()
  642. -- void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
  643. -- const gchar *uri,
  644. -- time_t visited);
  645. -- Sets the time the bookmark for uri was last visited.
  646. -- If no bookmark for uri is found then it is created.
  647. -- The "visited" time should only be set if the bookmark was launched, either using
  648. -- the command line retrieved by g_bookmark_file_get_app_info() or by the default
  649. -- application for the bookmark's MIME type, retrieved using
  650. -- g_bookmark_file_get_mime_type(). Changing the "visited" time does not affect the
  651. -- "modified" time.
  652. -- bookmark : a GBookmarkFile
  653. -- uri : a valid URI
  654. -- visited : a timestamp or -1 to use the current time
  655. -- Since 2.12
  656. -- ---------------------------------------------------------------------------------
  657. -- g_bookmark_file_set_app_info ()
  658. -- gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
  659. -- const gchar *uri,
  660. -- const gchar *name,
  661. -- const gchar *exec,
  662. -- gint count,
  663. -- time_t stamp,
  664. -- GError **error);
  665. -- Sets the meta-data of application name inside the list of applications that have
  666. -- registered a bookmark for uri inside bookmark.
  667. -- You should rarely use this function; use g_bookmark_file_add_application() and
  668. -- g_bookmark_file_remove_application() instead.
  669. -- name can be any UTF-8 encoded string used to identify an application. exec can
  670. -- have one of these two modifiers: "f", which will be expanded as the local file
  671. -- name retrieved from the bookmark's URI; "u", which will be expanded as the
  672. -- bookmark's URI. The expansion is done automatically when retrieving the stored
  673. -- command line using the g_bookmark_file_get_app_info() function. count is the
  674. -- number of times the application has registered the bookmark; if is < 0, the
  675. -- current registration count will be increased by one, if is 0, the application
  676. -- with name will be removed from the list of registered applications. stamp is the
  677. -- Unix time of the last registration; if it is -1, the current time will be used.
  678. -- If you try to remove an application by setting its registration count to zero,
  679. -- and no bookmark for uri is found, FALSE is returned and error is set to
  680. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly, in the event that no application
  681. -- name has registered a bookmark for uri, FALSE is returned and error is set to
  682. -- G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark for uri is
  683. -- found, one is created.
  684. -- bookmark : a GBookmarkFile
  685. -- uri : a valid URI
  686. -- name : an application's name
  687. -- exec : an application's command line
  688. -- count : the number of registrations done for this application
  689. -- stamp : the time of the last registration for this application
  690. -- error : return location for a GError or NULL
  691. -- Returns : TRUE if the application's meta-data was successfully changed.
  692. -- Since 2.12
  693. -- ---------------------------------------------------------------------------------
  694. -- g_bookmark_file_add_group ()
  695. -- void g_bookmark_file_add_group (GBookmarkFile *bookmark,
  696. -- const gchar *uri,
  697. -- const gchar *group);
  698. -- Adds group to the list of groups to which the bookmark for uri belongs to.
  699. -- If no bookmark for uri is found then it is created.
  700. -- bookmark : a GBookmarkFile
  701. -- uri : a valid URI
  702. -- group : the group name to be added
  703. -- Since 2.12
  704. -- ---------------------------------------------------------------------------------
  705. -- g_bookmark_file_add_application ()
  706. -- void g_bookmark_file_add_application (GBookmarkFile *bookmark,
  707. -- const gchar *uri,
  708. -- const gchar *name,
  709. -- const gchar *exec);
  710. -- Adds the application with name and exec to the list of applications that have
  711. -- registered a bookmark for uri into bookmark.
  712. -- Every bookmark inside a GBookmarkFile must have at least an application
  713. -- registered. Each application must provide a name, a command line useful for
  714. -- launching the bookmark, the number of times the bookmark has been registered by
  715. -- the application and the last time the application registered this bookmark.
  716. -- If name is NULL, the name of the application will be the same returned by
  717. -- g_get_application(); if exec is NULL, the command line will be a composition of
  718. -- the program name as returned by g_get_prgname() and the "u" modifier, which will
  719. -- be expanded to the bookmark's URI.
  720. -- This function will automatically take care of updating the registrations count
  721. -- and timestamping in case an application with the same name had already registered
  722. -- a bookmark for uri inside bookmark.
  723. -- If no bookmark for uri is found, one is created.
  724. -- bookmark : a GBookmarkFile
  725. -- uri : a valid URI
  726. -- name : the name of the application registering the bookmark or NULL
  727. -- exec : command line to be used to launch the bookmark or NULL
  728. -- Since 2.12
  729. -- ---------------------------------------------------------------------------------
  730. -- g_bookmark_file_remove_group ()
  731. -- gboolean g_bookmark_file_remove_group (GBookmarkFile *bookmark,
  732. -- const gchar *uri,
  733. -- const gchar *group,
  734. -- GError **error);
  735. -- Removes group from the list of groups to which the bookmark for uri belongs to.
  736. -- In the event the URI cannot be found, FALSE is returned and error is set to
  737. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event no group was defined, FALSE is
  738. -- returned and error is set to G_BOOKMARK_FILE_ERROR_INVALID_VALUE.
  739. -- bookmark : a GBookmarkFile
  740. -- uri : a valid URI
  741. -- group : the group name to be removed
  742. -- error : return location for a GError, or NULL
  743. -- Returns : TRUE if group was successfully removed.
  744. -- Since 2.12
  745. -- ---------------------------------------------------------------------------------
  746. -- g_bookmark_file_remove_application ()
  747. -- gboolean g_bookmark_file_remove_application
  748. -- (GBookmarkFile *bookmark,
  749. -- const gchar *uri,
  750. -- const gchar *name,
  751. -- GError **error);
  752. -- Removes application registered with name from the list of applications that have
  753. -- registered a bookmark for uri inside bookmark.
  754. -- In the event the URI cannot be found, FALSE is returned and error is set to
  755. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that no application with name
  756. -- app_name has registered a bookmark for uri, FALSE is returned and error is set to
  757. -- G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.
  758. -- bookmark : a GBookmarkFile
  759. -- uri : a valid URI
  760. -- name : the name of the application
  761. -- error : return location for a GError or NULL
  762. -- Returns : TRUE if the application was successfully removed.
  763. -- Since 2.12
  764. -- ---------------------------------------------------------------------------------
  765. -- g_bookmark_file_remove_item ()
  766. -- gboolean g_bookmark_file_remove_item (GBookmarkFile *bookmark,
  767. -- const gchar *uri,
  768. -- GError **error);
  769. -- Removes the bookmark for uri from the bookmark file bookmark.
  770. -- bookmark : a GBookmarkFile
  771. -- uri : a valid URI
  772. -- error : return location for a GError, or NULL
  773. -- Returns : TRUE if the bookmark was removed successfully.
  774. -- Since 2.12
  775. -- ---------------------------------------------------------------------------------
  776. -- g_bookmark_file_move_item ()
  777. -- gboolean g_bookmark_file_move_item (GBookmarkFile *bookmark,
  778. -- const gchar *old_uri,
  779. -- const gchar *new_uri,
  780. -- GError **error);
  781. -- Changes the URI of a bookmark item from old_uri to new_uri. Any existing bookmark
  782. -- for new_uri will be overwritten. If new_uri is NULL, then the bookmark is
  783. -- removed.
  784. -- In the event the URI cannot be found, FALSE is returned and error is set to
  785. -- G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  786. -- bookmark : a GBookmarkFile
  787. -- old_uri : a valid URI
  788. -- new_uri : a valid URI, or NULL
  789. -- error : return location for a GError or NULL
  790. -- Returns : TRUE if the URI was successfully changed
  791. -- Since 2.12
  792. end -- class GLIB_BOOKMARK_FILE_PARSER