Top |
Functions
DhBook * | dh_book_new () |
GFile * | dh_book_get_index_file () |
const gchar * | dh_book_get_id () |
const gchar * | dh_book_get_title () |
const gchar * | dh_book_get_language () |
GList * | dh_book_get_links () |
GNode * | dh_book_get_tree () |
DhCompletion * | dh_book_get_completion () |
gboolean | dh_book_get_enabled () |
void | dh_book_set_enabled () |
gint | dh_book_cmp_by_id () |
gint | dh_book_cmp_by_title () |
Description
A DhBook usually contains the documentation for one library (or
application), for example GLib or GTK+. A DhBook corresponds to one index
file. An index file is a file with the extension *.devhelp
, *.devhelp2
,
*.devhelp.gz
or *.devhelp2.gz
.
DhBook creates a GFileMonitor on the index file, and emits the “updated” or “deleted” signal in case the index file has changed on the filesystem. DhBookManager listens to those DhBook signals, and emits in turn the “book-deleted” and “book-created” signals.
Functions
dh_book_get_id ()
const gchar *
dh_book_get_id (DhBook *book
);
Gets the book ID. In the Devhelp index file format version 2, it is actually the “name”, not the ID, but “book ID” is clearer, “book name” can be confused with the title.
dh_book_get_tree ()
GNode *
dh_book_get_tree (DhBook *book
);
Gets the general structure of the book, as a tree. The tree contains only
DhLink's of type DH_LINK_TYPE_BOOK
or DH_LINK_TYPE_PAGE
. The other
DhLink's are not contained in the tree. To have a list of
all DhLink's part of the book, you need to call
dh_book_get_links()
.
dh_book_set_enabled ()
void dh_book_set_enabled (DhBook *book
,gboolean enabled
);
Enables or disables the book.
dh_book_cmp_by_id ()
gint dh_book_cmp_by_id (DhBook *a
,DhBook *b
);
Compares the DhBook's by their IDs, with g_ascii_strcasecmp()
.
Signal Details
The “deleted”
signal
void user_function (DhBook *book, gpointer user_data)
The ::deleted signal is emitted when the index file has been deleted from the filesystem.
Parameters
book |
the DhBook emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “disabled”
signal
void user_function (DhBook *book, gpointer user_data)
Parameters
book |
the DhBook emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “enabled”
signal
void user_function (DhBook *book, gpointer user_data)
Parameters
book |
the DhBook emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “updated”
signal
void user_function (DhBook *book, gpointer user_data)
The ::updated signal is emitted when the index file has been modified (but the file still exists).
Parameters
book |
the DhBook emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last