#ifndef _EVOLUTION_SYNC_H_
#define _EVOLUTION_SYNC_H_

/* 
   MultiSync Evolution2 Plugin
   Copyright (C) 2004 Tom Foottit <tom@foottit.com>
   Copyright (C) 2004 Bo Lincoln <lincoln@lysator.liu.se>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
   SOFTWARE IS DISCLAIMED.
*/

/*
 *  $Id: evolution_sync.h,v 1.3.2.2 2004/10/26 14:34:18 azrael2 Exp $
 */

#include <libecal/e-cal.h>
#include <libebook/e-book.h>

#include <multisync.h>

//#include <stdlib.h>
//#include <glib.h>

#include <libxml/xmlmemory.h>
#include <libxml/parser.h>

#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>

typedef struct {
	client_connection commondata;
	char *change_id;
	char *configfile;
	char *adressbook_path;
	EBook *adressbook;
	char *calendar_path;
	ECal *calendar;
	char *tasks_path;
	ECal *tasks;
	int debuglevel;
	sync_pair *handle;
	connection_type type;
} evo_environment;

void evo_debug(evo_environment *env, int level, char *message, ...);
ESource *find_source(ESourceList *list, char *uri);
evo_environment *evo_env_create(sync_pair *handle, connection_type type);
void evo_env_free(evo_environment *env);

#endif
