[couchdb-glib] Move contacts record code to desktopcouch-glib
- From: Rodrigo Moya <rodrigo src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [couchdb-glib] Move contacts record code to desktopcouch-glib
- Date: Wed, 27 Jan 2010 13:20:50 +0000 (UTC)
commit cd72001348bf6488bbac4cac6cc3ea32f1b363f1
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Wed Jan 27 14:20:41 2010 +0100
Move contacts record code to desktopcouch-glib
couchdb-glib/Makefile.am | 3 -
couchdb-glib/couchdb-document-contact.h | 201 -------------
couchdb-glib/couchdb-document.c | 42 ---
couchdb-glib/couchdb-document.h | 38 +---
couchdb-glib/couchdb-glib.h | 1 -
desktopcouch-glib/Makefile.am | 10 +-
.../desktopcouch-document-contact.c | 304 ++++++++++----------
desktopcouch-glib/desktopcouch-document-contact.h | 200 +++++++++++++
desktopcouch-glib/desktopcouch-document.c | 55 ++++
desktopcouch-glib/desktopcouch-document.h | 39 +++
desktopcouch-glib/desktopcouch-glib.h | 2 +
doc/reference/couchdb-glib-docs.sgml | 1 -
12 files changed, 461 insertions(+), 435 deletions(-)
---
diff --git a/couchdb-glib/Makefile.am b/couchdb-glib/Makefile.am
index 53d2806..187dc41 100644
--- a/couchdb-glib/Makefile.am
+++ b/couchdb-glib/Makefile.am
@@ -28,7 +28,6 @@ libcouchdb_glib_1_0_la_headers = \
couchdb-credentials.h \
couchdb-database-info.h \
couchdb-document.h \
- couchdb-document-contact.h \
couchdb-document-info.h \
couchdb-glib.h \
couchdb-session.h \
@@ -41,7 +40,6 @@ libcouchdb_glib_1_0_la_sources = \
couchdb-credentials.c \
couchdb-database-info.c \
couchdb-document.c \
- couchdb-document-contact.c \
couchdb-document-info.c \
couchdb-session.c \
couchdb-struct-field.c \
@@ -68,7 +66,6 @@ hdir = $(includedir)/couchdb-glib-1.0
h_DATA = \
couchdb-credentials.h \
couchdb-database-info.h \
- couchdb-document-contact.h \
couchdb-document.h \
couchdb-document-info.h \
couchdb-glib.h \
diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index 08ca264..49475ae 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -251,32 +251,6 @@ couchdb_document_set_revision (CouchdbDocument *document, const char *revision)
revision);
}
-const char *
-couchdb_document_get_record_type (CouchdbDocument *document)
-{
- g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
-
- if (document->root_node &&
- json_node_get_node_type (document->root_node) == JSON_NODE_OBJECT) {
- return json_object_get_string_member (
- json_node_get_object (document->root_node),
- "record_type");
- }
-
- return NULL;
-}
-
-void
-couchdb_document_set_record_type (CouchdbDocument *document, const char *record_type)
-{
- g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (record_type != NULL);
-
- json_object_set_string_member (json_node_get_object (document->root_node),
- "record_type",
- record_type);
-}
-
gboolean
couchdb_document_has_field (CouchdbDocument *document, const char *field)
{
@@ -423,22 +397,6 @@ couchdb_document_set_struct_field (CouchdbDocument *document, const char *field,
json_object_ref (couchdb_struct_field_get_json_object (value)));
}
-CouchdbStructField *
-couchdb_document_get_application_annotations (CouchdbDocument *document)
-{
- g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
-
- return couchdb_document_get_struct_field (document, "application_annotations");
-}
-
-void
-couchdb_document_set_application_annotations (CouchdbDocument *document, CouchdbStructField *annotations)
-{
- g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
-
- couchdb_document_set_struct_field (document, "application_annotations", annotations);
-}
-
char *
couchdb_document_to_string (CouchdbDocument *document)
{
diff --git a/couchdb-glib/couchdb-document.h b/couchdb-glib/couchdb-document.h
index 0853380..4cb4b54 100644
--- a/couchdb-glib/couchdb-document.h
+++ b/couchdb-glib/couchdb-document.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
+ * Copyright (C) 2009-2010 Canonical Services Ltd (www.canonical.com)
* 2009 Mikkel Kamstrup Erlandsen
*
* Authors: Rodrigo Moya <rodrigo moya canonical com>
@@ -47,87 +47,59 @@ typedef struct {
GType couchdb_document_get_type (void);
CouchdbDocument *couchdb_document_new (CouchdbSession *couchdb);
-
CouchdbDocument *couchdb_document_get (CouchdbSession *couchdb,
const char *dbname,
const char *docid,
GError **error);
-
gboolean couchdb_document_put (CouchdbDocument *document,
const char *dbname,
GError **error);
-
gboolean couchdb_document_delete (CouchdbDocument *document,
GError **error);
const char *couchdb_document_get_id (CouchdbDocument *document);
-
void couchdb_document_set_id (CouchdbDocument *document,
const char *id);
const char *couchdb_document_get_revision (CouchdbDocument *document);
void couchdb_document_set_revision (CouchdbDocument *document,
const char *revision);
-
-const char *couchdb_document_get_record_type (CouchdbDocument *document);
-
-void couchdb_document_set_record_type (CouchdbDocument *document,
-
- const char *record_type);
gboolean couchdb_document_has_field (CouchdbDocument *document,
const char *field);
-
void couchdb_document_remove_field (CouchdbDocument *document,
const char *field);
gboolean couchdb_document_get_boolean_field (CouchdbDocument *document,
const char *field);
-
void couchdb_document_set_boolean_field (CouchdbDocument *document,
const char *field,
gboolean value);
-
gint couchdb_document_get_int_field (CouchdbDocument *document,
const char *field);
-
void couchdb_document_set_int_field (CouchdbDocument *document,
const char *field,
gint value);
-
gdouble couchdb_document_get_double_field (CouchdbDocument *document,
const char *field);
-
void couchdb_document_set_double_field (CouchdbDocument *document,
const char *field,
gdouble value);
-
const char *couchdb_document_get_string_field (CouchdbDocument *document,
const char *field);
-
void couchdb_document_set_string_field (CouchdbDocument *document,
const char *field,
const char *value);
-CouchdbStructField*
- couchdb_document_get_struct_field (CouchdbDocument *document,
+CouchdbStructField *couchdb_document_get_struct_field (CouchdbDocument *document,
const char *field);
-
-void couchdb_document_set_struct_field (CouchdbDocument *document,
+void couchdb_document_set_struct_field (CouchdbDocument *document,
const char *field,
CouchdbStructField *value);
-
-CouchdbStructField*
- couchdb_document_get_application_annotations
- (CouchdbDocument *document);
-
-void couchdb_document_set_application_annotations
- (CouchdbDocument *document,
- CouchdbStructField *annotations);
-char* couchdb_document_to_string (CouchdbDocument *document);
+char *couchdb_document_to_string (CouchdbDocument *document);
-JsonObject* couchdb_document_get_json_object (CouchdbDocument *document);
+JsonObject* couchdb_document_get_json_object (CouchdbDocument *document);
G_END_DECLS
diff --git a/couchdb-glib/couchdb-glib.h b/couchdb-glib/couchdb-glib.h
index a60745b..b3dead3 100644
--- a/couchdb-glib/couchdb-glib.h
+++ b/couchdb-glib/couchdb-glib.h
@@ -28,7 +28,6 @@
#include <couchdb-credentials.h>
#include <couchdb-database-info.h>
#include <couchdb-document.h>
-#include <couchdb-document-contact.h>
#include <couchdb-document-info.h>
#include <couchdb-session.h>
#include <couchdb-struct-field.h>
diff --git a/desktopcouch-glib/Makefile.am b/desktopcouch-glib/Makefile.am
index d621706..c1a9b3a 100644
--- a/desktopcouch-glib/Makefile.am
+++ b/desktopcouch-glib/Makefile.am
@@ -6,11 +6,15 @@ INCLUDES = \
lib_LTLIBRARIES = libdesktopcouch-glib-1.0.la
libdesktopcouch_glib_1_0_la_headers = \
+ desktopcouch-document.h \
+ desktopcouch-document-contact.h \
desktopcouch-glib.h \
desktopcouch-session.h
libdesktopcouch_glib_1_0_la_SOURCES = \
$(libdesktopcouch_glib_1_0_la_headers) \
+ desktopcouch-document.c \
+ desktopcouch-document-contact.c \
desktopcouch-session.c
libdesktopcouch_glib_1_0_la_LIBADD = \
@@ -22,8 +26,10 @@ libdesktopcouch_glib_1_0_la_LDFLAGS = \
-version-info $(LIBCOUCHDBGLIB_CURRENT):$(LIBCOUCHDBGLIB_REVISION):$(LIBCOUCHDBGLIB_AGE)
hdir = $(includedir)/desktopcouch-glib-1.0
-h_DATA = \
- desktopcouch-glib.h \
+h_DATA = \
+ desktopcouch-document.h \
+ desktopcouch-document-contact.h \
+ desktopcouch-glib.h \
desktopcouch-session.h
if HAVE_INTROSPECTION
diff --git a/couchdb-glib/couchdb-document-contact.c b/desktopcouch-glib/desktopcouch-document-contact.c
similarity index 62%
rename from couchdb-glib/couchdb-document-contact.c
rename to desktopcouch-glib/desktopcouch-document-contact.c
index 7e825e7..7085cfc 100644
--- a/couchdb-glib/couchdb-document-contact.c
+++ b/desktopcouch-glib/desktopcouch-document-contact.c
@@ -19,11 +19,11 @@
* Boston, MA 02110-1301, USA.
*/
-#include "couchdb-document-contact.h"
+#include "desktopcouch-document-contact.h"
#include "utils.h"
CouchdbDocument *
-couchdb_document_contact_new (CouchdbSession *couchdb)
+desktopcouch_document_contact_new (CouchdbSession *couchdb)
{
CouchdbDocument *document;
@@ -31,266 +31,266 @@ couchdb_document_contact_new (CouchdbSession *couchdb)
document = couchdb_document_new (couchdb);
if (document)
- couchdb_document_set_record_type (document, COUCHDB_RECORD_TYPE_CONTACT);
+ desktopcouch_document_set_record_type (document, DESKTOPCOUCH_RECORD_TYPE_CONTACT);
return document;
}
gboolean
-couchdb_document_is_contact (CouchdbDocument *document)
+desktopcouch_document_is_contact (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), FALSE);
- return !g_ascii_strcasecmp (couchdb_document_get_record_type (document),
- COUCHDB_RECORD_TYPE_CONTACT);
+ return !g_ascii_strcasecmp (desktopcouch_document_get_record_type (document),
+ DESKTOPCOUCH_RECORD_TYPE_CONTACT);
}
const char *
-couchdb_document_contact_get_first_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_first_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "first_name");
}
void
-couchdb_document_contact_set_first_name (CouchdbDocument *document, const char *first_name)
+desktopcouch_document_contact_set_first_name (CouchdbDocument *document, const char *first_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (first_name != NULL);
couchdb_document_set_string_field (document, "first_name", first_name);
}
const char *
-couchdb_document_contact_get_last_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_last_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "last_name");
}
void
-couchdb_document_contact_set_last_name (CouchdbDocument *document, const char *last_name)
+desktopcouch_document_contact_set_last_name (CouchdbDocument *document, const char *last_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (last_name != NULL);
couchdb_document_set_string_field (document, "last_name", last_name);
}
const char *
-couchdb_document_contact_get_nick_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_nick_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "nick_name");
}
void
-couchdb_document_contact_set_nick_name (CouchdbDocument *document, const char *nick_name)
+desktopcouch_document_contact_set_nick_name (CouchdbDocument *document, const char *nick_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (nick_name != NULL);
couchdb_document_set_string_field (document, "nick_name", nick_name);
}
const char *
-couchdb_document_contact_get_spouse_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_spouse_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "spouse_name");
}
void
-couchdb_document_contact_set_spouse_name (CouchdbDocument *document, const char *spouse_name)
+desktopcouch_document_contact_set_spouse_name (CouchdbDocument *document, const char *spouse_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (spouse_name != NULL);
couchdb_document_set_string_field (document, "spouse_name", spouse_name);
}
const char *
-couchdb_document_contact_get_birth_date (CouchdbDocument *document)
+desktopcouch_document_contact_get_birth_date (CouchdbDocument *document)
{
JsonObject *object;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "birth_date");
}
void
-couchdb_document_contact_set_birth_date (CouchdbDocument *document, const char *birth_date)
+desktopcouch_document_contact_set_birth_date (CouchdbDocument *document, const char *birth_date)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (birth_date != NULL);
couchdb_document_set_string_field (document, "birth_date", birth_date);
}
const char *
-couchdb_document_contact_get_wedding_date (CouchdbDocument *document)
+desktopcouch_document_contact_get_wedding_date (CouchdbDocument *document)
{
JsonObject *object;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "wedding_date");
}
void
-couchdb_document_contact_set_wedding_date (CouchdbDocument *document, const char *wedding_date)
+desktopcouch_document_contact_set_wedding_date (CouchdbDocument *document, const char *wedding_date)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (wedding_date != NULL);
couchdb_document_set_string_field (document, "wedding_date", wedding_date);
}
const char *
-couchdb_document_contact_get_company (CouchdbDocument *document)
+desktopcouch_document_contact_get_company (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "company");
}
void
-couchdb_document_contact_set_company (CouchdbDocument *document, const char *company)
+desktopcouch_document_contact_set_company (CouchdbDocument *document, const char *company)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (company != NULL);
couchdb_document_set_string_field (document, "company", company);
}
const char *
-couchdb_document_contact_get_department (CouchdbDocument *document)
+desktopcouch_document_contact_get_department (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "department");
}
void
-couchdb_document_contact_set_department (CouchdbDocument *document, const char *department)
+desktopcouch_document_contact_set_department (CouchdbDocument *document, const char *department)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (department != NULL);
couchdb_document_set_string_field (document, "department", department);
}
const char *
-couchdb_document_contact_get_title (CouchdbDocument *document)
+desktopcouch_document_contact_get_title (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "title");
}
void
-couchdb_document_contact_set_title (CouchdbDocument *document, const char *title)
+desktopcouch_document_contact_set_title (CouchdbDocument *document, const char *title)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (title != NULL);
couchdb_document_set_string_field (document, "title", title);
}
const char *
-couchdb_document_contact_get_job_title (CouchdbDocument *document)
+desktopcouch_document_contact_get_job_title (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "job_title");
}
void
-couchdb_document_contact_set_job_title (CouchdbDocument *document, const char *job_title)
+desktopcouch_document_contact_set_job_title (CouchdbDocument *document, const char *job_title)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (job_title != NULL);
couchdb_document_set_string_field (document, "job_title", job_title);
}
const char *
-couchdb_document_contact_get_manager_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_manager_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "manager_name");
}
void
-couchdb_document_contact_set_manager_name (CouchdbDocument *document, const char *manager_name)
+desktopcouch_document_contact_set_manager_name (CouchdbDocument *document, const char *manager_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (manager_name != NULL);
couchdb_document_set_string_field (document, "manager_name", manager_name);
}
const char *
-couchdb_document_contact_get_assistant_name (CouchdbDocument *document)
+desktopcouch_document_contact_get_assistant_name (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "assistant_name");
}
void
-couchdb_document_contact_set_assistant_name (CouchdbDocument *document, const char *assistant_name)
+desktopcouch_document_contact_set_assistant_name (CouchdbDocument *document, const char *assistant_name)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (assistant_name != NULL);
couchdb_document_set_string_field (document, "assistant_name", assistant_name);
}
const char *
-couchdb_document_contact_get_office (CouchdbDocument *document)
+desktopcouch_document_contact_get_office (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "office");
}
void
-couchdb_document_contact_set_office (CouchdbDocument *document, const char *office)
+desktopcouch_document_contact_set_office (CouchdbDocument *document, const char *office)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (office != NULL);
couchdb_document_set_string_field (document, "office", office);
@@ -315,12 +315,12 @@ foreach_object_cb (JsonObject *object,
}
/**
- * couchdb_document_contact_get_email_addresses:
+ * desktopcouch_document_contact_get_email_addresses:
* @document: A #CouchdbDocument object representing a contact
*
* Retrieve a list of email addresses from the specified contact document.
* Email addresses are returned in a GSList of #CouchdbStructField objects,
- * which can be manipulated with the couchdb_document_contact_email_* functions
+ * which can be manipulated with the desktopcouch_document_contact_email_* functions
* and freed with:
* g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
* g_slist_free (list);
@@ -328,13 +328,13 @@ foreach_object_cb (JsonObject *object,
* Return value: a #GSList of #CouchdbStructField objects.
*/
GSList *
-couchdb_document_contact_get_email_addresses (CouchdbDocument *document)
+desktopcouch_document_contact_get_email_addresses (CouchdbDocument *document)
{
GSList *list = NULL;
JsonObject *addresses_json;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
addresses_json = json_object_get_object_member (
couchdb_document_get_json_object (document), "email_addresses");;
@@ -348,7 +348,7 @@ couchdb_document_contact_get_email_addresses (CouchdbDocument *document)
}
void
-couchdb_document_contact_set_email_addresses (CouchdbDocument *document, GSList *list)
+desktopcouch_document_contact_set_email_addresses (CouchdbDocument *document, GSList *list)
{
GSList *l;
JsonObject *addresses_json;
@@ -360,14 +360,14 @@ couchdb_document_contact_set_email_addresses (CouchdbDocument *document, GSList
const gchar *address_str;
CouchdbStructField *sf = (CouchdbStructField *) l->data;
- address_str = couchdb_document_contact_email_get_address (sf);
+ address_str = desktopcouch_document_contact_email_get_address (sf);
if (address_str) {
JsonObject *this_address;
this_address = json_object_new ();
json_object_set_string_member (this_address, "address", address_str);
json_object_set_string_member (this_address, "description",
- couchdb_document_contact_email_get_description (sf));
+ desktopcouch_document_contact_email_get_description (sf));
json_object_set_object_member (addresses_json,
couchdb_struct_field_get_uuid (sf),
@@ -379,13 +379,13 @@ couchdb_document_contact_set_email_addresses (CouchdbDocument *document, GSList
}
GSList *
-couchdb_document_contact_get_phone_numbers (CouchdbDocument *document)
+desktopcouch_document_contact_get_phone_numbers (CouchdbDocument *document)
{
GSList *list = NULL;
JsonObject *phone_numbers;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
phone_numbers = json_object_get_object_member (
couchdb_document_get_json_object (document), "phone_numbers");
@@ -399,7 +399,7 @@ couchdb_document_contact_get_phone_numbers (CouchdbDocument *document)
}
void
-couchdb_document_contact_set_phone_numbers (CouchdbDocument *document, GSList *list)
+desktopcouch_document_contact_set_phone_numbers (CouchdbDocument *document, GSList *list)
{
GSList *l;
JsonObject *phone_numbers;
@@ -411,16 +411,16 @@ couchdb_document_contact_set_phone_numbers (CouchdbDocument *document, GSList *l
const gchar *number_str;
CouchdbStructField *sf = (CouchdbStructField *) l->data;
- number_str = couchdb_document_contact_phone_get_number (sf);
+ number_str = desktopcouch_document_contact_phone_get_number (sf);
if (number_str) {
JsonObject *this_phone;
this_phone = json_object_new ();
json_object_set_string_member (this_phone, "number", number_str);
json_object_set_string_member (this_phone, "description",
- couchdb_document_contact_phone_get_description (sf));
+ desktopcouch_document_contact_phone_get_description (sf));
json_object_set_int_member (this_phone, "priority",
- couchdb_document_contact_phone_get_priority (sf));
+ desktopcouch_document_contact_phone_get_priority (sf));
json_object_set_object_member (phone_numbers,
couchdb_struct_field_get_uuid (sf),
@@ -432,13 +432,13 @@ couchdb_document_contact_set_phone_numbers (CouchdbDocument *document, GSList *l
}
GSList *
-couchdb_document_contact_get_addresses (CouchdbDocument *document)
+desktopcouch_document_contact_get_addresses (CouchdbDocument *document)
{
GSList *list = NULL;
JsonObject *addresses;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
addresses = json_object_get_object_member (
couchdb_document_get_json_object (document), "addresses");
@@ -452,7 +452,7 @@ couchdb_document_contact_get_addresses (CouchdbDocument *document)
}
void
-couchdb_document_contact_set_addresses (CouchdbDocument *document, GSList *list)
+desktopcouch_document_contact_set_addresses (CouchdbDocument *document, GSList *list)
{
GSList *l;
JsonObject *addresses;
@@ -464,24 +464,24 @@ couchdb_document_contact_set_addresses (CouchdbDocument *document, GSList *list)
const gchar *street_str;
CouchdbStructField *sf = (CouchdbStructField *) l->data;
- street_str = couchdb_document_contact_address_get_street (sf);
+ street_str = desktopcouch_document_contact_address_get_street (sf);
if (street_str) {
JsonObject *this_address;
this_address = json_object_new ();
json_object_set_string_member (this_address, "street", street_str);
json_object_set_string_member (this_address, "city",
- couchdb_document_contact_address_get_city (sf));
+ desktopcouch_document_contact_address_get_city (sf));
json_object_set_string_member (this_address, "state",
- couchdb_document_contact_address_get_state (sf));
+ desktopcouch_document_contact_address_get_state (sf));
json_object_set_string_member (this_address, "country",
- couchdb_document_contact_address_get_country (sf));
+ desktopcouch_document_contact_address_get_country (sf));
json_object_set_string_member (this_address, "postalcode",
- couchdb_document_contact_address_get_postalcode (sf));
+ desktopcouch_document_contact_address_get_postalcode (sf));
json_object_set_string_member (this_address, "pobox",
- couchdb_document_contact_address_get_pobox (sf));
+ desktopcouch_document_contact_address_get_pobox (sf));
json_object_set_string_member (this_address, "description",
- couchdb_document_contact_address_get_description (sf));
+ desktopcouch_document_contact_address_get_description (sf));
json_object_set_object_member (addresses,
couchdb_struct_field_get_uuid (sf),
@@ -493,13 +493,13 @@ couchdb_document_contact_set_addresses (CouchdbDocument *document, GSList *list)
}
GSList *
-couchdb_document_contact_get_im_addresses (CouchdbDocument *document)
+desktopcouch_document_contact_get_im_addresses (CouchdbDocument *document)
{
GSList *list = NULL;
JsonObject *im_addresses;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
im_addresses = json_object_get_object_member (
couchdb_document_get_json_object (document), "im_addresses");
@@ -513,7 +513,7 @@ couchdb_document_contact_get_im_addresses (CouchdbDocument *document)
}
void
-couchdb_document_contact_set_im_addresses (CouchdbDocument *document, GSList *list)
+desktopcouch_document_contact_set_im_addresses (CouchdbDocument *document, GSList *list)
{
GSList *l;
JsonObject *im_addresses_json;
@@ -525,16 +525,16 @@ couchdb_document_contact_set_im_addresses (CouchdbDocument *document, GSList *li
const gchar *address_str;
CouchdbStructField *sf = (CouchdbStructField *) l->data;
- address_str = couchdb_document_contact_im_get_address (sf);
+ address_str = desktopcouch_document_contact_im_get_address (sf);
if (address_str != NULL) {
JsonObject *this_address;
this_address = json_object_new ();
json_object_set_string_member (this_address, "address", address_str);
json_object_set_string_member (this_address, "description",
- couchdb_document_contact_im_get_description (sf));
+ desktopcouch_document_contact_im_get_description (sf));
json_object_set_string_member (this_address, "protocol",
- couchdb_document_contact_im_get_protocol (sf));
+ desktopcouch_document_contact_im_get_protocol (sf));
json_object_set_object_member (im_addresses_json,
couchdb_struct_field_get_uuid (sf),
@@ -546,13 +546,13 @@ couchdb_document_contact_set_im_addresses (CouchdbDocument *document, GSList *li
}
GSList *
-couchdb_document_contact_get_urls (CouchdbDocument *document)
+desktopcouch_document_contact_get_urls (CouchdbDocument *document)
{
GSList *list = NULL;
JsonObject *urls;
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
urls = json_object_get_object_member (
couchdb_document_get_json_object (document), "urls");
@@ -566,7 +566,7 @@ couchdb_document_contact_get_urls (CouchdbDocument *document)
}
void
-couchdb_document_contact_set_urls (CouchdbDocument *document, GSList *list)
+desktopcouch_document_contact_set_urls (CouchdbDocument *document, GSList *list)
{
GSList *l;
JsonObject *urls_json;
@@ -578,14 +578,14 @@ couchdb_document_contact_set_urls (CouchdbDocument *document, GSList *list)
const gchar *address_str;
CouchdbStructField *sf = (CouchdbStructField *) l->data;
- address_str = couchdb_document_contact_url_get_address (sf);
+ address_str = desktopcouch_document_contact_url_get_address (sf);
if (address_str) {
JsonObject *this_url;
this_url = json_object_new ();
json_object_set_string_member (this_url, "address", address_str);
json_object_set_string_member (this_url, "description",
- couchdb_document_contact_url_get_description (sf));
+ desktopcouch_document_contact_url_get_description (sf));
json_object_set_object_member (urls_json,
couchdb_struct_field_get_uuid (sf),
@@ -597,26 +597,26 @@ couchdb_document_contact_set_urls (CouchdbDocument *document, GSList *list)
}
const char *
-couchdb_document_contact_get_notes (CouchdbDocument *document)
+desktopcouch_document_contact_get_notes (CouchdbDocument *document)
{
g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
- g_return_val_if_fail (couchdb_document_is_contact (document), NULL);
+ g_return_val_if_fail (desktopcouch_document_is_contact (document), NULL);
return couchdb_document_get_string_field (document, "notes");
}
void
-couchdb_document_contact_set_notes (CouchdbDocument *document, const char *notes)
+desktopcouch_document_contact_set_notes (CouchdbDocument *document, const char *notes)
{
g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
- g_return_if_fail (couchdb_document_is_contact (document));
+ g_return_if_fail (desktopcouch_document_is_contact (document));
g_return_if_fail (notes != NULL);
couchdb_document_set_string_field (document, "notes", notes);
}
CouchdbStructField *
-couchdb_document_contact_email_new (const char *uuid, const char *address, const char *description)
+desktopcouch_document_contact_email_new (const char *uuid, const char *address, const char *description)
{
CouchdbStructField *sf;
@@ -630,15 +630,15 @@ couchdb_document_contact_email_new (const char *uuid, const char *address, const
}
if (address)
- couchdb_document_contact_email_set_address (sf, address);
+ desktopcouch_document_contact_email_set_address (sf, address);
if (description)
- couchdb_document_contact_email_set_description (sf, description);
+ desktopcouch_document_contact_email_set_description (sf, description);
return sf;
}
const char *
-couchdb_document_contact_email_get_address (CouchdbStructField *sf)
+desktopcouch_document_contact_email_get_address (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -646,7 +646,7 @@ couchdb_document_contact_email_get_address (CouchdbStructField *sf)
}
void
-couchdb_document_contact_email_set_address (CouchdbStructField *sf, const char *email)
+desktopcouch_document_contact_email_set_address (CouchdbStructField *sf, const char *email)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (email != NULL);
@@ -655,7 +655,7 @@ couchdb_document_contact_email_set_address (CouchdbStructField *sf, const char *
}
const char *
-couchdb_document_contact_email_get_description (CouchdbStructField *sf)
+desktopcouch_document_contact_email_get_description (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -663,7 +663,7 @@ couchdb_document_contact_email_get_description (CouchdbStructField *sf)
}
void
-couchdb_document_contact_email_set_description (CouchdbStructField *sf, const char *description)
+desktopcouch_document_contact_email_set_description (CouchdbStructField *sf, const char *description)
{
g_return_if_fail (sf != NULL);
@@ -671,7 +671,7 @@ couchdb_document_contact_email_set_description (CouchdbStructField *sf, const ch
}
CouchdbStructField *
-couchdb_document_contact_phone_new (const char *uuid, const char *number, const char *description, gint priority)
+desktopcouch_document_contact_phone_new (const char *uuid, const char *number, const char *description, gint priority)
{
CouchdbStructField *sf;
@@ -685,16 +685,16 @@ couchdb_document_contact_phone_new (const char *uuid, const char *number, const
}
if (number)
- couchdb_document_contact_phone_set_number (sf, number);
+ desktopcouch_document_contact_phone_set_number (sf, number);
if (description)
- couchdb_document_contact_phone_set_description (sf, description);
- couchdb_document_contact_phone_set_priority (sf, priority);
+ desktopcouch_document_contact_phone_set_description (sf, description);
+ desktopcouch_document_contact_phone_set_priority (sf, priority);
return sf;
}
gint
-couchdb_document_contact_phone_get_priority (CouchdbStructField *sf)
+desktopcouch_document_contact_phone_get_priority (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, 0);
@@ -702,7 +702,7 @@ couchdb_document_contact_phone_get_priority (CouchdbStructField *sf)
}
void
-couchdb_document_contact_phone_set_priority (CouchdbStructField *sf, gint priority)
+desktopcouch_document_contact_phone_set_priority (CouchdbStructField *sf, gint priority)
{
g_return_if_fail (sf != NULL);
@@ -710,7 +710,7 @@ couchdb_document_contact_phone_set_priority (CouchdbStructField *sf, gint priori
}
const char *
-couchdb_document_contact_phone_get_number (CouchdbStructField *sf)
+desktopcouch_document_contact_phone_get_number (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -718,7 +718,7 @@ couchdb_document_contact_phone_get_number (CouchdbStructField *sf)
}
void
-couchdb_document_contact_phone_set_number (CouchdbStructField *sf, const char *number)
+desktopcouch_document_contact_phone_set_number (CouchdbStructField *sf, const char *number)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (number != NULL);
@@ -727,7 +727,7 @@ couchdb_document_contact_phone_set_number (CouchdbStructField *sf, const char *n
}
const char *
-couchdb_document_contact_phone_get_description (CouchdbStructField *sf)
+desktopcouch_document_contact_phone_get_description (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -735,7 +735,7 @@ couchdb_document_contact_phone_get_description (CouchdbStructField *sf)
}
void
-couchdb_document_contact_phone_set_description (CouchdbStructField *sf, const char *description)
+desktopcouch_document_contact_phone_set_description (CouchdbStructField *sf, const char *description)
{
g_return_if_fail (sf != NULL);
@@ -743,7 +743,7 @@ couchdb_document_contact_phone_set_description (CouchdbStructField *sf, const ch
}
CouchdbStructField *
-couchdb_document_contact_address_new (const char *uuid,
+desktopcouch_document_contact_address_new (const char *uuid,
const char *street,
const char *city,
const char *state,
@@ -764,25 +764,25 @@ couchdb_document_contact_address_new (const char *uuid,
}
if (street)
- couchdb_document_contact_address_set_street (sf, street);
+ desktopcouch_document_contact_address_set_street (sf, street);
if (city)
- couchdb_document_contact_address_set_city (sf, city);
+ desktopcouch_document_contact_address_set_city (sf, city);
if (state)
- couchdb_document_contact_address_set_state (sf, state);
+ desktopcouch_document_contact_address_set_state (sf, state);
if (country)
- couchdb_document_contact_address_set_country (sf, country);
+ desktopcouch_document_contact_address_set_country (sf, country);
if (postalcode)
- couchdb_document_contact_address_set_postalcode (sf, postalcode);
+ desktopcouch_document_contact_address_set_postalcode (sf, postalcode);
if (pobox)
- couchdb_document_contact_address_set_pobox (sf, pobox);
+ desktopcouch_document_contact_address_set_pobox (sf, pobox);
if (description)
- couchdb_document_contact_address_set_description (sf, description);
+ desktopcouch_document_contact_address_set_description (sf, description);
return sf;
}
const char *
-couchdb_document_contact_address_get_street (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_street (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -790,7 +790,7 @@ couchdb_document_contact_address_get_street (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_street (CouchdbStructField *sf, const char *street)
+desktopcouch_document_contact_address_set_street (CouchdbStructField *sf, const char *street)
{
g_return_if_fail (sf != NULL);
@@ -798,7 +798,7 @@ couchdb_document_contact_address_set_street (CouchdbStructField *sf, const char
}
const char *
-couchdb_document_contact_address_get_city (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_city (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -806,7 +806,7 @@ couchdb_document_contact_address_get_city (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_city (CouchdbStructField *sf, const char *city)
+desktopcouch_document_contact_address_set_city (CouchdbStructField *sf, const char *city)
{
g_return_if_fail (sf != NULL);
@@ -814,7 +814,7 @@ couchdb_document_contact_address_set_city (CouchdbStructField *sf, const char *c
}
const char *
-couchdb_document_contact_address_get_state (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_state (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -822,7 +822,7 @@ couchdb_document_contact_address_get_state (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_state (CouchdbStructField *sf, const char *state)
+desktopcouch_document_contact_address_set_state (CouchdbStructField *sf, const char *state)
{
g_return_if_fail (sf != NULL);
@@ -830,7 +830,7 @@ couchdb_document_contact_address_set_state (CouchdbStructField *sf, const char *
}
const char *
-couchdb_document_contact_address_get_country (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_country (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -838,7 +838,7 @@ couchdb_document_contact_address_get_country (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_country (CouchdbStructField *sf, const char *country)
+desktopcouch_document_contact_address_set_country (CouchdbStructField *sf, const char *country)
{
g_return_if_fail (sf != NULL);
@@ -846,7 +846,7 @@ couchdb_document_contact_address_set_country (CouchdbStructField *sf, const char
}
const char *
-couchdb_document_contact_address_get_postalcode (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_postalcode (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -854,7 +854,7 @@ couchdb_document_contact_address_get_postalcode (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_postalcode (CouchdbStructField *sf, const char *postalcode)
+desktopcouch_document_contact_address_set_postalcode (CouchdbStructField *sf, const char *postalcode)
{
g_return_if_fail (sf != NULL);
@@ -862,7 +862,7 @@ couchdb_document_contact_address_set_postalcode (CouchdbStructField *sf, const c
}
const char *
-couchdb_document_contact_address_get_pobox (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_pobox (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -870,7 +870,7 @@ couchdb_document_contact_address_get_pobox (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_pobox (CouchdbStructField *sf, const char *pobox)
+desktopcouch_document_contact_address_set_pobox (CouchdbStructField *sf, const char *pobox)
{
g_return_if_fail (sf != NULL);
@@ -878,7 +878,7 @@ couchdb_document_contact_address_set_pobox (CouchdbStructField *sf, const char *
}
const char *
-couchdb_document_contact_address_get_description (CouchdbStructField *sf)
+desktopcouch_document_contact_address_get_description (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -886,7 +886,7 @@ couchdb_document_contact_address_get_description (CouchdbStructField *sf)
}
void
-couchdb_document_contact_address_set_description (CouchdbStructField *sf, const char *description)
+desktopcouch_document_contact_address_set_description (CouchdbStructField *sf, const char *description)
{
g_return_if_fail (sf != NULL);
@@ -894,7 +894,7 @@ couchdb_document_contact_address_set_description (CouchdbStructField *sf, const
}
CouchdbStructField *
-couchdb_document_contact_im_new (const char *uuid,
+desktopcouch_document_contact_im_new (const char *uuid,
const char *address,
const char *description,
const char *protocol)
@@ -911,17 +911,17 @@ couchdb_document_contact_im_new (const char *uuid,
}
if (address != NULL)
- couchdb_document_contact_im_set_address (sf, address);
+ desktopcouch_document_contact_im_set_address (sf, address);
if (description != NULL)
- couchdb_document_contact_im_set_description (sf, description);
+ desktopcouch_document_contact_im_set_description (sf, description);
if (protocol != NULL)
- couchdb_document_contact_im_set_protocol (sf, protocol);
+ desktopcouch_document_contact_im_set_protocol (sf, protocol);
return sf;
}
const char *
-couchdb_document_contact_im_get_address (CouchdbStructField *sf)
+desktopcouch_document_contact_im_get_address (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -929,7 +929,7 @@ couchdb_document_contact_im_get_address (CouchdbStructField *sf)
}
void
-couchdb_document_contact_im_set_address (CouchdbStructField *sf, const char *address)
+desktopcouch_document_contact_im_set_address (CouchdbStructField *sf, const char *address)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (address != NULL);
@@ -938,7 +938,7 @@ couchdb_document_contact_im_set_address (CouchdbStructField *sf, const char *add
}
const char *
-couchdb_document_contact_im_get_description (CouchdbStructField *sf)
+desktopcouch_document_contact_im_get_description (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -946,7 +946,7 @@ couchdb_document_contact_im_get_description (CouchdbStructField *sf)
}
void
-couchdb_document_contact_im_set_description (CouchdbStructField *sf, const char *description)
+desktopcouch_document_contact_im_set_description (CouchdbStructField *sf, const char *description)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (description != NULL);
@@ -955,7 +955,7 @@ couchdb_document_contact_im_set_description (CouchdbStructField *sf, const char
}
const char *
-couchdb_document_contact_im_get_protocol (CouchdbStructField *sf)
+desktopcouch_document_contact_im_get_protocol (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -963,7 +963,7 @@ couchdb_document_contact_im_get_protocol (CouchdbStructField *sf)
}
void
-couchdb_document_contact_im_set_protocol (CouchdbStructField *sf, const char *protocol)
+desktopcouch_document_contact_im_set_protocol (CouchdbStructField *sf, const char *protocol)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (protocol != NULL);
@@ -972,7 +972,7 @@ couchdb_document_contact_im_set_protocol (CouchdbStructField *sf, const char *pr
}
CouchdbStructField *
-couchdb_document_contact_url_new (const char *uuid, const char *address, const char *description)
+desktopcouch_document_contact_url_new (const char *uuid, const char *address, const char *description)
{
CouchdbStructField *sf;
@@ -986,15 +986,15 @@ couchdb_document_contact_url_new (const char *uuid, const char *address, const c
}
if (address)
- couchdb_document_contact_url_set_address (sf, address);
+ desktopcouch_document_contact_url_set_address (sf, address);
if (description)
- couchdb_document_contact_url_set_description (sf, description);
+ desktopcouch_document_contact_url_set_description (sf, description);
return sf;
}
const char *
-couchdb_document_contact_url_get_address (CouchdbStructField *sf)
+desktopcouch_document_contact_url_get_address (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -1002,7 +1002,7 @@ couchdb_document_contact_url_get_address (CouchdbStructField *sf)
}
void
-couchdb_document_contact_url_set_address (CouchdbStructField *sf, const char *url)
+desktopcouch_document_contact_url_set_address (CouchdbStructField *sf, const char *url)
{
g_return_if_fail (sf != NULL);
g_return_if_fail (url != NULL);
@@ -1011,7 +1011,7 @@ couchdb_document_contact_url_set_address (CouchdbStructField *sf, const char *ur
}
const char *
-couchdb_document_contact_url_get_description (CouchdbStructField *sf)
+desktopcouch_document_contact_url_get_description (CouchdbStructField *sf)
{
g_return_val_if_fail (sf != NULL, NULL);
@@ -1019,7 +1019,7 @@ couchdb_document_contact_url_get_description (CouchdbStructField *sf)
}
void
-couchdb_document_contact_url_set_description (CouchdbStructField *sf, const char *description)
+desktopcouch_document_contact_url_set_description (CouchdbStructField *sf, const char *description)
{
g_return_if_fail (sf != NULL);
diff --git a/desktopcouch-glib/desktopcouch-document-contact.h b/desktopcouch-glib/desktopcouch-document-contact.h
new file mode 100644
index 0000000..596cc84
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch-document-contact.h
@@ -0,0 +1,200 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Canonical Services Ltd (www.canonical.com)
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __DESKTOPCOUCH_DOCUMENT_CONTACT_H__
+#define __DESKTOPCOUCH_DOCUMENT_CONTACT_H__
+
+#include <couchdb-struct-field.h>
+#include <desktopcouch-document.h>
+
+G_BEGIN_DECLS
+
+#define DESKTOPCOUCH_RECORD_TYPE_CONTACT "http://www.freedesktop.org/wiki/Specifications/desktopcouch/contact"
+
+CouchdbDocument *desktopcouch_document_contact_new (CouchdbSession *couchdb);
+gboolean desktopcouch_document_is_contact (CouchdbDocument *document);
+
+/*
+ * Top level functions to manipulate documents representing a contact
+ */
+
+const char *desktopcouch_document_contact_get_first_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_first_name (CouchdbDocument *document, const char *first_name);
+const char *desktopcouch_document_contact_get_last_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_last_name (CouchdbDocument *document, const char *last_name);
+const char *desktopcouch_document_contact_get_nick_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_nick_name (CouchdbDocument *document, const char *nick_name);
+const char *desktopcouch_document_contact_get_spouse_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_spouse_name (CouchdbDocument *document, const char *spouse_name);
+const char *desktopcouch_document_contact_get_birth_date (CouchdbDocument *document);
+void desktopcouch_document_contact_set_birth_date (CouchdbDocument *document, const char *birth_date);
+const char *desktopcouch_document_contact_get_wedding_date (CouchdbDocument *document);
+void desktopcouch_document_contact_set_wedding_date (CouchdbDocument *document, const char *wedding_date);
+
+const char *desktopcouch_document_contact_get_company (CouchdbDocument *document);
+void desktopcouch_document_contact_set_company (CouchdbDocument *document, const char *company);
+const char *desktopcouch_document_contact_get_department (CouchdbDocument *document);
+void desktopcouch_document_contact_set_department (CouchdbDocument *document, const char *department);
+const char *desktopcouch_document_contact_get_title (CouchdbDocument *document);
+void desktopcouch_document_contact_set_title (CouchdbDocument *document, const char *title);
+const char *desktopcouch_document_contact_get_job_title (CouchdbDocument *document);
+void desktopcouch_document_contact_set_job_title (CouchdbDocument *document, const char *job_title);
+const char *desktopcouch_document_contact_get_manager_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_manager_name (CouchdbDocument *document, const char *manager_name);
+const char *desktopcouch_document_contact_get_assistant_name (CouchdbDocument *document);
+void desktopcouch_document_contact_set_assistant_name (CouchdbDocument *document, const char *assistant_name);
+const char *desktopcouch_document_contact_get_office (CouchdbDocument *document);
+void desktopcouch_document_contact_set_office (CouchdbDocument *document, const char *office);
+
+GSList *desktopcouch_document_contact_get_email_addresses (CouchdbDocument *document);
+void desktopcouch_document_contact_set_email_addresses (CouchdbDocument *document, GSList *list);
+
+GSList *desktopcouch_document_contact_get_phone_numbers (CouchdbDocument *document);
+void desktopcouch_document_contact_set_phone_numbers (CouchdbDocument *document, GSList *list);
+
+GSList *desktopcouch_document_contact_get_addresses (CouchdbDocument *document);
+void desktopcouch_document_contact_set_addresses (CouchdbDocument *document, GSList *list);
+
+GSList *desktopcouch_document_contact_get_im_addresses (CouchdbDocument *document);
+void desktopcouch_document_contact_set_im_addresses (CouchdbDocument *document, GSList *list);
+
+GSList *desktopcouch_document_contact_get_urls (CouchdbDocument *document);
+void desktopcouch_document_contact_set_urls (CouchdbDocument *document, GSList *list);
+
+const char *desktopcouch_document_contact_get_notes (CouchdbDocument *document);
+void desktopcouch_document_contact_set_notes (CouchdbDocument *document, const char *notes);
+
+/*
+ * Utility functions to manipulate email addresses fields
+ */
+
+CouchdbStructField *desktopcouch_document_contact_email_new (const char *uuid, const char *address, const char *description);
+const char *desktopcouch_document_contact_email_get_address (CouchdbStructField *sf);
+void desktopcouch_document_contact_email_set_address (CouchdbStructField *sf, const char *email);
+
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_EMAIL_DESCRIPTION_HOME "home"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_EMAIL_DESCRIPTION_OTHER "other"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_EMAIL_DESCRIPTION_WORK "work"
+
+const char *desktopcouch_document_contact_email_get_description (CouchdbStructField *sf);
+void desktopcouch_document_contact_email_set_description (CouchdbStructField *sf, const char *description);
+
+/*
+ * Utility functions to manipulate phone numbers
+ */
+
+CouchdbStructField *desktopcouch_document_contact_phone_new (const char *uuid, const char *number, const char *description, gint priority);
+gint desktopcouch_document_contact_phone_get_priority (CouchdbStructField *sf);
+void desktopcouch_document_contact_phone_set_priority (CouchdbStructField *sf, gint priority);
+const char *desktopcouch_document_contact_phone_get_number (CouchdbStructField *sf);
+void desktopcouch_document_contact_phone_set_number (CouchdbStructField *sf, const char *number);
+
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_ASSISTANT "assistant"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_CALLBACK "callback"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_CAR "car"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_COMPANY "company"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_HOME "home"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_HOME_FAX "home fax"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_MOBILE "mobile"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_OTHER "other"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_OTHER_FAX "other fax"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_PAGER "pager"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_PRIMARY "primary"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_RADIO "radio"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_TELEX "telex"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_WORK "work"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_PHONE_DESCRIPTION_WORK_FAX "work fax"
+
+const char *desktopcouch_document_contact_phone_get_description (CouchdbStructField *sf);
+void desktopcouch_document_contact_phone_set_description (CouchdbStructField *sf, const char *description);
+
+/*
+ * Utility functions to manipulate addresses
+ */
+CouchdbStructField *desktopcouch_document_contact_address_new (const char *uuid,
+ const char *street,
+ const char *city,
+ const char *state,
+ const char *country,
+ const char *postalcode,
+ const char *pobox,
+ const char *description);
+const char *desktopcouch_document_contact_address_get_street (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_street (CouchdbStructField *sf, const char *street);
+const char *desktopcouch_document_contact_address_get_city (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_city (CouchdbStructField *sf, const char *city);
+const char *desktopcouch_document_contact_address_get_state (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_state (CouchdbStructField *sf, const char *state);
+const char *desktopcouch_document_contact_address_get_country (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_country (CouchdbStructField *sf, const char *country);
+const char *desktopcouch_document_contact_address_get_postalcode (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_postalcode (CouchdbStructField *sf, const char *postalcode);
+const char *desktopcouch_document_contact_address_get_pobox (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_pobox (CouchdbStructField *sf, const char *pobox);
+
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_ADDRESS_DESCRIPTION_HOME "home"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_ADDRESS_DESCRIPTION_OTHER "other"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_ADDRESS_DESCRIPTION_WORK "work"
+
+const char *desktopcouch_document_contact_address_get_description (CouchdbStructField *sf);
+void desktopcouch_document_contact_address_set_description (CouchdbStructField *sf, const char *description);
+
+/*
+ * Utility functions to manipulate IM addresses
+ */
+CouchdbStructField *desktopcouch_document_contact_im_new (const char *uuid,
+ const char *address,
+ const char *description,
+ const char *protocol);
+const char *desktopcouch_document_contact_im_get_address (CouchdbStructField *sf);
+void desktopcouch_document_contact_im_set_address (CouchdbStructField *sf, const char *address);
+const char *desktopcouch_document_contact_im_get_description (CouchdbStructField *sf);
+void desktopcouch_document_contact_im_set_description (CouchdbStructField *sf, const char *description);
+
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_AIM "aim"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU "gadu-gadu"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE "groupwise"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ "icq"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_IRC "irc"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER "jabber"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_MSN "msn"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE "skype"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO "yahoo"
+
+const char *desktopcouch_document_contact_im_get_protocol (CouchdbStructField *sf);
+void desktopcouch_document_contact_im_set_protocol (CouchdbStructField *sf, const char *protocol);
+
+/*
+ * Utility functions to manipulate URLs
+ */
+CouchdbStructField *desktopcouch_document_contact_url_new (const char *uuid, const char *address, const char *description);
+const char *desktopcouch_document_contact_url_get_address (CouchdbStructField *sf);
+void desktopcouch_document_contact_url_set_address (CouchdbStructField *sf, const char *address);
+
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_URL_DESCRIPTION_BLOG "blog"
+#define DESKTOPCOUCH_DOCUMENT_CONTACT_URL_DESCRIPTION_HOMEPAGE "home page"
+
+const char *desktopcouch_document_contact_url_get_description (CouchdbStructField *sf);
+void desktopcouch_document_contact_url_set_description (CouchdbStructField *sf, const char *description);
+
+G_END_DECLS
+
+#endif /* __DESKTOPCOUCH_DOCUMENT_CONTACT_H__ */
diff --git a/desktopcouch-glib/desktopcouch-document.c b/desktopcouch-glib/desktopcouch-document.c
new file mode 100644
index 0000000..2aecd16
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch-document.c
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Canonical Services Ltd (www.canonical.com)
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "desktopcouch-document.h"
+
+const char *
+desktopcouch_document_get_record_type (CouchdbDocument *document)
+{
+ g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
+
+ return couchdb_document_get_string_field (document, "record_type");
+}
+
+void
+desktopcouch_document_set_record_type (CouchdbDocument *document, const char *record_type)
+{
+ g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
+ g_return_if_fail (record_type != NULL);
+
+ couchdb_document_set_string_field (document, "record_type", record_type);
+}
+
+CouchdbStructField *
+desktopcouch_document_get_application_annotations (CouchdbDocument *document)
+{
+ g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
+
+ return couchdb_document_get_struct_field (document, "application_annotations");
+}
+
+void
+desktopcouch_document_set_application_annotations (CouchdbDocument *document, CouchdbStructField *annotations)
+{
+ g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
+
+ couchdb_document_set_struct_field (document, "application_annotations", annotations);
+}
diff --git a/desktopcouch-glib/desktopcouch-document.h b/desktopcouch-glib/desktopcouch-document.h
new file mode 100644
index 0000000..58d7137
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch-document.h
@@ -0,0 +1,39 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Canonical Services Ltd (www.canonical.com)
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __DESKTOPCOUCH_DOCUMENT_H__
+#define __DESKTOPCOUCH_DOCUMENT_H__
+
+#include <couchdb-glib.h>
+
+G_BEGIN_DECLS
+
+const char *desktopcouch_document_get_record_type (CouchdbDocument *document);
+void desktopcouch_document_set_record_type (CouchdbDocument *document,
+ const char *record_type);
+
+CouchdbStructField *desktopcouch_document_get_application_annotations (CouchdbDocument *document);
+void desktopcouch_document_set_application_annotations (CouchdbDocument *document,
+ CouchdbStructField *annotations);
+
+G_END_DECLS
+
+#endif
diff --git a/desktopcouch-glib/desktopcouch-glib.h b/desktopcouch-glib/desktopcouch-glib.h
index e5ee60a..37fba54 100644
--- a/desktopcouch-glib/desktopcouch-glib.h
+++ b/desktopcouch-glib/desktopcouch-glib.h
@@ -22,6 +22,8 @@
#ifndef __DESKTOPCOUCH_GLIB_H__
#define __DESKTOPCOUCH_GLIB_H__
+#include <desktopcouch-document.h>
+#include <desktopcouch-document-contact.h>
#include <desktopcouch-session.h>
#endif /* __DESKTOPCOUCH_GLIB_H__ */
diff --git a/doc/reference/couchdb-glib-docs.sgml b/doc/reference/couchdb-glib-docs.sgml
index 69accde..4eec60b 100644
--- a/doc/reference/couchdb-glib-docs.sgml
+++ b/doc/reference/couchdb-glib-docs.sgml
@@ -11,7 +11,6 @@
<xi:include href="xml/couchdb-session.xml"/>
<xi:include href="xml/couchdb-credentials.xml"/>
<xi:include href="xml/couchdb-document.xml"/>
- <xi:include href="xml/couchdb-document-contact.xml"/>
<xi:include href="xml/couchdb-document-info.xml"/>
<xi:include href="xml/couchdb-database-info.xml"/>
<xi:include href="xml/couchdb-struct-field.xml"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]