diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 853113796..728a9fe14 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -42,7 +42,8 @@ linphone_include_HEADERS=\ lpconfig.h \ sipsetup.h \ xml2lpc.h \ - xmlrpc.h + xmlrpc.h \ + carddav.h lib_LTLIBRARIES=liblinphone.la @@ -90,8 +91,10 @@ liblinphone_la_SOURCES=\ xml.c \ xmlrpc.c \ vtables.c \ + carddav.cc \ $(GITVERSION_FILE) +liblinphone_la_CXXFLAGS=-std=c++11 if BUILD_UPNP liblinphone_la_SOURCES+=upnp.c upnp.h endif @@ -118,7 +121,6 @@ endif if BUILD_VCARD liblinphone_la_SOURCES+=vcard.cc vcard.h -liblinphone_la_CXXFLAGS=-std=c++11 else liblinphone_la_SOURCES+=vcard_stubs.c vcard.h endif @@ -155,14 +157,14 @@ liblinphone_la_LIBADD= \ AM_CPPFLAGS=\ -I$(top_srcdir) -I$(top_srcdir)/include -I$(builddir) \ - $(ORTP_CFLAGS) \ - $(MEDIASTREAMER_CFLAGS) + $(ORTP_CFLAGS) \ + $(MEDIASTREAMER_CFLAGS) COMMON_CFLAGS=\ $(STRICT_OPTIONS) \ -DIN_LINPHONE \ $(SIPSTACK_CFLAGS) \ - -DENABLE_TRACE \ + -DENABLE_TRACE \ -DLOG_DOMAIN=\"LinphoneCore\" \ $(IPV6_CFLAGS) \ -DORTP_INET6 \ diff --git a/coreapi/carddav.cc b/coreapi/carddav.cc new file mode 100644 index 000000000..1c96ab246 --- /dev/null +++ b/coreapi/carddav.cc @@ -0,0 +1,28 @@ +/* +carddav.cc +Copyright (C) 2015 Belledonne Communications SARL + +This program 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 program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "carddav.h" + +extern "C" void linphone_core_start_carddav_sync(LinphoneCore *lc) { +#ifdef VCARD_ENABLED + +#else + ms_error("vCard isn't available (maybe it wasn't compiled), can't do CardDAV sync"); +#endif +} \ No newline at end of file diff --git a/coreapi/carddav.h b/coreapi/carddav.h new file mode 100644 index 000000000..5d85838e5 --- /dev/null +++ b/coreapi/carddav.h @@ -0,0 +1,35 @@ +/* +carddav.h +Copyright (C) 2015 Belledonne Communications SARL + +This program 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 program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef LINPHONE_CARDDAV_H +#define LINPHONE_CARDDAV_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "linphonecore.h" + +LINPHONE_PUBLIC void linphone_core_start_carddav_sync(LinphoneCore *lc); + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 2878d6d7f..863f8dae7 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7436,3 +7436,13 @@ const char *linphone_stream_type_to_string(const LinphoneStreamType type) { } return "INVALID"; } + +void linphone_core_set_carddav_server_url(LinphoneCore *lc, const char *carddav_server_url) { + if (lc->carddav_server_url) { + ms_free(lc->carddav_server_url); + lc->carddav_server_url = NULL; + } + if (carddav_server_url) { + lc->carddav_server_url = ms_strdup(carddav_server_url); + } +} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 2a4f1309a..3ee4144e4 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -4252,6 +4252,13 @@ LINPHONE_PUBLIC LinphoneTransportType linphone_transport_parse(const char* trans */ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc); +/** + * Sets the CardDAV server URL + * @param lc LinphoneCore object + * @param carddav_server_url the URL to the CardDAV server + */ +LINPHONE_PUBLIC void linphone_core_set_carddav_server_url(LinphoneCore *lc, const char *carddav_server_url); + #ifdef __cplusplus } #endif diff --git a/coreapi/private.h b/coreapi/private.h index 705f56605..7f774cbfe 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -972,6 +972,7 @@ struct _LinphoneCore jmethodID multicast_lock_acquire_id; jmethodID multicast_lock_release_id; #endif + char *carddav_server_url; };