2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3 Copyright (c) 2010 Emanoil Kotsev <deloptes@yahoo.com>
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Library General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 This library is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 License for more details.
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to the
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 #include <opensync/opensync.h>
29 #include <opensync/opensync-plugin.h>
30 #include <opensync/opensync-helper.h>
33 * Base class providing wraping of OSyncObjTypeSink.
35 class SinkBase
: public QObject
52 SinkBase( int features
);
55 virtual void connect();
56 virtual void disconnect();
57 virtual void getChanges();
58 virtual void commit( OSyncChange
*chg
);
59 // virtual void write();
60 // virtual void read();
61 // virtual void commitAll();
62 virtual void syncDone();
64 OSyncContext
* context() const {
68 OSyncPluginInfo
*pluginInfo() const {
71 osync_bool
getSlowSink ();
73 void setPluginInfo( OSyncPluginInfo
*info
);
74 void setContext( OSyncContext
*context
);
75 void setSink( OSyncObjTypeSink
*sink
);
76 void setSlowSink (osync_bool
);
80 void error(OSyncErrorType type
, QString msg
) const;
81 void warning( OSyncError
*error
) const;
82 void wrapSink(OSyncObjTypeSink
* sink
);
83 OSyncObjTypeSink
* sink() const {
89 OSyncObjTypeSink
*mSink
;
90 OSyncPluginInfo
*mPluginInfo
;
91 mutable OSyncContext
*mContext
;
92 // what do we have and what can we do
93 bool m_canConnect
, m_canDisconnect
, m_canCommit
, m_canCommitAll
,
94 m_canGetChanges
, m_canWrite
, m_canRead
, m_canSyncDone
;
95 // unused bool m_canCommitRead, m_canBatchCommit;
96 osync_bool m_SlowSync
;
99 #endif //End of SINKBASE_H