Osso Addressbook Reference Manual |
---|
OssoABookFilterModelOssoABookFilterModel — Filter certain contacts from a OssoABookTreeModel. |
OssoABookFilterModel; OssoABookFilterModel* osso_abook_filter_model_new (OssoABookTreeModel *child_model); 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); const char* osso_abook_filter_model_get_text (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, GtkTreeDragSource and GtkTreeSortable.
"base-model" OssoABookTreeModel : Read / Write / Construct Only "group" OssoABookGroup : Read / Write "text" gchararray : Read / Write
OssoABookFilterModel is an object that can filter contacts based on their presence in another OssoABookTreeModel
typedef struct _OssoABookFilterModel OssoABookFilterModel;
There are no public fields in OssoABookFilterModel.
OssoABookFilterModel* osso_abook_filter_model_new (OssoABookTreeModel *child_model);
Creates a new OssoABookFilterModel object filtering the contents of
child_model
.
child_model : |
An OssoABookTreeModel whose contects are to be filtered |
Returns : | A new OssoABookFilterModel object. |
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 |
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. |
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 OssoABookTreeModel |
Returns : | TRUE if the row indicated by iter satisfies the filter
requirements, FALSE otherwise.
|
base-model
" property"base-model" OssoABookTreeModel : Read / Write / Construct Only
The contained OssoABookTreeModel.
<< OssoABookGroupSelector | OssoABookTreeModel >> |