aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-29 11:23:51 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-29 11:23:51 +0800
commit428931dccacc89ec3861955a95605e4943c48a94 (patch)
tree59eafff773553e6a1e1787cc799e903d8fa721f7 /addressbook
parent70646faa9f9f5418d31e3e293768bc8366873000 (diff)
downloadgsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar.gz
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar.bz2
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar.lz
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar.xz
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.tar.zst
gsoc2013-evolution-428931dccacc89ec3861955a95605e4943c48a94.zip
New select names manager interface (Not complete.)
2000-06-28 Christopher James Lahey <clahey@helixcode.com> * gui/component/select-names/, gui/component/select-names/e-select-names-manager.c, gui/component/select-names/e-select-names-manager.h: New select names manager interface (Not complete.) svn path=/trunk/; revision=3785
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c171
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.h49
3 files changed, 227 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f097647bcf..840e491fdb 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2000-06-28 Christopher James Lahey <clahey@helixcode.com>
+
+ * gui/component/select-names/,
+ gui/component/select-names/e-select-names-manager.c,
+ gui/component/select-names/e-select-names-manager.h: New select
+ names manager interface (Not complete.)
+
2000-06-26 Christopher James Lahey <clahey@helixcode.com>
* contact-editor/e-contact-editor-categories.c,
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
new file mode 100644
index 0000000000..28981cf018
--- /dev/null
+++ b/addressbook/gui/component/select-names/e-select-names-manager.c
@@ -0,0 +1,171 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors:
+ * Chris Lahey <clahey@helixcode.com>
+ *
+ * Copyright (C) 2000 Helix Code, Inc.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gtk/gtk.h>
+
+#include "e-select-names-manager.h"
+
+/* Object argument IDs */
+enum {
+ ARG_0,
+ ARG_CARD,
+};
+
+
+static void e_select_names_manager_init (ESelectNamesManager *manager);
+static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass);
+
+static void e_select_names_manager_destroy (GtkObject *object);
+static void e_select_names_manager_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+
+static void fill_in_info(ESelectNamesManager *manager);
+
+/**
+ * e_select_names_manager_get_type:
+ * @void:
+ *
+ * Registers the &ESelectNamesManager class if necessary, and returns the type ID
+ * associated to it.
+ *
+ * Return value: The type ID of the &ESelectNamesManager class.
+ **/
+GtkType
+e_select_names_manager_get_type (void)
+{
+ static GtkType manager_type = 0;
+
+ if (!manager_type) {
+ GtkTypeInfo manager_info = {
+ "ESelectNamesManager",
+ sizeof (ESelectNamesManager),
+ sizeof (ESelectNamesManagerClass),
+ (GtkClassInitFunc) e_select_names_manager_class_init,
+ (GtkObjectInitFunc) e_select_names_manager_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ manager_type = gtk_type_unique (gtk_object_get_type (), &manager_info);
+ }
+
+ return manager_type;
+}
+
+/**
+ * e_select_names_manager_new:
+ * @VCard: a string in vCard format
+ *
+ * Returns: a new #ESelectNamesManager that wraps the @VCard.
+ */
+ESelectNamesManager *
+e_select_names_manager_new (void)
+{
+ ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER(gtk_type_new(e_select_names_manager_get_type()));
+ return manager;
+}
+
+static void
+e_select_names_manager_class_init (ESelectNamesManagerClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS(klass);
+
+ gtk_object_add_arg_type ("ESelectNamesManager::card",
+ GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD);
+
+ object_class->destroy = e_select_names_manager_destroy;
+ object_class->get_arg = e_select_names_manager_get_arg;
+ object_class->set_arg = e_select_names_manager_set_arg;
+}
+
+/*
+ * ESelectNamesManager lifecycle management and vcard loading/saving.
+ */
+
+static void
+e_select_names_manager_destroy (GtkObject *object)
+{
+ ESelectNamesManager *manager;
+ int i;
+
+ manager = E_SELECT_NAMES_MANAGER (object);
+}
+
+
+/* Set_arg handler for the manager */
+static void
+e_select_names_manager_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+{
+ ESelectNamesManager *manager;
+
+ manager = E_SELECT_NAMES_MANAGER (object);
+
+ switch (arg_id) {
+ case ARG_CARD:
+ fill_in_info(manager);
+ break;
+ default:
+ return;
+ }
+}
+
+/* Get_arg handler for the manager */
+static void
+e_select_names_manager_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+{
+ ESelectNamesManager *manager;
+
+ manager = E_SELECT_NAMES_MANAGER (object);
+
+ switch (arg_id) {
+ case ARG_CARD:
+ e_select_names_manager_sync_card(manager);
+ if (manager->card)
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(manager->card);
+ else
+ GTK_VALUE_OBJECT (*arg) = NULL;
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ break;
+ }
+}
+
+
+/**
+ * e_select_names_manager_init:
+ */
+static void
+e_select_names_manager_init (ESelectNamesManager *manager)
+{
+}
+
+static void
+fill_in_info(ESelectNamesManager *manager)
+{
+ ECard *card = manager->card;
+ if (card) {
+
+ }
+}
+
+void
+e_select_names_manager_sync_card(ESelectNamesManager *manager)
+{
+ ECard *card = manager->card;
+ if (card) {
+ fill_in_info(manager);
+ }
+}
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h
new file mode 100644
index 0000000000..5aba1d3295
--- /dev/null
+++ b/addressbook/gui/component/select-names/e-select-names-manager.h
@@ -0,0 +1,49 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Authors:
+ * Chris Lahey <clahey@helixcode.com>
+ *
+ * Copyright (C) 2000 Helix Code, Inc.
+ */
+
+#ifndef __E_SELECT_NAMES_MANAGER_H__
+#define __E_SELECT_NAMES_MANAGER_H__
+
+#include <time.h>
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+#define E_TYPE_SELECT_NAMES_MANAGER (e_select_names_manager_get_type ())
+#define E_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager))
+#define E_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass))
+#define E_IS_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER))
+#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER))
+
+typedef struct _ESelectNamesManager ESelectNamesManager;
+typedef struct _ESelectNamesManagerClass ESelectNamesManagerClass;
+
+struct _ESelectNamesManager {
+ GtkObject object;
+
+};
+
+struct _ESelectNamesManagerClass {
+ GtkObjectClass parent_class;
+};
+
+ESelectNamesManager *e_select_names_manager_new (void);
+void e_select_names_add_section (ESelectNamesManager *manager,
+ char *id);
+GtkWidget *e_select_names_create_entry (ESelectNamesManager *manager,
+ char *id);
+void e_select_names_activate_dialog (ESelectNamesManager *manager,
+ char *id);
+
+/* Of type ECard */
+ECardList *e_select_names_get_cards (ESelectNamesManager *manager,
+ char *id);
+
+/* Standard Gtk function */
+GtkType e_select_names_manager_get_type (void);
+
+#endif /* ! __E_SELECT_NAMES_MANAGER_H__ */