author | ulf69 <ulf69> | 2004-10-01 05:22:45 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-01 05:22:45 (UTC) |
commit | ae6aaaf2ec81317d275ebaabba2de188279b58cd (patch) (side-by-side diff) | |
tree | f773df13a4e4f9fa5c6c54d01786e2de561ae661 /libkdepim/ksyncmanager.h | |
parent | 11c2acda0533e579512cf416de870328a79e66e8 (diff) | |
download | kdepimpi-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
-rw-r--r-- | libkdepim/ksyncmanager.h | 79 |
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 @@ -9,60 +9,111 @@ 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 |