aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/Makefile.am4
-rw-r--r--addressbook/backend/ebook/e-book-listener.c2
-rw-r--r--addressbook/backend/ebook/e-card-pairs.h12
-rw-r--r--addressbook/backend/ebook/e-card-types.h21
-rw-r--r--addressbook/backend/ebook/e-card.c68
-rw-r--r--addressbook/backend/ebook/e-card.h57
-rw-r--r--addressbook/backend/ebook/test-client.c2
7 files changed, 128 insertions, 38 deletions
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
index 35cf59d537..84b85a8099 100644
--- a/addressbook/backend/ebook/Makefile.am
+++ b/addressbook/backend/ebook/Makefile.am
@@ -61,7 +61,7 @@ test_client_LDADD = \
$(INTLLIBS) \
-lbonobo \
$(ebook_libs) \
- ../libversit/libversit.la
+ $(top_builddir)/libversit/libversit.la
test_card_SOURCES = \
test-card.c
@@ -73,7 +73,7 @@ test_card_LDADD = \
$(INTLLIBS) \
-lbonobo \
$(ebook_libs) \
- ../libversit/libversit.la
+ $(top_builddir)/libversit/libversit.la
BUILT_SOURCES = $(CORBA_SOURCE)
CLEANFILES += $(BUILT_SOURCES)
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c
index 3b04a09131..107f71fedc 100644
--- a/addressbook/backend/ebook/e-book-listener.c
+++ b/addressbook/backend/ebook/e-book-listener.c
@@ -9,7 +9,7 @@
*/
#include <gtk/gtksignal.h>
- #include <e-book-listener.h>
+#include <e-book-listener.h>
static EBookStatus e_book_listener_convert_status (Evolution_BookListener_CallStatus status);
diff --git a/addressbook/backend/ebook/e-card-pairs.h b/addressbook/backend/ebook/e-card-pairs.h
index d79d1171c6..baabdc3dca 100644
--- a/addressbook/backend/ebook/e-card-pairs.h
+++ b/addressbook/backend/ebook/e-card-pairs.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* GnomeCard - a graphical contact manager.
*
* pairs.h: This file is part of GnomeCard.
@@ -22,13 +23,15 @@
#ifndef __E_CARD_PAIRS_H__
#define __E_CARD_PAIRS_H__
-#include "../libversit/vcc.h"
+#include "libversit/vcc.h"
#include <e-card.h>
+#if 0
+
struct pair
{
char *str;
- enum PropertyType id;
+ ECardPropertyType i ;
};
struct pair prop_lookup[] = {
@@ -108,7 +111,7 @@ struct pair phone_pairs[] = {
{ VCISDNProp, PHONE_ISDN },
{ VCVideoProp, PHONE_VIDEO },
{ NULL, 0 } };
-
+#if 0
struct pair email_pairs[] = {
{ VCAOLProp, EMAIL_AOL },
{ VCAppleLinkProp, EMAIL_APPLE_LINK },
@@ -123,7 +126,7 @@ struct pair email_pairs[] = {
{ VCTLXProp, EMAIL_TLX },
{ VCX400Prop, EMAIL_X400 },
{ NULL, 0 } };
-
+#endif
struct pair sound_pairs[] = {
{ VCAIFFProp, SOUND_AIFF },
{ VCPCMProp, SOUND_PCM },
@@ -136,4 +139,5 @@ struct pair key_pairs[] = {
{ NULL, 0 } };
+#endif
#endif /* ! __E_CARD_PAIRS_H__ */
diff --git a/addressbook/backend/ebook/e-card-types.h b/addressbook/backend/ebook/e-card-types.h
index adf62ad68f..6e6a6a73be 100644
--- a/addressbook/backend/ebook/e-card-types.h
+++ b/addressbook/backend/ebook/e-card-types.h
@@ -9,7 +9,7 @@
#ifndef __E_CARD_TYPES_H__
#define __E_CARD_TYPES_H__
-
+#if 0
typedef enum
{
PROP_NONE = 0, /* Must always be the first, with value = 0. */
@@ -72,6 +72,12 @@ typedef enum
VAL_LAST = 4
} ECardValueType;
+typedef enum {
+ PHOTO_GIF, PHOTO_CGM, PHOTO_WMF, PHOTO_BMP, PHOTO_MET, PHOTO_PMB,
+ PHOTO_DIB, PHOTO_PICT, PHOTO_TIFF, PHOTO_PS, PHOTO_PDF, PHOTO_JPEG,
+ PHOTO_MPEG, PHOTO_MPEG2, PHOTO_AVI, PHOTO_QTIME
+} ECardPhotoType;
+
typedef struct {
gboolean used;
ECardPropertyType type;
@@ -116,7 +122,7 @@ typedef struct {
typedef struct {
CardProperty prop;
- enum ECardPhotoType type;
+ ECardPhotoType type;
guint size;
char *data;
@@ -166,12 +172,6 @@ typedef struct {
} ECardGeoPos;
-typedef enum {
- PHOTO_GIF, PHOTO_CGM, PHOTO_WMF, PHOTO_BMP, PHOTO_MET, PHOTO_PMB,
- PHOTO_DIB, PHOTO_PICT, PHOTO_TIFF, PHOTO_PS, PHOTO_PDF, PHOTO_JPEG,
- PHOTO_MPEG, PHOTO_MPEG2, PHOTO_AVI, PHOTO_QTIME
-} ECardPhotoType;
-
/* DELIVERY ADDRESSING PROPERTIES */
typedef enum {
@@ -231,7 +231,7 @@ typedef struct {
typedef struct {
- enum SoundType type;
+ ECardSoundType type;
unsigned int size;
char *data;
} ECardSound;
@@ -239,8 +239,9 @@ typedef struct {
typedef struct {
CardProperty prop;
- enum KeyType type;
+ ECardKeyType type;
char *data;
} ECardKey;
+#endif /* 0 */
#endif /* __E_CARD_TYPES_H__ */
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index bc5b13deae..0029694d35 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Authors:
* Arturo Espinosa (arturo@nuclecu.unam.mx)
@@ -11,17 +12,73 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <glib.h>
+#include <gtk/gtk.h>
-#include "../libversit/vcc.h"
-#include <e-card-pairs.h>
+#include "libversit/vcc.h"
#include <e-card.h>
+#include <e-card-pairs.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)
#define has(obj,prop) (vo = isAPropertyOf (obj, prop))
-static VObject *card_convert_to_vobject (Card *crd);
+#if 0
+static VObject *card_convert_to_vobject (ECard *crd);
+#endif
+
+/**
+ * e_card_get_type:
+ * @void:
+ *
+ * Registers the &ECard class if necessary, and returns the type ID
+ * associated to it.
+ *
+ * Return value: The type ID of the &ECard class.
+ **/
+GtkType
+e_card_get_type (void)
+{
+ static GtkType card_type = 0;
+
+ if (!card_type) {
+ GtkTypeInfo card_info = {
+ "ECard",
+ sizeof (ECard),
+ sizeof (ECardClass),
+ NULL,
+ NULL,
+#if 0
+ (GtkClassInitFunc) e_card_class_init,
+ (GtkObjectInitFunc) e_card_init,
+#endif
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ card_type = gtk_type_unique (gtk_object_get_type (), &card_info);
+ }
+
+ return card_type;
+}
+
+ECard *e_card_new (char *vcard)
+{
+ return E_CARD(gtk_type_new(e_card_get_type()));
+}
+
+char *e_card_get_id (ECard *card)
+{
+ return NULL;
+}
+
+char *e_card_get_vcard (ECard *card)
+{
+ return NULL;
+}
+
+
+#if 0
/*
* ECard lifecycle management and vCard loading/saving.
@@ -198,7 +255,7 @@ e_card_prop_str_empty (void)
}
/* Intended to check asserts. */
-extern int card_check_prop (CardProperty prop)
+extern int card_check_prop (ECardProperty prop)
{
if (((prop.used == FALSE) || (prop.used == TRUE)) &&
((prop.type >= PROP_NONE) && (prop.type <= PROP_LAST)) &&
@@ -1854,3 +1911,4 @@ card_save (Card *crd, FILE *fp)
writeVObject (fp, object);
cleanVObject (object);
}
+#endif
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index 516cb85017..4b04f34c4d 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -1,5 +1,7 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Authors:
+ * Chris Lahey <clahey@helixcode.com>
* Arturo Espinosa
* Nat Friedman (nat@helixcode.com)
*
@@ -11,14 +13,22 @@
#define __E_CARD_H__
#include <time.h>
-#include <glib.h>
+#include <gtk/gtk.h>
#include <stdio.h>
#include <e-card-types.h>
+#define E_TYPE_CARD (e_card_get_type ())
+#define E_CARD(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CARD, ECard))
+#define E_CARD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
+#define E_IS_CARD(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CARD))
+#define E_IS_CARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
+
typedef struct _ECard ECard;
+typedef struct _ECardClass ECardClass;
struct _ECard {
-
+ GtkObject object;
+#if 0
char *fname; /* The full name. */
ECardName *name; /* The structured name. */
@@ -59,21 +69,36 @@ struct _ECard {
ECardRev *rev; /* The time this card was last
modified. */
- CardList xtension;
+ ECardList xtension;
+#endif
};
-Card *card_new (void);
-void card_free (Card *crd);
-void card_prop_free (CardProperty prop);
-CardProperty card_prop_empty (void);
-int card_check_prop (CardProperty prop);
-GList *card_load (GList *crdlist, char *fname);
-void card_save (Card *crd, FILE *fp);
-char *card_to_vobj_string (Card *card);
-char *card_to_string (Card *card);
-
-char *card_bday_str (CardBDay bday);
-char *card_timezn_str (CardTimeZone timezn);
-char *card_geopos_str (CardGeoPos geopos);
+struct _ECardClass {
+ GtkObjectClass parent_class;
+};
+
+
+ECard *e_card_new (char *vcard);
+char *e_card_get_id (ECard *card);
+char *e_card_get_vcard (ECard *card);
+
+/* Standard Gtk function */
+GtkType e_card_get_type (void);
+
+
+#if 0
+void e_card_free (ECard *crd);
+void e_card_prop_free (CardProperty prop);
+CardProperty e_card_prop_empty (void);
+int e_card_check_prop (CardProperty prop);
+GList *e_card_load (GList *crdlist, char *fname);
+void e_card_save (ECard *crd, FILE *fp);
+char *e_card_to_vobj_string (ECard *card);
+char *e_card_to_string (ECard *card);
+
+char *e_card_bday_str (ECardDate bday);
+char *e_card_timezn_str (ECardTimeZone timezn);
+char *e_card_geopos_str (ECardGeoPos geopos);
+#endif
#endif /* ! __E_CARD_H__ */
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c
index 366e8db5ce..074709aef7 100644
--- a/addressbook/backend/ebook/test-client.c
+++ b/addressbook/backend/ebook/test-client.c
@@ -1,5 +1,7 @@
#include <config.h>
#include <bonobo.h>
+#include <gnome.h>
+#include <libgnorba/gnorba.h>
#include <e-book.h>