From a943c41ddea6d2dd8163e0de5d0d1475c141b163 Mon Sep 17 00:00:00 2001 From: "Parthasarathi@novell.com" Date: Mon, 10 Jan 2005 15:23:03 +0000 Subject: initial check in for groupwise send options 2005-01-10 Parthasarathi@novell.com * initial check in for groupwise send options svn path=/trunk/; revision=28325 --- plugins/groupwise-send-options/Changelog | 3 + plugins/groupwise-send-options/Makefile.am | 15 +++ .../org-gnome-compose-send-options.eplug.in | 25 +++++ .../org-gnome-compose-send-options.xml | 17 +++ plugins/groupwise-send-options/send-options.c | 119 +++++++++++++++++++++ plugins/groupwise-send-options/send-options.h | 40 +++++++ 6 files changed, 219 insertions(+) create mode 100644 plugins/groupwise-send-options/Changelog create mode 100644 plugins/groupwise-send-options/Makefile.am create mode 100644 plugins/groupwise-send-options/org-gnome-compose-send-options.eplug.in create mode 100644 plugins/groupwise-send-options/org-gnome-compose-send-options.xml create mode 100644 plugins/groupwise-send-options/send-options.c create mode 100644 plugins/groupwise-send-options/send-options.h (limited to 'plugins') diff --git a/plugins/groupwise-send-options/Changelog b/plugins/groupwise-send-options/Changelog new file mode 100644 index 0000000000..adaa7597c0 --- /dev/null +++ b/plugins/groupwise-send-options/Changelog @@ -0,0 +1,3 @@ +2005-01-10 Parthasarathi@novell.com + + * initial check in for groupwise send options diff --git a/plugins/groupwise-send-options/Makefile.am b/plugins/groupwise-send-options/Makefile.am new file mode 100644 index 0000000000..b30ce1f03e --- /dev/null +++ b/plugins/groupwise-send-options/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = \ + -I$(top_srcdir) \ + $(EVOLUTION_MAIL_CFLAGS) + +@EVO_PLUGIN_RULE@ + +plugin_DATA = org-gnome-compose-send-options.eplug org-gnome-compose-send-options.xml +plugin_LTLIBRARIES = liborg-gnome-compose-send-options.la + +liborg_gnome_compose_send_options_la_SOURCES = send-options.c send-options.h +liborg_gnome_compose_send_options_la_LDFLAGS = -module -avoid-version + +EXTRA_DIST = \ + org-gnome-compose-send-options.eplug.in \ + org-gnome-compose-send-options.xml diff --git a/plugins/groupwise-send-options/org-gnome-compose-send-options.eplug.in b/plugins/groupwise-send-options/org-gnome-compose-send-options.eplug.in new file mode 100644 index 0000000000..2fc06d389e --- /dev/null +++ b/plugins/groupwise-send-options/org-gnome-compose-send-options.eplug.in @@ -0,0 +1,25 @@ + + + + Lets you have the send options menu item in the composer window for groupwise mails + + + + + + + + + + + + diff --git a/plugins/groupwise-send-options/org-gnome-compose-send-options.xml b/plugins/groupwise-send-options/org-gnome-compose-send-options.xml new file mode 100644 index 0000000000..c5947c6a33 --- /dev/null +++ b/plugins/groupwise-send-options/org-gnome-compose-send-options.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/plugins/groupwise-send-options/send-options.c b/plugins/groupwise-send-options/send-options.c new file mode 100644 index 0000000000..4311efd817 --- /dev/null +++ b/plugins/groupwise-send-options/send-options.c @@ -0,0 +1,119 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Authors: Parthasarathi Susarla + * + * Copyright 2004 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. + * + */ + + +#include +#include +#include +#include +#include + +#include +#include + +#include "send-options.h" + +#include "mail/em-menu.h" +#include "mail/em-utils.h" + +#include "composer/e-msg-composer.h" +#include "e-util/e-account.h" + +#include "widgets/misc/e-send-options.h" + +static ESendOptionsDialog * dialog ; + +void org_gnome_compose_send_options (EPlugin *ep, EMMenuTargetWidget *t); + +void +org_gnome_compose_send_options (EPlugin *ep, EMMenuTargetWidget *t) +{ + struct _EMenuTarget menu = t->target ; + EMsgComposer *comp = (struct _EMsgComposer *)menu.widget ; + EAccount *account = NULL ; + char *url, *temp = NULL ; + + account = e_msg_composer_get_preferred_account (comp) ; + url = g_strdup (account->transport->url) ; + temp = strstr (url, "groupwise") ; + if (!temp) { + g_print ("Sorry send options only available for a groupwise account\n") ; + goto done ; + } + g_free (temp) ; + /*disply the send options dialog*/ + if (!dialog) { + g_print ("New dialog\n\n") ; + dialog = e_sendoptions_dialog_new () ; + } + + e_sendoptions_dialog_run (dialog, menu.widget, E_ITEM_MAIL) ; + + return ; + /*General Options*/ + + if (dialog->data->gopts->reply_enabled) { + if (dialog->data->gopts->reply_convenient) + e_msg_composer_add_header (comp, X_REPLY_CONVENIENT ,"1" ) ; + else if (dialog->data->gopts->reply_within) { + temp = g_strdup_printf ("%d", dialog->data->gopts->reply_within) ; + e_msg_composer_add_header (comp, X_REPLY_WITHIN , temp) ; + g_free (temp) ; + } + } + + if (dialog->data->gopts->expiration_enabled) { + if (dialog->data->gopts->expire_after != 0) { + temp = g_strdup_printf ("%d", dialog->data->gopts->expire_after) ; + e_msg_composer_add_header (comp, X_EXPIRE_AFTER, temp) ; + g_free (temp) ; + } + } + if (dialog->data->gopts->delay_enabled) { + + e_msg_composer_add_header (comp, X_DELAY_UNTIL, temp) ; + g_free (temp) ; + } + + /*Status Tracking Options*/ + if (dialog->data->sopts->tracking_enabled) { + temp = g_strdup_printf ("%d",dialog->data->sopts->track_when) ; + e_msg_composer_add_header (comp, X_TRACK_WHEN, temp) ; + g_free (temp) ; + } + + if (dialog->data->sopts->autodelete) { + e_msg_composer_add_header (comp, X_AUTODELETE, "1") ; + } + if (dialog->data->sopts->opened) { + temp = g_strdup_printf ("%d",dialog->data->sopts->opened) ; + e_msg_composer_add_header (comp, X_RETURN_NOTIFY_OPEN, temp) ; + g_free (temp) ; + } + if (dialog->data->sopts->declined) { + temp = g_strdup_printf ("%d",dialog->data->sopts->declined) ; + e_msg_composer_add_header (comp, X_RETURN_NOTIFY_DECLINE, temp) ; + g_free (temp) ; + } +done: + g_free (url) ; +} + diff --git a/plugins/groupwise-send-options/send-options.h b/plugins/groupwise-send-options/send-options.h new file mode 100644 index 0000000000..76c79a2a00 --- /dev/null +++ b/plugins/groupwise-send-options/send-options.h @@ -0,0 +1,40 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * + * Authors: Parthasarathi Susarla + * + * Copyright 2004 Novell, Inc. (www.novell.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __GW_SEND_OPTIONS__ +#define __GW_SEND_OPTIONS__ + +/*Headers for send options*/ +#define X_SEND_OPTIONS "X-gw-send-options" +/*General Options*/ +#define X_SEND_OPT_PRIORITY "X-gw-send-opt-priority" +#define X_REPLY_CONVENIENT "X-reply-convenient" +#define X_REPLY_WITHIN "X-reply-within" +#define X_EXPIRE_AFTER "X-expire-after" +#define X_DELAY_UNTIL "X-delay-until" + +/*Status Tracking Options*/ +#define X_TRACK_WHEN "X-track-when" +#define X_AUTODELETE "X-auto-delete" +#define X_RETURN_NOTIFY_OPEN "X-return-notify-open" +#define X_RETURN_NOTIFY_DECLINE "X-return-notify-decline" + +#endif /*__GW_SEND_OPTIONS__*/ -- cgit