OssoABookFilterModel

OssoABookFilterModel — Filter certain contacts from a OssoABookTreeModel.

Synopsis




            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);


Object Hierarchy


  GObject
   +----GtkTreeModelFilter
         +----OssoABookFilterModel

Implemented Interfaces

OssoABookFilterModel implements GtkTreeModel, GtkTreeDragSource and GtkTreeSortable.

Properties


  "base-model"           OssoABookTreeModel    : Read / Write / Construct Only
  "group"                OssoABookGroup        : Read / Write
  "text"                 gchararray            : Read / Write

Description

OssoABookFilterModel is an object that can filter contacts based on their presence in another OssoABookTreeModel

Details

OssoABookFilterModel

typedef struct _OssoABookFilterModel OssoABookFilterModel;

There are no public fields in OssoABookFilterModel.


osso_abook_filter_model_new ()

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.

osso_abook_filter_model_set_group ()

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

osso_abook_filter_model_get_group ()

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.

osso_abook_filter_model_set_text ()

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

osso_abook_filter_model_get_text ()

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.

osso_abook_filter_model_freeze_refilter ()

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

osso_abook_filter_model_thaw_refilter ()

void        osso_abook_filter_model_thaw_refilter
                                            (OssoABookFilterModel *model);

Thaws the filter. See osso_abook_filter_model_freeze_refilter() for details.

model : An OssoABookFilterModel

osso_abook_filter_model_get_markup ()

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.

osso_abook_filter_model_is_row_visible ()

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.

Properties

The "base-model" property

  "base-model"           OssoABookTreeModel    : Read / Write / Construct Only

The contained OssoABookTreeModel.


The "group" property

  "group"                OssoABookGroup        : Read / Write

The group to be filtered on.


The "text" property

  "text"                 gchararray            : Read / Write

The text to be filtered on.

Default value: NULL

See Also

OssoABookTreeModel, OssoABookTreeView