| Top |
DhBookListDhBookList — Base class for a list of DhBook's |
| DhBookList * | dh_book_list_new () |
| DhBookList * | dh_book_list_get_default () |
| GList * | dh_book_list_get_books () |
| void | dh_book_list_add_book () |
| void | dh_book_list_remove_book () |
DhBookList is a base class for a list of DhBook's.
The default implementation maintains an internal GList when books are added
and removed with the “add-book” and “remove-book”
signals, and returns that GList in dh_book_list_get_books().
The DhBookList base class doesn't listen to the DhBook “deleted” and “updated” signals. It is for example handled by DhBookListDirectory.
DhBookList *
dh_book_list_get_default (void);
Gets the default DhBookList object. It is created with DhBookListBuilder,
dh_book_list_builder_add_default_sub_book_lists() is called, and
dh_book_list_builder_read_books_disabled_setting() is called with the default
DhSettings object as returned by dh_settings_get_default().
Since: 3.30
GList *
dh_book_list_get_books (DhBookList *book_list);
Gets the list of DhBook's part of book_list
, in no particular order. Each
book ID in the list is unique (see dh_book_get_id()).
Since: 3.30
void dh_book_list_add_book (DhBookList *book_list,DhBook *book);
Emits the “add-book” signal.
It is a programmer error to call this function if book
is already inserted
in book_list
.
Since: 3.30
void dh_book_list_remove_book (DhBookList *book_list,DhBook *book);
Emits the “remove-book” signal.
It is a programmer error to call this function if book
is not present in
book_list
.
Since: 3.30
struct DhBookListClass {
GObjectClass parent_class;
/* Signals */
void (* add_book) (DhBookList *book_list,
DhBook *book);
void (* remove_book) (DhBookList *book_list,
DhBook *book);
/* Vfuncs */
GList * (* get_books) (DhBookList *book_list);
};
Virtual function pointer for the “add-book” signal. |
||
Virtual function pointer for the “remove-book” signal. |
||
Virtual function pointer for |
“add-book” signalvoid user_function (DhBookList *book_list, DhBook *book, gpointer user_data)
The ::add-book signal is emitted when a DhBook is added to a DhBookList.
The default object method handler adds book
to the internal GList
of book_list
after verifying that book
is not already present in
the list.
book_list |
the DhBookList emitting the signal. |
|
book |
the DhBook being added. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.30
“remove-book” signalvoid user_function (DhBookList *book_list, DhBook *book, gpointer user_data)
The ::remove-book signal is emitted when a DhBook is removed from a DhBookList.
The default object method handler removes book
from the internal
GList of book_list
, and verifies that book
was present in the list
and that book
was not inserted several times.
book_list |
the DhBookList emitting the signal. |
|
book |
the DhBook being removed. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.30