2005-11-26 22:16:03 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2005 Patrick Ohly
|
|
|
|
*
|
|
|
|
* 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 INCL_EVOLUTIONSYNCCLIENT
|
|
|
|
#define INCL_EVOLUTIONSYNCCLIENT
|
|
|
|
|
2006-04-06 19:02:43 +02:00
|
|
|
#include <config.h>
|
2005-11-26 22:16:03 +01:00
|
|
|
|
2006-08-14 22:52:34 +02:00
|
|
|
#include "EvolutionSmartPtr.h"
|
2006-09-07 21:47:29 +02:00
|
|
|
#include <client/SyncClient.h>
|
2006-08-14 22:52:34 +02:00
|
|
|
|
2005-11-26 22:16:03 +01:00
|
|
|
#include <string>
|
2006-04-09 13:48:11 +02:00
|
|
|
#include <set>
|
2005-11-26 22:16:03 +01:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the main class inside sync4jevolution which
|
|
|
|
* looks at the configuration, activates all enabled
|
|
|
|
* sources and executes the synchronization.
|
|
|
|
*
|
|
|
|
*/
|
2006-09-07 21:47:29 +02:00
|
|
|
class EvolutionSyncClient : public SyncClient {
|
2005-11-26 22:16:03 +01:00
|
|
|
const string m_server;
|
2006-04-09 13:48:11 +02:00
|
|
|
const set<string> m_sources;
|
2006-08-06 09:56:41 +02:00
|
|
|
const SyncMode m_syncMode;
|
|
|
|
const bool m_doLogging;
|
2006-06-11 22:07:26 +02:00
|
|
|
const string m_configPath;
|
2005-11-26 22:16:03 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @param server identifies the server config to be used
|
2006-08-06 09:56:41 +02:00
|
|
|
* @param syncMode setting this overrides the sync mode from the config
|
|
|
|
* @param doLogging write additional log and datatbase files about the sync
|
2005-11-26 22:16:03 +01:00
|
|
|
*/
|
2006-08-06 09:56:41 +02:00
|
|
|
EvolutionSyncClient(const string &server,
|
|
|
|
SyncMode syncMode = SYNC_NONE,
|
|
|
|
bool doLogging = false,
|
|
|
|
const set<string> &sources = set<string>());
|
2005-11-26 22:16:03 +01:00
|
|
|
~EvolutionSyncClient();
|
|
|
|
|
|
|
|
/**
|
2006-03-19 22:37:30 +01:00
|
|
|
* Executes the sync, throws an exception in case of failure.
|
|
|
|
* Handles automatic backups and report generation.
|
2005-11-26 22:16:03 +01:00
|
|
|
*/
|
2006-08-06 09:56:41 +02:00
|
|
|
int sync();
|
2005-11-26 22:16:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCL_EVOLUTIONSYNCCLIENT
|