3 /// Null wrapper class for when opensync 0.22 is not available
7 Copyright (C) 2009-2013, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
28 static void ThrowNotSupported()
30 throw std::logic_error(_C("Not supported on this system."));
33 /////////////////////////////////////////////////////////////////////////////
34 // OpenSync22 - public members
36 bool OpenSync22::symbols_loaded
= false;
38 OpenSync22::OpenSync22()
40 throw std::runtime_error(_C("OpenSync 0.22 support was not compiled in."));
43 OpenSync22::~OpenSync22()
47 /////////////////////////////////////////////////////////////////////////////
48 // Null implementations
50 const char* OpenSync22::GetVersion() const
55 const char* OpenSync22::GetEngineName() const
60 void OpenSync22::GetPluginNames(string_list_type
&plugins
)
64 void OpenSync22::GetFormats(format_list_type
&formats
)
68 void OpenSync22::GetGroupNames(string_list_type
&groups
)
72 void OpenSync22::GetMembers(const std::string
&group_name
,
73 member_list_type
&members
)
77 void OpenSync22::AddGroup(const std::string
&group_name
)
81 void OpenSync22::DeleteGroup(const std::string
&group_name
)
85 Converter
& OpenSync22::GetConverter()
87 throw std::logic_error(_C("Not supported on this system."));
90 long OpenSync22::AddMember(const std::string
&group_name
,
91 const std::string
&plugin_name
,
92 const std::string
&member_name
)
97 bool OpenSync22::IsConfigurable(const std::string
&group_name
,
103 std::string
OpenSync22::GetConfiguration(const std::string
&group_name
,
109 void OpenSync22::SetConfiguration(const std::string
&group_name
,
110 long member_id
, const std::string
&config_data
)
114 void OpenSync22::Discover(const std::string
&group_name
)
118 void OpenSync22::Sync(const std::string
&group_name
,
119 SyncStatus
&status_callback
,
120 Config::pst_type sync_types
)
124 //////////////////////////////////////////////////////////////////////////////
125 // Null Converter class
127 Converter22::Converter22(OpenSync::API
&api
)
132 bool Converter22::IsPluginSupported(const std::string
&plugin_name
,
133 std::string
*appname
) const
138 Converter::plugin_ptr
Converter22::CreateAndLoadPlugin(const Member
&member
)
140 return Converter::plugin_ptr();
143 std::string
Converter22::GetPluginName(const Config::Barry
&) const
145 throw std::logic_error(_C("Not supported on this system."));
148 std::string
Converter22::GetPluginName(const Config::Evolution
&) const
150 throw std::logic_error(_C("Not supported on this system."));
153 std::string
Converter22::GetPluginName(const Config::Evolution3
&) const
155 throw std::logic_error(_C("Not supported on this system."));
158 std::string
Converter22::GetPluginName(const Config::Google
&) const
160 throw std::logic_error(_C("Not supported on this system."));
163 std::string
Converter22::GetPluginName(const Config::KDEPim
&) const
165 throw std::logic_error(_C("Not supported on this system."));
168 std::string
Converter22::GetPluginName(const Config::Unsupported
&) const
170 throw std::logic_error(_C("Not supported on this system."));
173 bool Converter22::IsConfigured(const Config::Barry
&) const
178 bool Converter22::IsConfigured(const Config::Evolution
&) const
183 bool Converter22::IsConfigured(const Config::Evolution3
&) const
188 bool Converter22::IsConfigured(const Config::Google
&) const
193 bool Converter22::IsConfigured(const Config::KDEPim
&) const
198 bool Converter22::IsConfigured(const Config::Unsupported
&) const
203 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::Barry
&) const
208 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::Evolution
&) const
213 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::Evolution3
&) const
218 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::Google
&) const
223 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::KDEPim
&) const
228 Config::pst_type
Converter22::GetSupportedSyncTypes(const Config::Unsupported
&) const
233 void Converter22::Load(Config::Barry
&config
, const Member
&member
)
238 std::string
Converter22::GrabField(const std::string
&cfg
,
239 const std::string
&name
)
241 throw std::logic_error(_C("Not supported on this system."));
244 void Converter22::Load(Config::Evolution
&config
, const Member
&member
)
249 void Converter22::Load(Config::Evolution3
&config
, const Member
&member
)
254 void Converter22::Load(Config::Google
&config
, const Member
&member
)
259 void Converter22::Load(Config::KDEPim
&config
, const Member
&member
)
264 void Converter22::Load(Config::Unsupported
&config
, const Member
&member
)
269 void Converter22::Save(const Config::Barry
&config
, const std::string
&group_name
)
274 void Converter22::Save(const Config::Evolution
&config
, const std::string
&group_name
)
279 void Converter22::Save(const Config::Evolution3
&config
, const std::string
&group_name
)
284 void Converter22::Save(const Config::Google
&config
, const std::string
&group_name
)
289 void Converter22::Save(const Config::KDEPim
&config
, const std::string
&group_name
)
294 void Converter22::Save(const Config::Unsupported
&config
, const std::string
&group_name
)