PageRenderTime 31ms CodeModel.GetById 17ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

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