Bumped copyright dates for 2013
[barry.git] / desktop / src / null-os22.cc
blobc08fadf24a13e259972202f9d1fafca92126ed38
1 ///
2 /// \file null-os22.cc
3 /// Null wrapper class for when opensync 0.22 is not available
4 ///
6 /*
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.
22 #include "os22.h"
23 #include "osconv22.h"
24 #include "i18n.h"
26 namespace OpenSync {
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
52 return 0;
55 const char* OpenSync22::GetEngineName() const
57 return "0.22";
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)
94 return 0;
97 bool OpenSync22::IsConfigurable(const std::string &group_name,
98 long member_id)
100 return false;
103 std::string OpenSync22::GetConfiguration(const std::string &group_name,
104 long member_id)
106 return "";
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)
128 : m_api(api)
132 bool Converter22::IsPluginSupported(const std::string &plugin_name,
133 std::string *appname) const
135 return false;
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
175 return false;
178 bool Converter22::IsConfigured(const Config::Evolution &) const
180 return false;
183 bool Converter22::IsConfigured(const Config::Evolution3 &) const
185 return false;
188 bool Converter22::IsConfigured(const Config::Google &) const
190 return false;
193 bool Converter22::IsConfigured(const Config::KDEPim &) const
195 return false;
198 bool Converter22::IsConfigured(const Config::Unsupported &) const
200 return false;
203 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::Barry &) const
205 return PST_NONE;
208 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::Evolution &) const
210 return PST_NONE;
213 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::Evolution3 &) const
215 return PST_NONE;
218 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::Google &) const
220 return PST_NONE;
223 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::KDEPim &) const
225 return PST_NONE;
228 Config::pst_type Converter22::GetSupportedSyncTypes(const Config::Unsupported &) const
230 return PST_NONE;
233 void Converter22::Load(Config::Barry &config, const Member &member)
235 ThrowNotSupported();
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)
246 ThrowNotSupported();
249 void Converter22::Load(Config::Evolution3 &config, const Member &member)
251 ThrowNotSupported();
254 void Converter22::Load(Config::Google &config, const Member &member)
256 ThrowNotSupported();
259 void Converter22::Load(Config::KDEPim &config, const Member &member)
261 ThrowNotSupported();
264 void Converter22::Load(Config::Unsupported &config, const Member &member)
266 ThrowNotSupported();
269 void Converter22::Save(const Config::Barry &config, const std::string &group_name)
271 ThrowNotSupported();
274 void Converter22::Save(const Config::Evolution &config, const std::string &group_name)
276 ThrowNotSupported();
279 void Converter22::Save(const Config::Evolution3 &config, const std::string &group_name)
281 ThrowNotSupported();
284 void Converter22::Save(const Config::Google &config, const std::string &group_name)
286 ThrowNotSupported();
289 void Converter22::Save(const Config::KDEPim &config, const std::string &group_name)
291 ThrowNotSupported();
294 void Converter22::Save(const Config::Unsupported &config, const std::string &group_name)
296 ThrowNotSupported();