aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c15
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 598f6786cf..5d71757b60 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -284,6 +284,21 @@ get_view(EAddressbookModel *model)
return FALSE;
}
+ECard *
+e_addressbook_model_get_card(EAddressbookModel *model,
+ int row)
+{
+ if (model->data && row < model->data_count) {
+ ECard *card;
+ gtk_object_get(GTK_OBJECT(model->data[row]),
+ "card", &card,
+ NULL);
+ gtk_object_ref(GTK_OBJECT(card));
+ return card;
+ }
+ return NULL;
+}
+
static void
e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
index a428b076a9..bff9a21d00 100644
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ b/addressbook/gui/widgets/e-addressbook-model.h
@@ -45,4 +45,8 @@ typedef struct {
GtkType e_addressbook_model_get_type (void);
ETableModel *e_addressbook_model_new (void);
+/* Returns object with ref count of 1. */
+ECard *e_addressbook_model_get_card(EAddressbookModel *model,
+ int row);
+
#endif /* _E_ADDRESSBOOK_MODEL_H_ */