aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor/e-contact-editor.c
diff options
context:
space:
mode:
authorChris Lahey <clahey@src.gnome.org>2000-01-17 17:12:21 +0800
committerChris Lahey <clahey@src.gnome.org>2000-01-17 17:12:21 +0800
commit4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9 (patch)
tree12c605c87784a60a1ed0d65cbf261b95d32abb92 /addressbook/gui/contact-editor/e-contact-editor.c
parent173a42036986044bc7907033a299cc1c71aa72e7 (diff)
downloadgsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar.gz
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar.bz2
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar.lz
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar.xz
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.tar.zst
gsoc2013-evolution-4d4bcd89d8403e8ee275f8c4695f45c82e2dd9f9.zip
Images for e-contact-editor.c.
* head.png, phone.png, email.png, web.png, snailmail.png: Images for e-contact-editor.c. * addressbook/contact-editor/text-editor.c: Test program for contact editor widget. * addressbook/contact-editor/e-contact-editor.c, addressbook/contact-editor/e-contact-editor.h: Contact editor widget files. * addressbook/contact-editor/.cvsignore, addressbook/contact-editor/Makefile.am: New directory for contact editor files. * addressbook/.cvsignore, addressbook/Makefile.am: New directory for addressbook files. * widgets/.cvsignore: Added reflow-test. * Makefile.am (SUBDIRS): Added addressbook subdirectory. * configure.in, widgets/Makefile.am: Removed widgets/toolbar from SUBDIRS since the lack of content was preventing it from compiling. * widgets/shortcut-bar/Makefile.am: Added gnomecanvaspixbuf to the list of libraries used. * widgets/e-text.c, widgets/e-text.h: Fixed a crashing bug. svn path=/trunk/; revision=1581
Diffstat (limited to 'addressbook/gui/contact-editor/e-contact-editor.c')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c438
1 files changed, 438 insertions, 0 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
new file mode 100644
index 0000000000..73b48a7eb8
--- /dev/null
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -0,0 +1,438 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * e-contact-editor.c
+ * Copyright (C) 2000 Helix Code, Inc.
+ * Author: Chris Lahey <clahey@helixcode.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * 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 library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <gnome.h>
+#include "e-contact-editor.h"
+static void e_contact_editor_init (EContactEditor *card);
+static void e_contact_editor_class_init (EContactEditorClass *klass);
+static void e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
+static void e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+
+static GtkNotebookClass *parent_class = NULL;
+
+#if 0
+enum {
+ E_CONTACT_EDITOR_RESIZE,
+ E_CONTACT_EDITOR_LAST_SIGNAL
+};
+
+static guint e_contact_editor_signals[E_CONTACT_EDITOR_LAST_SIGNAL] = { 0 };
+#endif
+
+/* The arguments we take */
+enum {
+ ARG_0,
+ ARG_CARD
+};
+
+GtkType
+e_contact_editor_get_type (void)
+{
+ static GtkType contact_editor_type = 0;
+
+ if (!contact_editor_type)
+ {
+ static const GtkTypeInfo contact_editor_info =
+ {
+ "EContactEditor",
+ sizeof (EContactEditor),
+ sizeof (EContactEditorClass),
+ (GtkClassInitFunc) e_contact_editor_class_init,
+ (GtkObjectInitFunc) e_contact_editor_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
+ };
+
+ contact_editor_type = gtk_type_unique (gtk_notebook_get_type (), &contact_editor_info);
+ }
+
+ return contact_editor_type;
+}
+
+static void
+e_contact_editor_class_init (EContactEditorClass *klass)
+{
+ GtkObjectClass *object_class;
+ GtkNotebookClass *notebook_class;
+
+ object_class = (GtkObjectClass*) klass;
+ notebook_class = (GtkNotebookClass *) klass;
+
+ parent_class = gtk_type_class (gtk_notebook_get_type ());
+
+#if 0
+ e_contact_editor_signals[E_CONTACT_EDITOR_RESIZE] =
+ gtk_signal_new ("resize",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EContactEditorClass, resize),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
+
+ gtk_object_class_add_signals (object_class, e_contact_editor_signals, E_CONTACT_EDITOR_LAST_SIGNAL);
+#endif
+
+ gtk_object_add_arg_type ("EContactEditor::card", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_CARD);
+
+ object_class->set_arg = e_contact_editor_set_arg;
+ object_class->get_arg = e_contact_editor_get_arg;
+}
+
+static GtkWidget *
+_create_page_general_name(EContactEditor *e_contact_editor)
+{
+ GtkWidget *table;
+ GtkWidget *alignment;
+ table = gtk_table_new(3, 4, FALSE);
+ alignment = gtk_alignment_new(0, 0, 0, 0);
+ gtk_container_add(GTK_CONTAINER(alignment),
+ gnome_pixmap_new_from_file("head.png"));
+ gtk_table_attach(GTK_TABLE(table),
+ alignment,
+ 0, 1, 0, 4,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Full Name:")),
+ 1, 2, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Job Title:")),
+ 1, 2, 1, 2,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Company:")),
+ 1, 2, 2, 3,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("File as:")),
+ 1, 2, 3, 4,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 1, 2,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 2, 3,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_combo_new(),
+ 2, 3, 3, 4,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ return table;
+}
+
+static GtkWidget *
+_create_page_general_phone(EContactEditor *e_contact_editor)
+{
+ GtkWidget *table;
+ GtkWidget *alignment;
+ table = gtk_table_new(3, 4, FALSE);
+ alignment = gtk_alignment_new(0,0,0,0);
+ gtk_container_add(GTK_CONTAINER(alignment),
+ gnome_pixmap_new_from_file("phone.png"));
+
+ gtk_table_attach(GTK_TABLE(table),
+ alignment,
+ 0, 1, 0, 4,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Home:")),
+ 1, 2, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Car:")),
+ 1, 2, 1, 2,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Mobile:")),
+ 1, 2, 2, 3,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Business Fax:")),
+ 1, 2, 3, 4,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 1, 2,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 2, 3,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 3, 4,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ return table;
+}
+
+static GtkWidget *
+_create_page_general_email(EContactEditor *e_contact_editor)
+{
+ GtkWidget *table;
+ GtkWidget *alignment;
+ table = gtk_table_new(3, 1, FALSE);
+ alignment = gtk_alignment_new(0,0,0,0);
+ gtk_container_add(GTK_CONTAINER(alignment),
+ gnome_pixmap_new_from_file("email.png"));
+
+ gtk_table_attach(GTK_TABLE(table),
+ alignment,
+ 0, 1, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Email:")),
+ 1, 2, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ return table;
+}
+
+static GtkWidget *
+_create_page_general_web(EContactEditor *e_contact_editor)
+{
+ GtkWidget *table;
+ GtkWidget *alignment;
+ table = gtk_table_new(3, 1, FALSE);
+ alignment = gtk_alignment_new(0,0,0,0);
+ gtk_container_add(GTK_CONTAINER(alignment),
+ gnome_pixmap_new_from_file("web.png"));
+
+ gtk_table_attach(GTK_TABLE(table),
+ alignment,
+ 0, 1, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Web page address:")),
+ 1, 2, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_entry_new(),
+ 2, 3, 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ return table;
+}
+
+static GtkWidget *
+_create_page_general_snailmail(EContactEditor *e_contact_editor)
+{
+ GtkWidget *table;
+ GtkWidget *alignment;
+ GtkWidget *text;
+ table = gtk_table_new(3, 3, FALSE);
+ alignment = gtk_alignment_new(0,0,0,0);
+ gtk_container_add(GTK_CONTAINER(alignment),
+ gnome_pixmap_new_from_file("snailmail.png"));
+
+ gtk_table_attach(GTK_TABLE(table),
+ alignment,
+ 0, 1, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Address:")),
+ 1, 2, 0, 1,
+ 0, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_label_new(_("Business:")),
+ 1, 2, 1, 2,
+ 0, 0,
+ 0, 0);
+ text = gtk_text_new(NULL, NULL);
+ gtk_object_set(GTK_OBJECT(text),
+ "editable", TRUE,
+ NULL);
+ gtk_table_attach(GTK_TABLE(table),
+ text,
+ 2, 3, 0, 2,
+ GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ gtk_check_button_new_with_label(_("This is the mailing address")),
+ 2, 3, 2, 3,
+ 0, 0,
+ 0, 0);
+ return table;
+}
+
+static GtkWidget *
+_create_page_general_comments(EContactEditor *e_contact_editor)
+{
+ GtkWidget *text;
+ text = gtk_text_new(NULL, NULL);
+ gtk_object_set (GTK_OBJECT(text),
+ "editable", TRUE,
+ NULL);
+ return text;
+}
+
+static GtkWidget *
+_create_page_general_extras(EContactEditor *e_contact_editor)
+{
+ return gtk_entry_new();
+}
+
+static GtkWidget *
+_create_page_general( EContactEditor *e_contact_editor )
+{
+ GtkWidget *table;
+ table = gtk_table_new(2, 5, FALSE);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_name(e_contact_editor),
+ 0, 1,
+ 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_phone(e_contact_editor),
+ 1, 2,
+ 0, 1,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_email(e_contact_editor),
+ 0, 1,
+ 1, 2,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_web(e_contact_editor),
+ 0, 1,
+ 2, 3,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_snailmail(e_contact_editor),
+ 1, 2,
+ 1, 3,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_comments(e_contact_editor),
+ 0, 2,
+ 3, 4,
+ GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
+ 0, 0);
+ gtk_table_attach(GTK_TABLE(table),
+ _create_page_general_extras(e_contact_editor),
+ 0, 2,
+ 4, 5,
+ GTK_FILL | GTK_EXPAND, 0,
+ 0, 0);
+ return table;
+}
+
+static void
+e_contact_editor_init (EContactEditor *e_contact_editor)
+{
+ GtkNotebook *notebook = GTK_NOTEBOOK (e_contact_editor);
+
+ /* e_contact_editor->card = NULL;*/
+ e_contact_editor->fields = NULL;
+
+ gtk_notebook_append_page (notebook,
+ _create_page_general(e_contact_editor),
+ gtk_label_new(_("General")));
+}
+
+GtkWidget*
+e_contact_editor_new (void *card)
+{
+ GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_editor_get_type ()));
+ gtk_object_set (GTK_OBJECT(widget),
+ "card", card,
+ NULL);
+ return widget;
+}
+
+static void
+e_contact_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+{
+ EContactEditor *e_contact_editor;
+
+ e_contact_editor = E_CONTACT_EDITOR (o);
+
+ switch (arg_id){
+ case ARG_CARD:
+ /* e_contact_editor->card = GTK_VALUE_POINTER (*arg);
+ _update_card(e_contact_editor);
+ gnome_canvas_item_request_update (item);*/
+ break;
+ }
+}
+
+static void
+e_contact_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+{
+ EContactEditor *e_contact_editor;
+
+ e_contact_editor = E_CONTACT_EDITOR (object);
+
+ switch (arg_id) {
+ case ARG_CARD:
+ /* GTK_VALUE_POINTER (*arg) = e_contact_editor->card; */
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
+}