aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-30 22:37:55 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-30 22:37:55 +0800
commit695a9d492e4161939542844a19b7188b4a6bf99b (patch)
treee8dcb88f9e8bb2c6d94e76588c1879f6b3367216 /addressbook/backend
parent685a2424931709064b00465a109a253977caef05 (diff)
downloadgsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar.gz
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar.bz2
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar.lz
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar.xz
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.tar.zst
gsoc2013-evolution-695a9d492e4161939542844a19b7188b4a6bf99b.zip
Added ename includes and libs.
2000-04-30 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/Makefile.am: Added ename includes and libs. * backend/ebook/e-card.c, backend/ebook/e-card.h: Added e_card_name_from_string. Added header for e_card_delivery_address_from_string, even though it's not implemented yet. * contact-editor/Makefile.am: Removed the ename includes since we no longer use ename directly here. * contact-editor/e-contact-editor.c: Fixed this to properly save the address labels displayed. Updated this to use the function e_card_name_from_string instead of doing it by hand. * contact-editor/fullname-strings.h, contact-editor/fullname.glade: Deleted an unused field. Changed the set of prefixes and suffixes. svn path=/trunk/; revision=2689
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/Makefile.am17
-rw-r--r--addressbook/backend/ebook/e-card.c18
-rw-r--r--addressbook/backend/ebook/e-card.h2
3 files changed, 35 insertions, 2 deletions
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
index dd213e1ab7..78a947e729 100644
--- a/addressbook/backend/ebook/Makefile.am
+++ b/addressbook/backend/ebook/Makefile.am
@@ -1,4 +1,4 @@
-noinst_PROGRAMS = test-card test-client test-client-list
+noinst_PROGRAMS = test-card test-client test-client-list load-pine-addressbook
CORBA_SOURCE = \
addressbook.h \
@@ -20,6 +20,7 @@ INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
+ -I$(top_builddir)/addressbook/ename \
$(BONOBO_GNOME_CFLAGS)
lib_LTLIBRARIES = libebook.la
@@ -55,7 +56,8 @@ test_client_SOURCES = \
test_client_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
- $(top_builddir)/libversit/libversit.la
+ $(top_builddir)/libversit/libversit.la \
+ $(top_builddir)/addressbook/ename/libename.la
test_client_list_SOURCES = \
test-client-list.c
@@ -63,6 +65,7 @@ test_client_list_SOURCES = \
test_client_list_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
$(top_builddir)/libversit/libversit.la
test_card_SOURCES = \
@@ -71,6 +74,16 @@ test_card_SOURCES = \
test_card_LDADD = \
libebook.la \
$(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
+ $(top_builddir)/libversit/libversit.la
+
+load_pine_addressbook_SOURCES = \
+ load-pine-addressbook.c
+
+load_pine_addressbook_LDADD = \
+ libebook.la \
+ $(BONOBO_GNOME_LIBS) \
+ $(top_builddir)/addressbook/ename/libename.la \
$(top_builddir)/libversit/libversit.la
BUILT_SOURCES = $(CORBA_SOURCE)
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index eea5c16dc1..2f0f05b97f 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -17,6 +17,7 @@
#include <libversit/vcc.h>
#include "e-card.h"
#include "e-card-pairs.h"
+#include "e-name-western.h"
#define is_a_prop_of(obj,prop) (isAPropertyOf ((obj),(prop)))
#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
@@ -994,6 +995,23 @@ e_card_name_to_string(const ECardName *name)
return g_strjoinv(" ", strings);
}
+ECardName *
+e_card_name_from_string(const char *full_name)
+{
+ ECardName *name = g_new(ECardName, 1);
+ ENameWestern *western = e_name_western_parse (full_name);
+
+ name->prefix = g_strdup (western->prefix);
+ name->given = g_strdup (western->first );
+ name->additional = g_strdup (western->middle);
+ name->family = g_strdup (western->last );
+ name->suffix = g_strdup (western->suffix);
+
+ e_name_western_free(western);
+
+ return name;
+}
+
/*
* ECard lifecycle management and vCard loading/saving.
*/
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index c42db15461..98fa4a9060 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -111,6 +111,7 @@ ECardDeliveryAddress *e_card_delivery_address_new (void);
void e_card_delivery_address_free (ECardDeliveryAddress *addr);
ECardDeliveryAddress *e_card_delivery_address_copy (const ECardDeliveryAddress *addr);
char *e_card_delivery_address_to_string (const ECardDeliveryAddress *addr);
+char *e_card_delivery_address_from_string (const ECardDeliveryAddress *addr);
ECardAddrLabel *e_card_address_label_new (void);
void e_card_address_label_free (ECardAddrLabel *addr);
@@ -120,6 +121,7 @@ ECardName *e_card_name_new (void);
void e_card_name_free(ECardName *name);
ECardName *e_card_name_copy (const ECardName *name);
char *e_card_name_to_string(const ECardName *name);
+ECardName *e_card_name_from_string(const char *full_name);
/* Standard Gtk function */
GtkType e_card_get_type (void);