Package ch.bailu.gtk.glib
Klasse BookmarkFile
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.glib.BookmarkFile
- Alle implementierten Schnittstellen:
PointerInterface
`GBookmarkFile` lets you parse, edit or create files containing bookmarks.
Bookmarks refer to a URI, along with some meta-data about the resource
pointed by the URI like its MIME type, the application that is registering
the bookmark and the icon that should be used to represent the bookmark.
The data is stored using the
[Desktop Bookmark Specification](https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec/).
The syntax of the bookmark files is described in detail inside the
Desktop Bookmark Specification, here is a quick summary: bookmark
files use a sub-class of the XML Bookmark Exchange Language
specification, consisting of valid UTF-8 encoded XML, under the
`<xbel>` root element; each bookmark is stored inside a
`<bookmark>` element, using its URI: no relative paths can
be used inside a bookmark file. The bookmark may have a user defined
title and description, to be used instead of the URI. Under the
`<metadata>` element, with its owner attribute set to
`http://freedesktop.org`, is stored the meta-data about a resource
pointed by its URI. The meta-data consists of the resource's MIME
type; the applications that have registered a bookmark; the groups
to which a bookmark belongs to; a visibility flag, used to set the
bookmark as "private" to the applications and groups that has it
registered; the URI and MIME type of an icon, to be used when
displaying the bookmark inside a GUI.
Here is an example of a bookmark file:
[bookmarks.xbel](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/glib/tests/bookmarks.xbel)
A bookmark file might contain more than one bookmark; each bookmark
is accessed through its URI.
The important caveat of bookmark files is that when you add a new
bookmark you must also add the application that is registering it, using
[method@GLib.BookmarkFile.add_application] or [method@GLib.BookmarkFile.set_application_info].
If a bookmark has no applications then it won't be dumped when creating
the on disk representation, using [method@GLib.BookmarkFile.to_data] or
[method@GLib.BookmarkFile.to_file].
Bookmarks refer to a URI, along with some meta-data about the resource
pointed by the URI like its MIME type, the application that is registering
the bookmark and the icon that should be used to represent the bookmark.
The data is stored using the
[Desktop Bookmark Specification](https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec/).
The syntax of the bookmark files is described in detail inside the
Desktop Bookmark Specification, here is a quick summary: bookmark
files use a sub-class of the XML Bookmark Exchange Language
specification, consisting of valid UTF-8 encoded XML, under the
`<xbel>` root element; each bookmark is stored inside a
`<bookmark>` element, using its URI: no relative paths can
be used inside a bookmark file. The bookmark may have a user defined
title and description, to be used instead of the URI. Under the
`<metadata>` element, with its owner attribute set to
`http://freedesktop.org`, is stored the meta-data about a resource
pointed by its URI. The meta-data consists of the resource's MIME
type; the applications that have registered a bookmark; the groups
to which a bookmark belongs to; a visibility flag, used to set the
bookmark as "private" to the applications and groups that has it
registered; the URI and MIME type of an icon, to be used when
displaying the bookmark inside a GUI.
Here is an example of a bookmark file:
[bookmarks.xbel](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/glib/tests/bookmarks.xbel)
A bookmark file might contain more than one bookmark; each bookmark
is accessed through its URI.
The important caveat of bookmark files is that when you add a new
bookmark you must also add the application that is registering it, using
[method@GLib.BookmarkFile.add_application] or [method@GLib.BookmarkFile.set_application_info].
If a bookmark has no applications then it won't be dumped when creating
the on disk representation, using [method@GLib.BookmarkFile.to_data] or
[method@GLib.BookmarkFile.to_file].
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates a new empty #GBookmarkFile object.BookmarkFile
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addApplication
(Str uri, Str name, Str exec) Adds the application with @name and @exec to the list of
applications that have registered a bookmark for @uri into
@bookmark.void
addApplication
(String uri, String name, String exec) Adds the application with @name and @exec to the list of
applications that have registered a bookmark for @uri into
@bookmark.void
Adds @group to the list of groups to which the bookmark for @uri
belongs to.void
Adds @group to the list of groups to which the bookmark for @uri
belongs to.copy()
Deeply copies a @bookmark #GBookmarkFile object to a new one.static int
void
free()
Frees a #GBookmarkFile.long
Veraltet.long
Veraltet.getAddedDateTime
(Str uri) Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.getAddedDateTime
(String uri) Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.static ClassHandler
getDescription
(Str uri) Retrieves the description of the bookmark for @uri.getDescription
(String uri) Retrieves the description of the bookmark for @uri.static int
boolean
getIsPrivate
(Str uri) Gets whether the private flag of the bookmark for @uri is set.boolean
getIsPrivate
(String uri) Gets whether the private flag of the bookmark for @uri is set.getMimeType
(Str uri) Retrieves the MIME type of the resource pointed by @uri.getMimeType
(String uri) Retrieves the MIME type of the resource pointed by @uri.long
getModified
(Str uri) Veraltet.long
getModified
(String uri) Veraltet.getModifiedDateTime
(Str uri) Gets the time when the bookmark for @uri was last modified.Gets the time when the bookmark for @uri was last modified.static long
static TypeSystem.TypeSize
int
getSize()
Gets the number of bookmarks inside @bookmark.Returns the title of the bookmark for @uri.Returns the title of the bookmark for @uri.static long
static TypeSystem.TypeSize
long
getVisited
(Str uri) Veraltet.long
getVisited
(String uri) Veraltet.getVisitedDateTime
(Str uri) Gets the time the bookmark for @uri was last visited.getVisitedDateTime
(String uri) Gets the time the bookmark for @uri was last visited.boolean
hasApplication
(Str uri, Str name) Checks whether the bookmark for @uri inside @bookmark has been
registered by application @name.boolean
hasApplication
(String uri, String name) Checks whether the bookmark for @uri inside @bookmark has been
registered by application @name.boolean
Checks whether @group appears in the list of groups to which
the bookmark for @uri belongs to.boolean
Checks whether @group appears in the list of groups to which
the bookmark for @uri belongs to.boolean
Looks whether the desktop bookmark has an item with its URI set to @uri.boolean
Looks whether the desktop bookmark has an item with its URI set to @uri.boolean
loadFromData
(Str data, long length) Loads a bookmark file from memory into an empty #GBookmarkFile
structure.boolean
loadFromData
(String data, long length) Loads a bookmark file from memory into an empty #GBookmarkFile
structure.boolean
loadFromFile
(Str filename) Loads a desktop bookmark file into an empty #GBookmarkFile structure.boolean
loadFromFile
(String filename) Loads a desktop bookmark file into an empty #GBookmarkFile structure.boolean
Changes the URI of a bookmark item from @old_uri to @new_uri.boolean
Changes the URI of a bookmark item from @old_uri to @new_uri.boolean
removeApplication
(Str uri, Str name) Removes application registered with @name from the list of applications
that have registered a bookmark for @uri inside @bookmark.boolean
removeApplication
(String uri, String name) Removes application registered with @name from the list of applications
that have registered a bookmark for @uri inside @bookmark.boolean
removeGroup
(Str uri, Str group) Removes @group from the list of groups to which the bookmark
for @uri belongs to.boolean
removeGroup
(String uri, String group) Removes @group from the list of groups to which the bookmark
for @uri belongs to.boolean
removeItem
(Str uri) Removes the bookmark for @uri from the bookmark file @bookmark.boolean
removeItem
(String uri) Removes the bookmark for @uri from the bookmark file @bookmark.void
Veraltet.void
Veraltet.void
setAddedDateTime
(Str uri, DateTime added) Sets the time the bookmark for @uri was added into @bookmark.void
setAddedDateTime
(String uri, DateTime added) Sets the time the bookmark for @uri was added into @bookmark.boolean
setAppInfo
(Str uri, Str name, Str exec, int count, long stamp) Veraltet.boolean
setAppInfo
(String uri, String name, String exec, int count, long stamp) Veraltet.boolean
setApplicationInfo
(Str uri, Str name, Str exec, int count, DateTime stamp) Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.boolean
setApplicationInfo
(String uri, String name, String exec, int count, DateTime stamp) Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.void
setDescription
(Str uri, Str description) Sets @description as the description of the bookmark for @uri.void
setDescription
(String uri, String description) Sets @description as the description of the bookmark for @uri.void
Sets the icon for the bookmark for @uri.void
Sets the icon for the bookmark for @uri.void
setIsPrivate
(Str uri, boolean is_private) Sets the private flag of the bookmark for @uri.void
setIsPrivate
(String uri, boolean is_private) Sets the private flag of the bookmark for @uri.void
setMimeType
(Str uri, Str mime_type) Sets @mime_type as the MIME type of the bookmark for @uri.void
setMimeType
(String uri, String mime_type) Sets @mime_type as the MIME type of the bookmark for @uri.void
setModified
(Str uri, long modified) Veraltet.void
setModified
(String uri, long modified) Veraltet.void
setModifiedDateTime
(Str uri, DateTime modified) Sets the last time the bookmark for @uri was last modified.void
setModifiedDateTime
(String uri, DateTime modified) Sets the last time the bookmark for @uri was last modified.void
Sets @title as the title of the bookmark for @uri inside the
bookmark file @bookmark.void
Sets @title as the title of the bookmark for @uri inside the
bookmark file @bookmark.void
setVisited
(Str uri, long visited) Veraltet.void
setVisited
(String uri, long visited) Veraltet.void
setVisitedDateTime
(Str uri, DateTime visited) Sets the time the bookmark for @uri was last visited.void
setVisitedDateTime
(String uri, DateTime visited) Sets the time the bookmark for @uri was last visited.This function outputs @bookmark as a string.boolean
This function outputs @bookmark into a file.boolean
This function outputs @bookmark into a file.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
BookmarkFile
-
BookmarkFile
public BookmarkFile()Creates a new empty #GBookmarkFile object.
Use g_bookmark_file_load_from_file(), g_bookmark_file_load_from_data()
or g_bookmark_file_load_from_data_dirs() to read an existing bookmark
file.
-
-
Methodendetails
-
getClassHandler
-
addApplication
Adds the application with @name and @exec to the list of
applications that have registered a bookmark for @uri into
@bookmark.
Every bookmark inside a #GBookmarkFile must have at least an
application registered. Each application must provide a name, a
command line useful for launching the bookmark, the number of times
the bookmark has been registered by the application and the last
time the application registered this bookmark.
If @name is %NULL, the name of the application will be the
same returned by g_get_application_name(); if @exec is %NULL, the
command line will be a composition of the program name as
returned by g_get_prgname() and the "\%u" modifier, which will be
expanded to the bookmark's URI.
This function will automatically take care of updating the
registrations count and timestamping in case an application
with the same @name had already registered a bookmark for
@uri inside @bookmark.
If no bookmark for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- the name of the application registering the bookmark or %NULLexec
- command line to be used to launch the bookmark or %NULL
-
addApplication
Adds the application with @name and @exec to the list of
applications that have registered a bookmark for @uri into
@bookmark.
Every bookmark inside a #GBookmarkFile must have at least an
application registered. Each application must provide a name, a
command line useful for launching the bookmark, the number of times
the bookmark has been registered by the application and the last
time the application registered this bookmark.
If @name is %NULL, the name of the application will be the
same returned by g_get_application_name(); if @exec is %NULL, the
command line will be a composition of the program name as
returned by g_get_prgname() and the "\%u" modifier, which will be
expanded to the bookmark's URI.
This function will automatically take care of updating the
registrations count and timestamping in case an application
with the same @name had already registered a bookmark for
@uri inside @bookmark.
If no bookmark for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- the name of the application registering the bookmark or %NULLexec
- command line to be used to launch the bookmark or %NULL
-
addGroup
Adds @group to the list of groups to which the bookmark for @uri
belongs to.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIgroup
- the group name to be added
-
addGroup
Adds @group to the list of groups to which the bookmark for @uri
belongs to.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIgroup
- the group name to be added
-
copy
Deeply copies a @bookmark #GBookmarkFile object to a new one.- Gibt zurück:
- the copy of @bookmark. Use g_bookmark_free() when finished using it.
-
free
public void free()Frees a #GBookmarkFile. -
getAdded
Veraltet.Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp
- Löst aus:
AllocationError
-
getAdded
Veraltet.Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp
- Löst aus:
AllocationError
-
getAddedDateTime
Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
getAddedDateTime
Gets the time the bookmark for @uri was added to @bookmark
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
getDescription
Retrieves the description of the bookmark for @uri.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getDescription
Retrieves the description of the bookmark for @uri.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getIsPrivate
Gets whether the private flag of the bookmark for @uri is set.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
event that the private flag cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if the private flag is set, %FALSE otherwise.
- Löst aus:
AllocationError
-
getIsPrivate
Gets whether the private flag of the bookmark for @uri is set.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
event that the private flag cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if the private flag is set, %FALSE otherwise.
- Löst aus:
AllocationError
-
getMimeType
Retrieves the MIME type of the resource pointed by @uri.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
event that the MIME type cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URI- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getMimeType
Retrieves the MIME type of the resource pointed by @uri.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
event that the MIME type cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URI- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getModified
Veraltet.Gets the time when the bookmark for @uri was last modified.
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp
- Löst aus:
AllocationError
-
getModified
Veraltet.Gets the time when the bookmark for @uri was last modified.
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp
- Löst aus:
AllocationError
-
getModifiedDateTime
Gets the time when the bookmark for @uri was last modified.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
getModifiedDateTime
Gets the time when the bookmark for @uri was last modified.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
getSize
public int getSize()Gets the number of bookmarks inside @bookmark.- Gibt zurück:
- the number of bookmarks
-
getTitle
Returns the title of the bookmark for @uri.
If @uri is %NULL, the title of @bookmark is returned.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI or %NULL- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getTitle
Returns the title of the bookmark for @uri.
If @uri is %NULL, the title of @bookmark is returned.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI or %NULL- Gibt zurück:
- a newly allocated string or %NULL if the specified URI cannot be found.
- Löst aus:
AllocationError
-
getVisited
Veraltet.Gets the time the bookmark for @uri was last visited.
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp.
- Löst aus:
AllocationError
-
getVisited
Veraltet.Gets the time the bookmark for @uri was last visited.
In the event the URI cannot be found, -1 is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a timestamp.
- Löst aus:
AllocationError
-
getVisitedDateTime
Gets the time the bookmark for @uri was last visited.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
getVisitedDateTime
Gets the time the bookmark for @uri was last visited.
In the event the URI cannot be found, %NULL is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URI- Gibt zurück:
- a #GDateTime
- Löst aus:
AllocationError
-
hasApplication
Checks whether the bookmark for @uri inside @bookmark has been
registered by application @name.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URIname
- the name of the application- Gibt zurück:
- %TRUE if the application @name was found
- Löst aus:
AllocationError
-
hasApplication
Checks whether the bookmark for @uri inside @bookmark has been
registered by application @name.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URIname
- the name of the application- Gibt zurück:
- %TRUE if the application @name was found
- Löst aus:
AllocationError
-
hasGroup
Checks whether @group appears in the list of groups to which
the bookmark for @uri belongs to.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URIgroup
- the group name to be searched- Gibt zurück:
- %TRUE if @group was found.
- Löst aus:
AllocationError
-
hasGroup
Checks whether @group appears in the list of groups to which
the bookmark for @uri belongs to.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
uri
- a valid URIgroup
- the group name to be searched- Gibt zurück:
- %TRUE if @group was found.
- Löst aus:
AllocationError
-
hasItem
Looks whether the desktop bookmark has an item with its URI set to @uri.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if @uri is inside @bookmark, %FALSE otherwise
-
hasItem
Looks whether the desktop bookmark has an item with its URI set to @uri.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if @uri is inside @bookmark, %FALSE otherwise
-
loadFromData
Loads a bookmark file from memory into an empty #GBookmarkFile
structure. If the object cannot be created then @error is set to a
#GBookmarkFileError.- Parameter:
data
- desktop bookmarks loaded in memorylength
- the length of @data in bytes- Gibt zurück:
- %TRUE if a desktop bookmark could be loaded.
- Löst aus:
AllocationError
-
loadFromData
Loads a bookmark file from memory into an empty #GBookmarkFile
structure. If the object cannot be created then @error is set to a
#GBookmarkFileError.- Parameter:
data
- desktop bookmarks loaded in memorylength
- the length of @data in bytes- Gibt zurück:
- %TRUE if a desktop bookmark could be loaded.
- Löst aus:
AllocationError
-
loadFromFile
Loads a desktop bookmark file into an empty #GBookmarkFile structure.
If the file could not be loaded then @error is set to either a #GFileError
or #GBookmarkFileError.- Parameter:
filename
- the path of a filename to load, in the GLib file name encoding- Gibt zurück:
- %TRUE if a desktop bookmark file could be loaded
- Löst aus:
AllocationError
-
loadFromFile
Loads a desktop bookmark file into an empty #GBookmarkFile structure.
If the file could not be loaded then @error is set to either a #GFileError
or #GBookmarkFileError.- Parameter:
filename
- the path of a filename to load, in the GLib file name encoding- Gibt zurück:
- %TRUE if a desktop bookmark file could be loaded
- Löst aus:
AllocationError
-
moveItem
Changes the URI of a bookmark item from @old_uri to @new_uri. Any
existing bookmark for @new_uri will be overwritten. If @new_uri is
%NULL, then the bookmark is removed.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
old_uri
- a valid URInew_uri
- a valid URI, or %NULL- Gibt zurück:
- %TRUE if the URI was successfully changed
- Löst aus:
AllocationError
-
moveItem
Changes the URI of a bookmark item from @old_uri to @new_uri. Any
existing bookmark for @new_uri will be overwritten. If @new_uri is
%NULL, then the bookmark is removed.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.- Parameter:
old_uri
- a valid URInew_uri
- a valid URI, or %NULL- Gibt zurück:
- %TRUE if the URI was successfully changed
- Löst aus:
AllocationError
-
removeApplication
Removes application registered with @name from the list of applications
that have registered a bookmark for @uri inside @bookmark.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
In the event that no application with name @app_name has registered
a bookmark for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.- Parameter:
uri
- a valid URIname
- the name of the application- Gibt zurück:
- %TRUE if the application was successfully removed.
- Löst aus:
AllocationError
-
removeApplication
Removes application registered with @name from the list of applications
that have registered a bookmark for @uri inside @bookmark.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
In the event that no application with name @app_name has registered
a bookmark for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.- Parameter:
uri
- a valid URIname
- the name of the application- Gibt zurück:
- %TRUE if the application was successfully removed.
- Löst aus:
AllocationError
-
removeGroup
Removes @group from the list of groups to which the bookmark
for @uri belongs to.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
In the event no group was defined, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URIgroup
- the group name to be removed- Gibt zurück:
- %TRUE if @group was successfully removed.
- Löst aus:
AllocationError
-
removeGroup
Removes @group from the list of groups to which the bookmark
for @uri belongs to.
In the event the URI cannot be found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
In the event no group was defined, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_INVALID_VALUE.- Parameter:
uri
- a valid URIgroup
- the group name to be removed- Gibt zurück:
- %TRUE if @group was successfully removed.
- Löst aus:
AllocationError
-
removeItem
Removes the bookmark for @uri from the bookmark file @bookmark.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if the bookmark was removed successfully.
- Löst aus:
AllocationError
-
removeItem
Removes the bookmark for @uri from the bookmark file @bookmark.- Parameter:
uri
- a valid URI- Gibt zurück:
- %TRUE if the bookmark was removed successfully.
- Löst aus:
AllocationError
-
setAdded
Veraltet.Sets the time the bookmark for @uri was added into @bookmark.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIadded
- a timestamp or -1 to use the current time
-
setAdded
Veraltet.Sets the time the bookmark for @uri was added into @bookmark.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIadded
- a timestamp or -1 to use the current time
-
setAddedDateTime
Sets the time the bookmark for @uri was added into @bookmark.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIadded
- a #GDateTime
-
setAddedDateTime
Sets the time the bookmark for @uri was added into @bookmark.
If no bookmark for @uri is found then it is created.- Parameter:
uri
- a valid URIadded
- a #GDateTime
-
setAppInfo
@Deprecated public boolean setAppInfo(@Nonnull Str uri, @Nonnull Str name, @Nonnull Str exec, int count, long stamp) throws AllocationError Veraltet.Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.
You should rarely use this function; use g_bookmark_file_add_application()
and g_bookmark_file_remove_application() instead.
@name can be any UTF-8 encoded string used to identify an
application.
@exec can have one of these two modifiers: "\%f", which will
be expanded as the local file name retrieved from the bookmark's
URI; "\%u", which will be expanded as the bookmark's URI.
The expansion is done automatically when retrieving the stored
command line using the g_bookmark_file_get_application_info() function.
@count is the number of times the application has registered the
bookmark; if is < 0, the current registration count will be increased
by one, if is 0, the application with @name will be removed from
the list of registered applications.
@stamp is the Unix time of the last registration; if it is -1, the
current time will be used.
If you try to remove an application by setting its registration count to
zero, and no bookmark for @uri is found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
in the event that no application @name has registered a bookmark
for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- an application's nameexec
- an application's command linecount
- the number of registrations done for this applicationstamp
- the time of the last registration for this application- Gibt zurück:
- %TRUE if the application's meta-data was successfully changed.
- Löst aus:
AllocationError
-
setAppInfo
@Deprecated public boolean setAppInfo(String uri, String name, String exec, int count, long stamp) throws AllocationError Veraltet.Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.
You should rarely use this function; use g_bookmark_file_add_application()
and g_bookmark_file_remove_application() instead.
@name can be any UTF-8 encoded string used to identify an
application.
@exec can have one of these two modifiers: "\%f", which will
be expanded as the local file name retrieved from the bookmark's
URI; "\%u", which will be expanded as the bookmark's URI.
The expansion is done automatically when retrieving the stored
command line using the g_bookmark_file_get_application_info() function.
@count is the number of times the application has registered the
bookmark; if is < 0, the current registration count will be increased
by one, if is 0, the application with @name will be removed from
the list of registered applications.
@stamp is the Unix time of the last registration; if it is -1, the
current time will be used.
If you try to remove an application by setting its registration count to
zero, and no bookmark for @uri is found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
in the event that no application @name has registered a bookmark
for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- an application's nameexec
- an application's command linecount
- the number of registrations done for this applicationstamp
- the time of the last registration for this application- Gibt zurück:
- %TRUE if the application's meta-data was successfully changed.
- Löst aus:
AllocationError
-
setApplicationInfo
public boolean setApplicationInfo(@Nonnull Str uri, @Nonnull Str name, @Nonnull Str exec, int count, @Nullable DateTime stamp) throws AllocationError Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.
You should rarely use this function; use g_bookmark_file_add_application()
and g_bookmark_file_remove_application() instead.
@name can be any UTF-8 encoded string used to identify an
application.
@exec can have one of these two modifiers: "\%f", which will
be expanded as the local file name retrieved from the bookmark's
URI; "\%u", which will be expanded as the bookmark's URI.
The expansion is done automatically when retrieving the stored
command line using the g_bookmark_file_get_application_info() function.
@count is the number of times the application has registered the
bookmark; if is < 0, the current registration count will be increased
by one, if is 0, the application with @name will be removed from
the list of registered applications.
@stamp is the Unix time of the last registration.
If you try to remove an application by setting its registration count to
zero, and no bookmark for @uri is found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
in the event that no application @name has registered a bookmark
for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- an application's nameexec
- an application's command linecount
- the number of registrations done for this applicationstamp
- the time of the last registration for this application, which may be %NULL if @count is 0- Gibt zurück:
- %TRUE if the application's meta-data was successfully changed.
- Löst aus:
AllocationError
-
setApplicationInfo
public boolean setApplicationInfo(String uri, String name, String exec, int count, @Nullable DateTime stamp) throws AllocationError Sets the meta-data of application @name inside the list of
applications that have registered a bookmark for @uri inside
@bookmark.
You should rarely use this function; use g_bookmark_file_add_application()
and g_bookmark_file_remove_application() instead.
@name can be any UTF-8 encoded string used to identify an
application.
@exec can have one of these two modifiers: "\%f", which will
be expanded as the local file name retrieved from the bookmark's
URI; "\%u", which will be expanded as the bookmark's URI.
The expansion is done automatically when retrieving the stored
command line using the g_bookmark_file_get_application_info() function.
@count is the number of times the application has registered the
bookmark; if is < 0, the current registration count will be increased
by one, if is 0, the application with @name will be removed from
the list of registered applications.
@stamp is the Unix time of the last registration.
If you try to remove an application by setting its registration count to
zero, and no bookmark for @uri is found, %FALSE is returned and
@error is set to %G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
in the event that no application @name has registered a bookmark
for @uri, %FALSE is returned and error is set to
%G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
for @uri is found, one is created.- Parameter:
uri
- a valid URIname
- an application's nameexec
- an application's command linecount
- the number of registrations done for this applicationstamp
- the time of the last registration for this application, which may be %NULL if @count is 0- Gibt zurück:
- %TRUE if the application's meta-data was successfully changed.
- Löst aus:
AllocationError
-
setDescription
Sets @description as the description of the bookmark for @uri.
If @uri is %NULL, the description of @bookmark is set.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URI or %NULLdescription
- a string
-
setDescription
Sets @description as the description of the bookmark for @uri.
If @uri is %NULL, the description of @bookmark is set.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URI or %NULLdescription
- a string
-
setIcon
Sets the icon for the bookmark for @uri. If @href is %NULL, unsets
the currently set icon. @href can either be a full URL for the icon
file or the icon name following the Icon Naming specification.
If no bookmark for @uri is found one is created.- Parameter:
uri
- a valid URIhref
- the URI of the icon for the bookmark, or %NULLmime_type
- the MIME type of the icon for the bookmark
-
setIcon
Sets the icon for the bookmark for @uri. If @href is %NULL, unsets
the currently set icon. @href can either be a full URL for the icon
file or the icon name following the Icon Naming specification.
If no bookmark for @uri is found one is created.- Parameter:
uri
- a valid URIhref
- the URI of the icon for the bookmark, or %NULLmime_type
- the MIME type of the icon for the bookmark
-
setIsPrivate
Sets the private flag of the bookmark for @uri.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URIis_private
- %TRUE if the bookmark should be marked as private
-
setIsPrivate
Sets the private flag of the bookmark for @uri.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URIis_private
- %TRUE if the bookmark should be marked as private
-
setMimeType
Sets @mime_type as the MIME type of the bookmark for @uri.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URImime_type
- a MIME type
-
setMimeType
Sets @mime_type as the MIME type of the bookmark for @uri.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URImime_type
- a MIME type
-
setModified
Veraltet.Sets the last time the bookmark for @uri was last modified.
If no bookmark for @uri is found then it is created.
The "modified" time should only be set when the bookmark's meta-data
was actually changed. Every function of #GBookmarkFile that
modifies a bookmark also changes the modification time, except for
g_bookmark_file_set_visited_date_time().- Parameter:
uri
- a valid URImodified
- a timestamp or -1 to use the current time
-
setModified
Veraltet.Sets the last time the bookmark for @uri was last modified.
If no bookmark for @uri is found then it is created.
The "modified" time should only be set when the bookmark's meta-data
was actually changed. Every function of #GBookmarkFile that
modifies a bookmark also changes the modification time, except for
g_bookmark_file_set_visited_date_time().- Parameter:
uri
- a valid URImodified
- a timestamp or -1 to use the current time
-
setModifiedDateTime
Sets the last time the bookmark for @uri was last modified.
If no bookmark for @uri is found then it is created.
The "modified" time should only be set when the bookmark's meta-data
was actually changed. Every function of #GBookmarkFile that
modifies a bookmark also changes the modification time, except for
g_bookmark_file_set_visited_date_time().- Parameter:
uri
- a valid URImodified
- a #GDateTime
-
setModifiedDateTime
Sets the last time the bookmark for @uri was last modified.
If no bookmark for @uri is found then it is created.
The "modified" time should only be set when the bookmark's meta-data
was actually changed. Every function of #GBookmarkFile that
modifies a bookmark also changes the modification time, except for
g_bookmark_file_set_visited_date_time().- Parameter:
uri
- a valid URImodified
- a #GDateTime
-
setTitle
Sets @title as the title of the bookmark for @uri inside the
bookmark file @bookmark.
If @uri is %NULL, the title of @bookmark is set.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URI or %NULLtitle
- a UTF-8 encoded string
-
setTitle
Sets @title as the title of the bookmark for @uri inside the
bookmark file @bookmark.
If @uri is %NULL, the title of @bookmark is set.
If a bookmark for @uri cannot be found then it is created.- Parameter:
uri
- a valid URI or %NULLtitle
- a UTF-8 encoded string
-
setVisited
Veraltet.Sets the time the bookmark for @uri was last visited.
If no bookmark for @uri is found then it is created.
The "visited" time should only be set if the bookmark was launched,
either using the command line retrieved by g_bookmark_file_get_application_info()
or by the default application for the bookmark's MIME type, retrieved
using g_bookmark_file_get_mime_type(). Changing the "visited" time
does not affect the "modified" time.- Parameter:
uri
- a valid URIvisited
- a timestamp or -1 to use the current time
-
setVisited
Veraltet.Sets the time the bookmark for @uri was last visited.
If no bookmark for @uri is found then it is created.
The "visited" time should only be set if the bookmark was launched,
either using the command line retrieved by g_bookmark_file_get_application_info()
or by the default application for the bookmark's MIME type, retrieved
using g_bookmark_file_get_mime_type(). Changing the "visited" time
does not affect the "modified" time.- Parameter:
uri
- a valid URIvisited
- a timestamp or -1 to use the current time
-
setVisitedDateTime
Sets the time the bookmark for @uri was last visited.
If no bookmark for @uri is found then it is created.
The "visited" time should only be set if the bookmark was launched,
either using the command line retrieved by g_bookmark_file_get_application_info()
or by the default application for the bookmark's MIME type, retrieved
using g_bookmark_file_get_mime_type(). Changing the "visited" time
does not affect the "modified" time.- Parameter:
uri
- a valid URIvisited
- a #GDateTime
-
setVisitedDateTime
Sets the time the bookmark for @uri was last visited.
If no bookmark for @uri is found then it is created.
The "visited" time should only be set if the bookmark was launched,
either using the command line retrieved by g_bookmark_file_get_application_info()
or by the default application for the bookmark's MIME type, retrieved
using g_bookmark_file_get_mime_type(). Changing the "visited" time
does not affect the "modified" time.- Parameter:
uri
- a valid URIvisited
- a #GDateTime
-
toData
This function outputs @bookmark as a string.- Parameter:
length
- return location for the length of the returned string, or %NULL- Gibt zurück:
- a newly allocated string holding the contents of the #GBookmarkFile
- Löst aus:
AllocationError
-
toFile
This function outputs @bookmark into a file. The write process is
guaranteed to be atomic by using g_file_set_contents() internally.- Parameter:
filename
- path of the output file- Gibt zurück:
- %TRUE if the file was successfully written.
- Löst aus:
AllocationError
-
toFile
This function outputs @bookmark into a file. The write process is
guaranteed to be atomic by using g_file_set_contents() internally.- Parameter:
filename
- path of the output file- Gibt zurück:
- %TRUE if the file was successfully written.
- Löst aus:
AllocationError
-
errorQuark
public static int errorQuark()- Gibt zurück:
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-