summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.h
authorulf69 <ulf69>2004-10-01 05:22:45 (UTC)
committer ulf69 <ulf69>2004-10-01 05:22:45 (UTC)
commitae6aaaf2ec81317d275ebaabba2de188279b58cd (patch) (side-by-side diff)
treef773df13a4e4f9fa5c6c54d01786e2de561ae661 /libkdepim/ksyncmanager.h
parent11c2acda0533e579512cf416de870328a79e66e8 (diff)
downloadkdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.zip
kdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.tar.gz
kdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.tar.bz2
moved the global sync stuff from kabcore into a new class ksyncmanaager which
can be used from all types of applications, like kapi, kopi and pwmpi
Diffstat (limited to 'libkdepim/ksyncmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h79
1 files changed, 65 insertions, 14 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index d7c2a02..389a005 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -1,68 +1,119 @@
/*
This file is part of KDE-Pim/Pi.
Copyright (c) 2004 Ulf Schenk
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
$Id$
*/
#ifndef _KSYNCMANAGER_H
#define _KSYNCMANAGER_H
+#include <qobject.h>
#include <qstring.h>
class QPopupMenu;
class KSyncProfile;
+class KPimPrefs;
+class QWidget;
+class KSyncManager;
+class KSyncInterface;
-
-
-class KSyncManager
+class KSyncManager : public QObject
{
-
- public:
- KSyncManager(TargetApp ta, QPopupMenu* syncmenu);
- ~KSyncManager() ;
+ Q_OBJECT
+ public:
enum TargetApp {
KOPI = 0,
KAPI = 1,
PWMPI = 2 };
- private:
+
+ KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
+ ~KSyncManager() ;
+
+ bool blockSave() { return mBlockSaveFlag; }
+ void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
+
void fillSyncMenu();
- void syncLocalFile();
- bool syncWithFile( QString fn , bool quick );
+
+ QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
+ QString getCurrentSyncName() { return mCurrentSyncName; }
+
+ public slots:
+ void slotSyncMenu( int );
+
+ private:
+ // LR *******************************
+ // sync stuff!
+ QString mCurrentSyncDevice;
+ QString mCurrentSyncName;
void quickSyncLocalFile();
+ bool syncWithFile( QString fn , bool quick );
+ void syncLocalFile();
+ void syncPhone();
+ void syncSharp();
+ bool syncExternalApplication(QString);
void multiSync( bool askforPrefs );
- int ringSync();
- void syncRemote( KSyncProfile* prof, bool ask);
+ int mCurrentSyncProfile ;
+ void syncRemote( KSyncProfile* prof, bool ask = true);
void edit_sync_options();
- QString getPassword();
+ int ringSync();
+ QString getPassword( );
+
+ private slots:
+ void confSync();
+ // *********************
private:
- QPopupMenu* mSyncMenu;
+ bool mBlockSaveFlag;
+
+
+ QWidget* mParent;
+ KSyncInterface* mImplementation;
TargetApp mTargetApp;
+ KPimPrefs* mPrefs;
+ QPopupMenu* mSyncMenu;
+
+};
+
+
+class KSyncInterface
+{
+ public:
+ virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
+ virtual bool syncExternal(KSyncManager* manager, QString resource) = 0;
+ //called by the syncmanager to indicate that the work has to be marked as dirty.
+ virtual void sync_setModified() = 0;
+
+ //called by the syncmanager to ask if the dirty flag is set.
+ virtual bool sync_isModified() = 0;
+
+ //called by the syncmanager to indicate that the work has to be saved.
+ virtual void sync_save() = 0;
};
+
#endif