[anjal] Composer : Removed composer header widgets. Use it from evolution.



commit a74fb6616d0f7aca15a41dd128ec8ec73ee265ad
Author: Johnny Jacob <jjohnny novell com>
Date:   Mon Mar 23 11:08:22 2009 +0530

    Composer : Removed composer header widgets. Use it from evolution.
---
 src/Makefile.am               |    6 -
 src/e-composer-from-header.c  |  180 ---------------------
 src/e-composer-from-header.h  |   84 ----------
 src/e-composer-header-table.c |    6 +-
 src/e-composer-name-header.c  |  346 -----------------------------------------
 src/e-composer-name-header.h  |   84 ----------
 src/e-composer-text-header.c  |  151 ------------------
 src/e-composer-text-header.h  |   74 ---------
 8 files changed, 3 insertions(+), 928 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index c8df564..51e9f91 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,18 +40,12 @@ anjal_SOURCES = \
 	mail-message-view.c \
 	mail-message-view.h \
 	e-composer-common.h \
-	e-composer-from-header.c \
-	e-composer-from-header.h \
 	e-msg-composer-utils.c \
 	e-msg-composer-utils.h \
 	e-composer-header.c \
 	e-composer-header.h \
 	e-composer-header-table.c \
 	e-composer-header-table.h \
-	e-composer-name-header.c \
-	e-composer-name-header.h \
-	e-composer-text-header.c \
-	e-composer-text-header.h \
 	e-msg-composer.h \
 	e-msg-composer.c \
 	simple-editor.c \
