BookmarkFile

The GBookmarkFile structure contains only private data and should not be directly accessed.

class BookmarkFile {}

Constructors

this
this(GBookmarkFile* gBookmarkFile, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new empty #GBookmarkFile object.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addApplication
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.

addGroup
void addGroup(string uri, string group)

Adds @group to the list of groups to which the bookmark for @uri belongs to.

free
void free()

Frees a #GBookmarkFile.

getAdded
uint getAdded(string uri)

Gets the time the bookmark for @uri was added to @bookmark

getAppInfo
bool getAppInfo(string uri, string name, string exec, uint count, uint stamp)

Gets the registration informations of @app_name for the bookmark for @uri. See g_bookmark_file_set_app_info() for more informations about the returned data.

getApplications
string[] getApplications(string uri)

Retrieves the names of the applications that have registered the bookmark for @uri.

getBookmarkFileStruct
GBookmarkFile* getBookmarkFileStruct(bool transferOwnership)

Get the main Gtk struct

getDescription
string getDescription(string uri)

Retrieves the description of the bookmark for @uri.

getGroups
string[] getGroups(string uri)

Retrieves the list of group names of the bookmark for @uri.

getIcon
bool getIcon(string uri, string href, string mimeType)

Gets the icon of the bookmark for @uri.

getIsPrivate
bool getIsPrivate(string uri)

Gets whether the private flag of the bookmark for @uri is set.

getMimeType
string getMimeType(string uri)

Retrieves the MIME type of the resource pointed by @uri.

getModified
uint getModified(string uri)

Gets the time when the bookmark for @uri was last modified.

getSize
int getSize()

Gets the number of bookmarks inside @bookmark.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTitle
string getTitle(string uri)

Returns the title of the bookmark for @uri.

getUris
string[] getUris()

Returns all URIs of the bookmarks in the bookmark file @bookmark. The array of returned URIs will be %NULL-terminated, so @length may optionally be %NULL.

getVisited
uint getVisited(string uri)

Gets the time the bookmark for @uri was last visited.

hasApplication
bool hasApplication(string uri, string name)

Checks whether the bookmark for @uri inside @bookmark has been registered by application @name.

hasGroup
bool hasGroup(string uri, string group)

Checks whether @group appears in the list of groups to which the bookmark for @uri belongs to.

hasItem
bool hasItem(string uri)

Looks whether the desktop bookmark has an item with its URI set to @uri.

loadFromData
bool loadFromData(string data, size_t length)

Loads a bookmark file from memory into an empty #GBookmarkFile structure. If the object cannot be created then @error is set to a #GBookmarkFileError.

loadFromDataDirs
bool loadFromDataDirs(string file, string fullPath)

This function looks for a desktop bookmark file named @file in the paths returned from g_get_user_data_dir() and g_get_system_data_dirs(), loads the file into @bookmark and returns the file's full path in @full_path. If the file could not be loaded then an %error is set to either a #GFileError or #GBookmarkFileError.

loadFromFile
bool loadFromFile(string filename)

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.

moveItem
bool moveItem(string oldUri, string newUri)

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.

removeApplication
bool removeApplication(string uri, string name)

Removes application registered with @name from the list of applications that have registered a bookmark for @uri inside @bookmark.

removeGroup
bool removeGroup(string uri, string group)

Removes @group from the list of groups to which the bookmark for @uri belongs to.

removeItem
bool removeItem(string uri)

Removes the bookmark for @uri from the bookmark file @bookmark.

setAdded
void setAdded(string uri, uint added)

Sets the time the bookmark for @uri was added into @bookmark.

setAppInfo
bool setAppInfo(string uri, string name, string exec, int count, uint stamp)

Sets the meta-data of application @name inside the list of applications that have registered a bookmark for @uri inside @bookmark.

setDescription
void setDescription(string uri, string description)

Sets @description as the description of the bookmark for @uri.

setGroups
void setGroups(string uri, string[] groups)

Sets a list of group names for the item with URI @uri. Each previously set group name list is removed.

setIcon
void setIcon(string uri, string href, string mimeType)

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.

setIsPrivate
void setIsPrivate(string uri, bool isPrivate)

Sets the private flag of the bookmark for @uri.

setMimeType
void setMimeType(string uri, string mimeType)

Sets @mime_type as the MIME type of the bookmark for @uri.

setModified
void setModified(string uri, uint modified)

Sets the last time the bookmark for @uri was last modified.

setTitle
void setTitle(string uri, string title)

Sets @title as the title of the bookmark for @uri inside the bookmark file @bookmark.

setVisited
void setVisited(string uri, uint visited)

Sets the time the bookmark for @uri was last visited.

toData
string toData(size_t length)

This function outputs @bookmark as a string.

toFile
bool toFile(string filename)

This function outputs @bookmark into a file. The write process is guaranteed to be atomic by using g_file_set_contents() internally.

Static functions

errorQuark
GQuark errorQuark()

Variables

gBookmarkFile
GBookmarkFile* gBookmarkFile;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta