From 201ef5f000326079a34796af26833b61ebdb97e8 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Tue, 15 Nov 2005 17:08:51 +0000 Subject: Added a function to get all attachments of the attachment bar for plugin 2005-11-15 Srinivasa Ragavan * e-attachment-bar.[ch] (e_attachment_bar_get_all_attachments): Added a function to get all attachments of the attachment bar for plugin purposes. svn path=/trunk/; revision=30620 --- widgets/misc/ChangeLog | 6 ++++++ widgets/misc/e-attachment-bar.c | 23 +++++++++++++++++++++++ widgets/misc/e-attachment-bar.h | 2 ++ 3 files changed, 31 insertions(+) (limited to 'widgets/misc') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index cb7d96988a..d2e2b007c3 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,9 @@ +2005-11-15 Srinivasa Ragavan + + * e-attachment-bar.[ch] (e_attachment_bar_get_all_attachments): Added + a function to get all attachments of the attachment bar for plugin + purposes. + 2005-11-14 Chenthill Palanisamy * e-dateedit.c: (create_children): Adjusted the size diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 2903ee4c88..5de718f914 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -600,6 +600,29 @@ e_attachment_bar_get_attachment (EAttachmentBar *bar, int id) return attachments; } +GSList * +e_attachment_bar_get_all_attachments (EAttachmentBar *bar) +{ + GSList *attachments = NULL; + GList *p; + EAttachment *attachment; + + g_return_val_if_fail (bar != NULL, 0); + g_return_val_if_fail (E_IS_ATTACHMENT_BAR (bar), 0); + + for ( p = bar->priv->attachments; p!= NULL; p = p->next) { + attachment = p->data; + if (attachment && attachment->is_available_local) { + g_object_ref (attachment); + attachments= g_slist_prepend(attachments, attachment); + } + } + + attachments = g_slist_reverse(attachments); + + return attachments; +} + /* Just the GSList has to be freed by the caller */ GSList * e_attachment_bar_get_parts (EAttachmentBar *bar) diff --git a/widgets/misc/e-attachment-bar.h b/widgets/misc/e-attachment-bar.h index 638bc5cd3c..97089c1032 100644 --- a/widgets/misc/e-attachment-bar.h +++ b/widgets/misc/e-attachment-bar.h @@ -82,6 +82,8 @@ GtkWidget ** e_attachment_bar_get_selector(EAttachmentBar *bar); GSList *e_attachment_bar_get_parts (EAttachmentBar *bar); GSList *e_attachment_bar_get_selected (EAttachmentBar *bar); void e_attachment_bar_set_width(EAttachmentBar *bar, int bar_width); +GSList * e_attachment_bar_get_all_attachments (EAttachmentBar *bar); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit