![]() |
![]() |
![]() |
Osso Addressbook Reference Manual | ![]() |
---|---|---|---|---|
OssoABookFilterModelOssoABookFilterModel — Filter certain contacts from a OssoABookListStore. |
OssoABookFilterModel; OssoABookFilterModel* osso_abook_filter_model_new (OssoABookListStore *child_model); void osso_abook_filter_model_set_visible_func (OssoABookFilterModel *model, GtkTreeModelFilterVisibleFunc func, gpointer data, GDestroyNotify destroy); void osso_abook_filter_model_set_group (OssoABookFilterModel *model, OssoABookGroup *group); OssoABookGroup* osso_abook_filter_model_get_group (OssoABookFilterModel *model); void osso_abook_filter_model_set_text (OssoABookFilterModel *model, const char *text); void osso_abook_filter_model_set_prefix (OssoABookFilterModel *model, const char *prefix); const char* osso_abook_filter_model_get_text (OssoABookFilterModel *model); gboolean osso_abook_filter_model_get_prefix (OssoABookFilterModel *model); void osso_abook_filter_model_freeze_refilter (OssoABookFilterModel *model); void osso_abook_filter_model_thaw_refilter (OssoABookFilterModel *model); PangoAttrList* osso_abook_filter_model_get_markup (OssoABookFilterModel *model, const char *text); gboolean osso_abook_filter_model_is_row_visible (OssoABookFilterModel *model, GtkTreeIter *iter);
OssoABookFilterModel implements GtkTreeModel, GtkTreeSortable, GtkTreeDragDest, GtkTreeDragSource and OssoABookRowModel.
"base-model" OssoABookListStore* : Read / Write / Construct Only "group" OssoABookGroup* : Read / Write "prefix" gboolean : Read / Write "text" gchar* : Read / Write
OssoABookFilterModel is an object that can filter contacts based on their presence in another OssoABookListStore
typedef struct _OssoABookFilterModel OssoABookFilterModel;
All the fields of this structure are private to the object's implementation and should never be accessed directly.
OssoABookFilterModel* osso_abook_filter_model_new (OssoABookListStore *child_model);
Creates a new OssoABookFilterModel object filtering the contents of
child_model
.
child_model : |
An OssoABookListStore whose contects are to be filtered |
Returns : | A new OssoABookFilterModel object. |
void osso_abook_filter_model_set_visible_func (OssoABookFilterModel *model, GtkTreeModelFilterVisibleFunc func, gpointer data, GDestroyNotify destroy);
Sets a custom function to determine whether items in the model are visibile or not
model : |
a OssoABookFilterModel |
func : |
a function to determine visibility |
data : |
additional data to pass to func
|
destroy : |
an optional function to call to free data when no longer needed
|
void osso_abook_filter_model_set_group (OssoABookFilterModel *model, OssoABookGroup *group);
Sets model
to filter on group
, only letting through
EContact - OssoABookPresence combinations that satisfy group
.
(And the text set by osso_abook_filter_model_set_text()
, if any)
model : |
An OssoABookFilterModel |
group : |
The OssoABookGroup to be filtered on |
OssoABookGroup* osso_abook_filter_model_get_group (OssoABookFilterModel *model);
Retrieves the OssoABookGroup that is being filtered on.
model : |
An OssoABookFilterModel |
Returns : | The OssoABookGroup that is being filtered on. |
void osso_abook_filter_model_set_text (OssoABookFilterModel *model, const char *text);
Sets model
to filter on text
, only letting through
EContacts whose names contain text
.
(And the group set by osso_abook_filter_model_set_group()
, if any)
text
is split up into bits, using space as delimiter. The order in which
the bits
appear in the searched text is not of importance. Case and accents
are ignored. This means that for example "Elvis Presley" matches
"Presley Elvis", and that "Björk" matches "bjork".
model : |
An OssoABookFilterModel |
text : |
The string to be filtered on |
void osso_abook_filter_model_set_prefix (OssoABookFilterModel *model, const char *prefix);
works like osso_abook_filter_model_set_text with the difference that this version matches prefixes only
model : |
An OssoABookFilterModel |
prefix : |
The string to be filtered on |
const char* osso_abook_filter_model_get_text (OssoABookFilterModel *model);
Retrieves the text that is being filtered on.
model : |
An OssoABookFilterModel |
Returns : | The text that is being filtered on. The string is owned by libosso-abook and should not be freed. |
gboolean osso_abook_filter_model_get_prefix (OssoABookFilterModel *model);
Determines wether the filter text applies to full-text or prefix only
model : |
An OssoABookFilterModel |
Returns : | TRUE for prefix only filtering, FALSE for full-text |
void osso_abook_filter_model_freeze_refilter (OssoABookFilterModel *model);
Freezes the filter. This means that any calls to
osso_abook_filter_model_set_group()
or osso_abook_filter_model_set_text()
will not have any effect until osso_abook_filter_model_thaw_refilter()
is called.
Use this function if you need to change the group and the text at the same time. The rows will then be refiltered only once.
model : |
An OssoABookFilterModel |
void osso_abook_filter_model_thaw_refilter (OssoABookFilterModel *model);
Thaws the filter. See osso_abook_filter_model_freeze_refilter()
for
details.
model : |
An OssoABookFilterModel |
PangoAttrList* osso_abook_filter_model_get_markup (OssoABookFilterModel *model, const char *text);
Generates a PangoAttrList containing markup information to highlight
any found bits of the filter text in text
.
model : |
An OssoABookFilterModel |
text : |
The text to retrieve the markup for |
Returns : | A newly allocated PangoAttrList. |
gboolean osso_abook_filter_model_is_row_visible (OssoABookFilterModel *model, GtkTreeIter *iter);
Determines whether the row indicated by iter
is visible, i.e. satisfies
the filter requirements.
model : |
An OssoABookFilterModel |
iter : |
A GtkTreeIter of the contained OssoABookListStore |
Returns : | TRUE if the row indicated by iter satisfies the filter
requirements, FALSE otherwise.
|
"base-model"
property"base-model" OssoABookListStore* : Read / Write / Construct Only
The contained OssoABookListStore.
"prefix"
property"prefix" gboolean : Read / Write
Wether or not only prefixes are matched.
Default value: FALSE