diff --git a/src/e-composer-from-header.c b/src/e-composer-from-header.c
deleted file mode 100644
index 68b6c0c..0000000
--- a/src/e-composer-from-header.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#include "e-composer-from-header.h"
-
-/* Convenience macro */
-#define E_COMPOSER_FROM_HEADER_GET_COMBO_BOX(header) \
-	(E_ACCOUNT_COMBO_BOX (E_COMPOSER_HEADER (header)->input_widget))
-
-enum {
-	REFRESHED,
-	LAST_SIGNAL
-};
-
-static gpointer parent_class;
-static guint signal_ids[LAST_SIGNAL];
-
-static void
-composer_from_header_changed_cb (EAccountComboBox *combo_box,
-                                 EComposerFromHeader *header)
-{
-	g_signal_emit_by_name (header, "changed");
-}
-
-static void
-composer_from_header_refreshed_cb (EAccountComboBox *combo_box,
-                                   EComposerFromHeader *header)
-{
-	g_signal_emit (header, signal_ids[REFRESHED], 0);
-}
-
-static void
-composer_from_header_class_init (EComposerFromHeaderClass *class)
-{
-	parent_class = g_type_class_peek_parent (class);
-
-	signal_ids[REFRESHED] = g_signal_new (
-		"refreshed",
-		G_TYPE_FROM_CLASS (class),
-		G_SIGNAL_RUN_LAST,
-		0, NULL, NULL,
-		g_cclosure_marshal_VOID__VOID,
-		G_TYPE_NONE, 0);
-}
-
-static void
-composer_from_header_init (EComposerFromHeader *header)
-{
-	GtkWidget *widget;
-
-	widget = g_object_ref_sink (e_account_combo_box_new ());
-	g_signal_connect (
-		widget, "changed",
-		G_CALLBACK (composer_from_header_changed_cb), header);
-	g_signal_connect (
-		widget, "refreshed",
-		G_CALLBACK (composer_from_header_refreshed_cb), header);
-	E_COMPOSER_HEADER (header)->input_widget = widget;
-}
-
-GType
-e_composer_from_header_get_type (void)
-{
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EComposerFromHeaderClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) composer_from_header_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EComposerFromHeader),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) composer_from_header_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_COMPOSER_HEADER, "EComposerFromHeader",
-			&type_info, 0);
-	}
-
-	return type;
-}
-
-EComposerHeader *
-e_composer_from_header_new (const gchar *label)
-{
-	return g_object_new (
-		E_TYPE_COMPOSER_FROM_HEADER, "label", label,
-		"button", FALSE, NULL);
-}
-
-EAccountList *
-e_composer_from_header_get_account_list (EComposerFromHeader *header)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_val_if_fail (E_IS_COMPOSER_FROM_HEADER (header), NULL);
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	return e_account_combo_box_get_account_list (combo_box);
-}
-
-void
-e_composer_from_header_set_account_list (EComposerFromHeader *header,
-                                         EAccountList *account_list)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_if_fail (E_IS_COMPOSER_FROM_HEADER (header));
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	e_account_combo_box_set_account_list (combo_box, account_list);
-}
-
-EAccount *
-e_composer_from_header_get_active (EComposerFromHeader *header)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_val_if_fail (E_IS_COMPOSER_FROM_HEADER (header), NULL);
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	return e_account_combo_box_get_active (combo_box);
-}
-
-gboolean
-e_composer_from_header_set_active (EComposerFromHeader *header,
-                                   EAccount *account)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_val_if_fail (E_IS_COMPOSER_FROM_HEADER (header), FALSE);
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	return e_account_combo_box_set_active (combo_box, account);
-}
-
-const gchar *
-e_composer_from_header_get_active_name (EComposerFromHeader *header)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_val_if_fail (E_IS_COMPOSER_FROM_HEADER (header), NULL);
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	return e_account_combo_box_get_active_name (combo_box);
-}
-
-gboolean
-e_composer_from_header_set_active_name (EComposerFromHeader *header,
-                                        const gchar *account_name)
-{
-	EAccountComboBox *combo_box;
-
-	g_return_val_if_fail (E_IS_COMPOSER_FROM_HEADER (header), FALSE);
-
-	combo_box = E_COMPOSER_FROM_HEADER_GET_COMBO_BOX (header);
-	return e_account_combo_box_set_active_name (combo_box, account_name);
-}
diff --git a/src/e-composer-from-header.h b/src/e-composer-from-header.h
deleted file mode 100644
index f8c6dc6..0000000
--- a/src/e-composer-from-header.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef E_COMPOSER_FROM_HEADER_H
-#define E_COMPOSER_FROM_HEADER_H
-
-#include "e-composer-common.h"
-
-#include <libedataserver/e-account.h>
-#include <libedataserver/e-account-list.h>
-
-#include <misc/e-account-combo-box.h>
-#include "e-composer-header.h"
-
-/* Standard GObject macros */
-#define E_TYPE_COMPOSER_FROM_HEADER \
-	(e_composer_from_header_get_type ())
-#define E_COMPOSER_FROM_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_CAST \
-	((obj), E_TYPE_COMPOSER_FROM_HEADER, EComposerFromHeader))
-#define E_COMPOSER_FROM_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_CAST \
-	((obj), E_TYPE_COMPOSER_FROM_HEADER, EComposerFromHeaderClass))
-#define E_IS_COMPOSER_FROM_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_TYPE \
-	((obj), E_TYPE_COMPOSER_FROM_HEADER))
-#define E_IS_COMPOSER_FROM_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_TYPE \
-	((obj), E_TYPE_COMPOSER_FROM_HEADER))
-#define E_COMPOSER_FROM_HEADER_GET_CLASS(obj) \
-	(G_TYPE_INSTANCE_GET_CLASS \
-	((obj), E_TYPE_COMPOSER_FROM_HEADER, EComposerFromHeaderClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EComposerFromHeader EComposerFromHeader;
-typedef struct _EComposerFromHeaderClass EComposerFromHeaderClass;
-
-struct _EComposerFromHeader {
-	EComposerHeader parent;
-};
-
-struct _EComposerFromHeaderClass {
-	EComposerHeaderClass parent_class;
-};
-
-GType		e_composer_from_header_get_type	(void);
-EComposerHeader * e_composer_from_header_new	(const gchar *label);
-EAccountList *	e_composer_from_header_get_account_list
-						(EComposerFromHeader *header);
-void		e_composer_from_header_set_account_list
-						(EComposerFromHeader *header,
-						 EAccountList *account_list);
-EAccount *	e_composer_from_header_get_active
-						(EComposerFromHeader *header);
-gboolean	e_composer_from_header_set_active
-						(EComposerFromHeader *header,
-						 EAccount *account);
-const gchar *	e_composer_from_header_get_active_name
-						(EComposerFromHeader *header);
-gboolean	e_composer_from_header_set_active_name
-						(EComposerFromHeader *header,
-						 const gchar *account_name);
-
-G_END_DECLS
-
-#endif /* E_COMPOSER_FROM_HEADER_H */
diff --git a/src/e-composer-header-table.c b/src/e-composer-header-table.c
index 3081a98..b3769dc 100644
--- a/src/e-composer-header-table.c
+++ b/src/e-composer-header-table.c
@@ -25,9 +25,9 @@
 #include <glib/gi18n-lib.h>
 #include <libedataserverui/e-name-selector.h>
 
-#include "e-composer-from-header.h"
-#include "e-composer-name-header.h"
-#include "e-composer-text-header.h"
+#include <composer/e-composer-from-header.h>
+#include <composer/e-composer-name-header.h>
+#include <composer/e-composer-text-header.h>
 
 #define E_COMPOSER_HEADER_TABLE_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/src/e-composer-name-header.c b/src/e-composer-name-header.c
deleted file mode 100644
index ed96312..0000000
--- a/src/e-composer-name-header.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#include "e-composer-name-header.h"
-
-#include <glib/gi18n.h>
-
-/* XXX Temporary kludge */
-/* #include "addressbook/gui/contact-editor/e-contact-editor.h" */
-/* #include "addressbook/gui/contact-list-editor/e-contact-list-editor.h" */
-
-#define E_COMPOSER_NAME_HEADER_GET_PRIVATE(obj) \
-	(G_TYPE_INSTANCE_GET_PRIVATE \
-	((obj), E_TYPE_COMPOSER_NAME_HEADER, EComposerNameHeaderPrivate))
-
-/* Convenience macro */
-#define E_COMPOSER_NAME_HEADER_GET_ENTRY(header) \
-	(E_NAME_SELECTOR_ENTRY (E_COMPOSER_HEADER (header)->input_widget))
-
-enum {
-	PROP_0,
-	PROP_NAME_SELECTOR
-};
-
-struct _EComposerNameHeaderPrivate {
-	ENameSelector *name_selector;
-	guint destination_index;
-};
-
-static gpointer parent_class;
-
-static void
-composer_name_header_clicked_cb (EComposerNameHeader *header)
-{
-	ENameSelectorDialog *dialog;
-
-	dialog = e_name_selector_peek_dialog (header->priv->name_selector);
-	e_name_selector_dialog_set_destination_index (
-		dialog, header->priv->destination_index);
-	gtk_dialog_run (GTK_DIALOG (dialog));
-	gtk_widget_hide (GTK_WIDGET (dialog));
-}
-
-static void
-composer_name_header_entry_changed_cb (ENameSelectorEntry *entry,
-                                       EComposerNameHeader *header)
-{
-	g_signal_emit_by_name (header, "changed");
-}
-
-static gboolean
-composer_name_header_entry_query_tooltip_cb (GtkEntry *entry,
-                                             gint x,
-                                             gint y,
-                                             gboolean keyboard_mode,
-                                             GtkTooltip *tooltip)
-{
-	const gchar *text;
-
-	text = gtk_entry_get_text (entry);
-
-	if (keyboard_mode || text == NULL || *text == '\0')
-		return FALSE;
-
-	gtk_tooltip_set_text (tooltip, text);
-
-	return TRUE;
-}
-
-static GObject *
-composer_name_header_constructor (GType type,
-                                  guint n_construct_properties,
-                                  GObjectConstructParam *construct_properties)
-{
-	EComposerNameHeaderPrivate *priv;
-	ENameSelectorModel *model;
-	ENameSelectorEntry *entry;
-	GObject *object;
-	gchar *label;
-
-	/* Chain up to parent's constructor() method. */
-	object = G_OBJECT_CLASS (parent_class)->constructor (
-		type, n_construct_properties, construct_properties);
-
-	priv = E_COMPOSER_NAME_HEADER_GET_PRIVATE (object);
-	g_assert (E_IS_NAME_SELECTOR (priv->name_selector));
-
-	model = e_name_selector_peek_model (priv->name_selector);
-	label = e_composer_header_get_label (E_COMPOSER_HEADER (object));
-	g_assert (label != NULL);
-
-	/* XXX Peeking at private data. */
-	priv->destination_index = model->sections->len;
-	e_name_selector_model_add_section (model, label, label, NULL);
-
-	e_composer_header_set_title_tooltip (
-		E_COMPOSER_HEADER (object),
-		_("Click here for the address book"));
-
-	entry = E_NAME_SELECTOR_ENTRY (
-		e_name_selector_peek_section_list (
-		priv->name_selector, label));
-
-	g_signal_connect (
-		entry, "changed",
-		G_CALLBACK (composer_name_header_entry_changed_cb), object);
-	g_signal_connect (
-		entry, "query-tooltip",
-		G_CALLBACK (composer_name_header_entry_query_tooltip_cb),
-		NULL);
-	E_COMPOSER_HEADER (object)->input_widget = g_object_ref_sink (entry);
-
-	g_signal_connect (
-		object, "clicked",
-		G_CALLBACK (composer_name_header_clicked_cb), NULL);
-
-	return object;
-}
-
-static void
-composer_name_header_set_property (GObject *object,
-                                   guint property_id,
-                                   const GValue *value,
-                                   GParamSpec *pspec)
-{
-	EComposerNameHeaderPrivate *priv;
-
-	priv = E_COMPOSER_NAME_HEADER_GET_PRIVATE (object);
-
-	switch (property_id) {
-		case PROP_NAME_SELECTOR:	/* construct only */
-			g_assert (priv->name_selector == NULL);
-			priv->name_selector = g_value_dup_object (value);
-			return;
-	}
-
-	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-composer_name_header_get_property (GObject *object,
-                                   guint property_id,
-                                   GValue *value,
-                                   GParamSpec *pspec)
-{
-	switch (property_id) {
-		case PROP_NAME_SELECTOR:	/* construct only */
-			g_value_set_object (
-				value,
-				e_composer_name_header_get_name_selector (
-				E_COMPOSER_NAME_HEADER (object)));
-			return;
-	}
-
-	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-composer_name_header_dispose (GObject *object)
-{
-	EComposerNameHeaderPrivate *priv;
-
-	priv = E_COMPOSER_NAME_HEADER_GET_PRIVATE (object);
-
-	if (priv->name_selector != NULL) {
-		g_object_unref (priv->name_selector);
-		priv->name_selector = NULL;
-	}
-
-	/* Chain up to parent's dispose() method. */
-	G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-composer_name_header_class_init (EComposerNameHeaderClass *class)
-{
-	GObjectClass *object_class;
-
-	parent_class = g_type_class_peek_parent (class);
-	g_type_class_add_private (class, sizeof (EComposerNameHeaderPrivate));
-
-	object_class = G_OBJECT_CLASS (class);
-	object_class->constructor = composer_name_header_constructor;
-	object_class->set_property = composer_name_header_set_property;
-	object_class->get_property = composer_name_header_get_property;
-	object_class->dispose = composer_name_header_dispose;
-
-	g_object_class_install_property (
-		object_class,
-		PROP_NAME_SELECTOR,
-		g_param_spec_object (
-			"name-selector",
-			NULL,
-			NULL,
-			E_TYPE_NAME_SELECTOR,
-			G_PARAM_READWRITE |
-			G_PARAM_CONSTRUCT_ONLY));
-}
-
-static void
-composer_name_header_init (EComposerNameHeader *header)
-{
-	header->priv = E_COMPOSER_NAME_HEADER_GET_PRIVATE (header);
-}
-
-GType
-e_composer_name_header_get_type (void)
-{
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EComposerNameHeaderClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) composer_name_header_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EComposerNameHeader),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) composer_name_header_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_COMPOSER_HEADER, "EComposerNameHeader",
-			&type_info, 0);
-	}
-
-	return type;
-}
-
-EComposerHeader *
-e_composer_name_header_new (const gchar *label,
-                            ENameSelector *name_selector)
-{
-	g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL);
-
-	return g_object_new (
-		E_TYPE_COMPOSER_NAME_HEADER, "label", label,
-		"button", TRUE, "name-selector", name_selector, NULL);
-}
-
-EComposerHeader *
-e_composer_name_header_new_with_label (const gchar *label,
-				  ENameSelector *name_selector)
-{
-	return g_object_new (
-		E_TYPE_COMPOSER_NAME_HEADER, "label", label,
-		"button", FALSE,  "name-selector", name_selector,
-		"addaction", FALSE, "visible", TRUE,
-		NULL);
-}
-
-EComposerHeader *
-e_composer_name_header_new_with_action (const gchar *label,
-					const gchar *action_label,
-					ENameSelector *name_selector)
-{
-	g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL);
-
-	return g_object_new (
-		E_TYPE_COMPOSER_NAME_HEADER, "label", label,
-		"button", FALSE, "name-selector", name_selector, 
-		"addaction_text", action_label,
-		"addaction", action_label != NULL,
-		NULL);
-}
-
-ENameSelector *
-e_composer_name_header_get_name_selector (EComposerNameHeader *header)
-{
-	g_return_val_if_fail (E_IS_COMPOSER_NAME_HEADER (header), NULL);
-
-	return header->priv->name_selector;
-}
-
-EDestination **
-e_composer_name_header_get_destinations (EComposerNameHeader *header)
-{
-	EDestinationStore *store;
-	EDestination **destinations;
-	ENameSelectorEntry *entry;
-	GList *list, *iter;
-	gint ii = 0;
-
-	g_return_val_if_fail (E_IS_COMPOSER_NAME_HEADER (header), NULL);
-
-	entry = E_COMPOSER_NAME_HEADER_GET_ENTRY (header);
-	store = e_name_selector_entry_peek_destination_store (entry);
-
-	list = e_destination_store_list_destinations (store);
-	destinations = g_new0 (EDestination *, g_list_length (list) + 1);
-
-	for (iter = list; iter != NULL; iter = iter->next)
-		destinations[ii++] = g_object_ref (iter->data);
-
-	g_list_free (list);
-
-	return destinations;  /* free with e_destination_freev() */
-}
-
-void
-e_composer_name_header_set_destinations (EComposerNameHeader *header,
-                                         EDestination **destinations)
-{
-	EDestinationStore *store;
-	ENameSelectorEntry *entry;
-	GList *list, *iter;
-	gint ii;
-
-	g_return_if_fail (E_IS_COMPOSER_NAME_HEADER (header));
-
-	entry = E_COMPOSER_NAME_HEADER_GET_ENTRY (header);
-	store = e_name_selector_entry_peek_destination_store (entry);
-
-	/* Clear the destination store. */
-	list = e_destination_store_list_destinations (store);
-	for (iter = list; iter != NULL; iter = iter->next)
-		e_destination_store_remove_destination (store, iter->data);
-	g_list_free (list);
-
-	if (destinations == NULL)
-		return;
-
-	for (ii = 0; destinations[ii] != NULL; ii++)
-		e_destination_store_append_destination (
-			store, destinations[ii]);
-}
diff --git a/src/e-composer-name-header.h b/src/e-composer-name-header.h
deleted file mode 100644
index 92a379b..0000000
--- a/src/e-composer-name-header.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- */
-
-#ifndef E_COMPOSER_NAME_HEADER_H
-#define E_COMPOSER_NAME_HEADER_H
-
-#include "e-composer-common.h"
-
-#include <libebook/e-destination.h>
-#include <libedataserverui/e-name-selector.h>
-
-#include "e-composer-header.h"
-
-/* Standard GObject macros */
-#define E_TYPE_COMPOSER_NAME_HEADER \
-	(e_composer_name_header_get_type ())
-#define E_COMPOSER_NAME_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_CAST \
-	((obj), E_TYPE_COMPOSER_NAME_HEADER, EComposerNameHeader))
-#define E_COMPOSER_NAME_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_CAST \
-	((cls), E_TYPE_COMPOSER_NAME_HEADER, EComposerNameHeaderClass))
-#define E_IS_COMPOSER_NAME_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_TYPE \
-	((obj), E_TYPE_COMPOSER_NAME_HEADER))
-#define E_IS_COMPOSER_NAME_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_TYPE \
-	((cls), E_TYPE_COMPOSER_NAME_HEADER))
-#define E_COMPOSER_NAME_HEADER_GET_CLASS(obj) \
-	(G_TYPE_INSTANCE_GET_CLASS \
-	((obj), E_TYPE_COMPOSER_NAME_HEADER, EComposerNameHeaderClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EComposerNameHeader EComposerNameHeader;
-typedef struct _EComposerNameHeaderClass EComposerNameHeaderClass;
-typedef struct _EComposerNameHeaderPrivate EComposerNameHeaderPrivate;
-
-struct _EComposerNameHeader {
-	EComposerHeader parent;
-	EComposerNameHeaderPrivate *priv;
-};
-
-struct _EComposerNameHeaderClass {
-	EComposerHeaderClass parent_class;
-};
-
-GType		e_composer_name_header_get_type	(void);
-EComposerHeader * e_composer_name_header_new	(const gchar *label,
-						 ENameSelector *name_selector);
-/*No button. Just a label.*/
-EComposerHeader * e_composer_name_header_new_with_label	(const gchar *label,
-							 ENameSelector *name_selector);
-
-/*No button. Label with a Link button for show/hide.*/
-EComposerHeader * e_composer_name_header_new_with_action (const gchar *label,
-							  const gchar *action,
-							  ENameSelector *name_selector);
-
-ENameSelector *	e_composer_name_header_get_name_selector
-						(EComposerNameHeader *header);
-EDestination **	e_composer_name_header_get_destinations
-						(EComposerNameHeader *header);
-void		e_composer_name_header_set_destinations
-						(EComposerNameHeader *header,
-						 EDestination **destinations);
-
-G_END_DECLS
-
-#endif /* E_COMPOSER_NAME_HEADER_H */
diff --git a/src/e-composer-text-header.c b/src/e-composer-text-header.c
deleted file mode 100644
index bfb3237..0000000
--- a/src/e-composer-text-header.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*Modified for Anjal - Johnny Jacob <jjohnny novell com>*/
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- */
-
-#include "e-composer-text-header.h"
-
-/* Convenience macro */
-#define E_COMPOSER_TEXT_HEADER_GET_ENTRY(header) \
-	(GTK_ENTRY (E_COMPOSER_HEADER (header)->input_widget))
-
-struct _EComposerTextHeaderPrivate {
-	GtkLinkButton *linkbtn;
-	guint destination_index;
-};
-
-static gpointer parent_class;
-
-static void
-composer_text_header_changed_cb (GtkEntry *entry,
-                                 EComposerTextHeader *header)
-{
-	g_signal_emit_by_name (header, "changed");
-}
-
-static gboolean
-composer_text_header_query_tooltip_cb (GtkEntry *entry,
-                                       gint x,
-                                       gint y,
-                                       gboolean keyboard_mode,
-                                       GtkTooltip *tooltip)
-{
-	const gchar *text;
-
-	text = gtk_entry_get_text (entry);
-
-	if (keyboard_mode || text == NULL || *text == '\0')
-		return FALSE;
-
-	gtk_tooltip_set_text (tooltip, text);
-
-	return TRUE;
-}
-
-static void
-composer_text_header_class_init (EComposerTextHeaderClass *class)
-{
-	parent_class = g_type_class_peek_parent (class);
-}
-
-static void
-composer_text_header_init (EComposerTextHeader *header)
-{
-	GtkWidget *widget;
-
-	widget = g_object_ref_sink (gtk_entry_new ());
-	g_signal_connect (
-		widget, "changed",
-		G_CALLBACK (composer_text_header_changed_cb), header);
-	g_signal_connect (
-		widget, "query-tooltip",
-		G_CALLBACK (composer_text_header_query_tooltip_cb), NULL);
-	gtk_widget_set_has_tooltip (widget, TRUE);
-	E_COMPOSER_HEADER (header)->input_widget = widget;
-}
-
-GType
-e_composer_text_header_get_type (void)
-{
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EComposerTextHeaderClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) composer_text_header_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EComposerTextHeader),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) composer_text_header_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_COMPOSER_HEADER, "EComposerTextHeader",
-			&type_info, 0);
-	}
-
-	return type;
-}
-
-EComposerHeader *
-e_composer_text_header_new_label (const gchar *label, const gchar *action_label)
-{
-	return g_object_new (
-		E_TYPE_COMPOSER_TEXT_HEADER, "label", label,
-		"button", FALSE, "addaction", action_label != NULL,
-		"addaction_text", action_label,
-		"visible", action_label == NULL, NULL);
-}
-
-EComposerHeader *
-e_composer_text_header_new_button (const gchar *label, const gchar *action_label)
-{
-	return g_object_new (
-		E_TYPE_COMPOSER_TEXT_HEADER, "label", label,
-		"button", TRUE, "addaction", action_label != NULL, 
-		"addaction_text", action_label,
-		"visible", action_label == NULL, NULL);
-}
-
-const gchar *
-e_composer_text_header_get_text (EComposerTextHeader *header)
-{
-	GtkEntry *entry;
-
-	g_return_val_if_fail (E_IS_COMPOSER_TEXT_HEADER (header), NULL);
-
-	entry = E_COMPOSER_TEXT_HEADER_GET_ENTRY (header);
-	return gtk_entry_get_text (entry);
-}
-
-void
-e_composer_text_header_set_text (EComposerTextHeader *header,
-                                 const gchar *text)
-{
-	GtkEntry *entry;
-
-	g_return_if_fail (E_IS_COMPOSER_TEXT_HEADER (header));
-
-	entry = E_COMPOSER_TEXT_HEADER_GET_ENTRY (header);
-	gtk_entry_set_text (entry, (text != NULL) ? text : "");
-}
diff --git a/src/e-composer-text-header.h b/src/e-composer-text-header.h
deleted file mode 100644
index 0f60951..0000000
--- a/src/e-composer-text-header.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
-
-/*Modified for Anjal - Johnny Jacob <jjohnny novell com>*/
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef E_COMPOSER_TEXT_HEADER_H
-#define E_COMPOSER_TEXT_HEADER_H
-
-#include "e-composer-common.h"
-#include "e-composer-header.h"
-
-/* Standard GObject macros */
-#define E_TYPE_COMPOSER_TEXT_HEADER \
-	(e_composer_text_header_get_type ())
-#define E_COMPOSER_TEXT_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_CAST \
-	((obj), E_TYPE_COMPOSER_TEXT_HEADER, EComposerTextHeader))
-#define E_COMPOSER_TEXT_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_CAST \
-	((cls), E_TYPE_COMPOSER_TEXT_HEADER, EComposerTextHeaderClass))
-#define E_IS_COMPOSER_TEXT_HEADER(obj) \
-	(G_TYPE_CHECK_INSTANCE_TYPE \
-	((obj), E_TYPE_COMPOSER_TEXT_HEADER))
-#define E_IS_COMPOSER_TEXT_HEADER_CLASS(cls) \
-	(G_TYPE_CHECK_CLASS_TYPE \
-	((cls), E_TYPE_COMPOSER_TEXT_HEADER))
-#define E_COMPOSER_TEXT_HEADER_GET_CLASS(obj) \
-	(G_TYPE_INSTANCE_GET_CLASS \
-	((obj), E_TYPE_COMPOSER_TEXT_HEADER, EComposerTextHeaderClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EComposerTextHeader EComposerTextHeader;
-typedef struct _EComposerTextHeaderClass EComposerTextHeaderClass;
-
-struct _EComposerTextHeader {
-	EComposerHeader parent;
-};
-
-struct _EComposerTextHeaderClass {
-	EComposerHeaderClass parent_class;
-};
-
-GType		e_composer_text_header_get_type	(void);
-EComposerHeader * e_composer_text_header_new_label (const gchar *label, 
-													const gchar *addaction_label);
-EComposerHeader * e_composer_text_header_new_button (const gchar *label,
-													 const gchar *addaction_label);
-
-const gchar *	e_composer_text_header_get_text	(EComposerTextHeader *header);
-void		e_composer_text_header_set_text (EComposerTextHeader *header,
-						 const gchar *text);
-
-G_END_DECLS
-
-#endif /* E_COMPOSER_TEXT_HEADER_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]