From ae6aaaf2ec81317d275ebaabba2de188279b58cd Mon Sep 17 00:00:00 2001 From: ulf69 Date: Fri, 01 Oct 2004 05:22:45 +0000 Subject: 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 --- (limited to 'kaddressbook/kabcore.h') diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index e89bf41..ef61d6d 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -32,6 +32,7 @@ #include #include +#include namespace KABC { class AddressBook; @@ -67,7 +68,7 @@ class ViewManager; class AddresseeEditorDialog; class Ir; -class KABCore : public QWidget +class KABCore : public QWidget, public KSyncInterface { Q_OBJECT @@ -341,7 +342,7 @@ class KABCore : public QWidget public slots: void setDetailsVisible( bool visible ); void setDetailsToState(); - void slotSyncMenu( int ); + // void slotSyncMenu( int ); private slots: void setJumpButtonBarVisible( bool visible ); void importFromOL(); @@ -447,37 +448,32 @@ class KABCore : public QWidget class KABCorePrivate; KABCorePrivate *d; - bool mBlockSaveFlag; + //US bool mBlockSaveFlag; #ifdef KAB_EMBEDDED KAddressBookMain *mMainWindow; // should be the same like mGUIClient #endif //KAB_EMBEDDED + + //this are the overwritten callbackmethods from the syncinterface + virtual bool sync(KSyncManager* manager, QString filename, int mode); + virtual bool syncExternal(KSyncManager* manager, QString resource); + + //called by the syncmanager to indicate that the work has to marked as dirty. + virtual void sync_setModified(); + //called by the syncmanager to ask if the dirty flag is set. + virtual bool KABCore::sync_isModified(); + //called by the syncmanager to indicate that the work has to be saved. + virtual void sync_save(); + // LR ******************************* // sync stuff! QPopupMenu *syncMenu; - void fillSyncMenu(); - QString mCurrentSyncDevice; - QString mCurrentSyncName; - void quickSyncLocalFile(); - bool syncWithFile( QString fn , bool quick ); - void syncLocalFile(); - void syncPhone(); - void syncSharp(); - bool syncExternal(QString); - void multiSync( bool askforPrefs ); - int mCurrentSyncProfile ; - void syncRemote( KSyncProfile* prof, bool ask = true); - void edit_sync_options(); - bool syncAB(QString filename, int mode); - int ringSync(); - QString getPassword( ); + KSyncManager* syncManager; int mGlobalSyncMode; bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); KABC::Addressee getLastSyncAddressee(); QDateTime mLastAddressbookSync; int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); - public slots: - void confSync(); // ********************* }; -- cgit v0.9.0.2