summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.h
authorzautrix <zautrix>2004-10-06 20:51:01 (UTC)
committer zautrix <zautrix>2004-10-06 20:51:01 (UTC)
commit0afcfa29ace7bc5e42a11fae44301e1e8230a376 (patch) (unidiff)
treeb54f85b19ace24219be1b845469444089cacc94f /libkdepim/ksyncmanager.h
parented4675de07d947f55d2672c721599e3a0af1e24b (diff)
downloadkdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.zip
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.gz
kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.bz2
some prefs cleanups
Diffstat (limited to 'libkdepim/ksyncmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 9761107..6b10016 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -1,129 +1,147 @@
1/* 1/*
2 This file is part of KDE-Pim/Pi. 2 This file is part of KDE-Pim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 19
20$Id$ 20$Id$
21*/ 21*/
22#ifndef _KSYNCMANAGER_H 22#ifndef _KSYNCMANAGER_H
23#define _KSYNCMANAGER_H 23#define _KSYNCMANAGER_H
24 24
25#include <qobject.h> 25#include <qobject.h>
26#include <qstring.h> 26#include <qstring.h>
27 27
28class QPopupMenu; 28class QPopupMenu;
29class KSyncProfile; 29class KSyncProfile;
30class KPimPrefs; 30class KPimPrefs;
31class QWidget; 31class QWidget;
32class KSyncManager; 32class KSyncManager;
33class KSyncInterface; 33class KSyncInterface;
34class QProgressBar; 34class QProgressBar;
35 35
36class KSyncManager : public QObject 36class KSyncManager : public QObject
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
39 39
40 public: 40 public:
41 enum TargetApp { 41 enum TargetApp {
42 KOPI = 0, 42 KOPI = 0,
43 KAPI = 1, 43 KAPI = 1,
44 PWMPI = 2 }; 44 PWMPI = 2 };
45 45
46 46
47 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); 47 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
48 ~KSyncManager() ; 48 ~KSyncManager() ;
49 49
50 bool blockSave() { return mBlockSaveFlag; } 50 bool blockSave() { return mBlockSaveFlag; }
51 void setBlockSave(bool sa) { mBlockSaveFlag = sa; } 51 void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
52 52
53 void fillSyncMenu(); 53 void fillSyncMenu();
54 54
55 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 55 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
56 QString getCurrentSyncName() { return mCurrentSyncName; } 56 QString getCurrentSyncName() { return mCurrentSyncName; }
57 57
58 void showProgressBar(int percentage, QString caption = QString::null, int total=100); 58 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
59 void hideProgressBar(); 59 void hideProgressBar();
60 bool isProgressBarCanceled(); 60 bool isProgressBarCanceled();
61 61
62 // sync stuff
63 QString mLocalMachineName;
64 QStringList mExternSyncProfiles;
65 QStringList mSyncProfileNames;
66 bool mAskForPreferences;
67 bool mShowSyncSummary;
68 bool mShowSyncEvents;
69 bool mShowTodoInAgenda;
70 bool mWriteBackExistingOnly;
71 int mSyncAlgoPrefs;
72 int mRingSyncAlgoPrefs;
73 bool mWriteBackFile;
74 int mWriteBackInFuture;
75 QString mPhoneDevice;
76 QString mPhoneConnection;
77 QString mPhoneModel;
78 QString mLastSyncedLocalFile; // save!
79
80
62 81
63 public slots: 82 public slots:
64 void slotSyncMenu( int ); 83 void slotSyncMenu( int );
65 84
66 private: 85 private:
67 // LR ******************************* 86 // LR *******************************
68 // sync stuff! 87 // sync stuff!
69 QString mCurrentSyncDevice; 88 QString mCurrentSyncDevice;
70 QString mCurrentSyncName; 89 QString mCurrentSyncName;
71 void quickSyncLocalFile(); 90 void quickSyncLocalFile();
72 bool syncWithFile( QString fn , bool quick ); 91 bool syncWithFile( QString fn , bool quick );
73 void syncLocalFile(); 92 void syncLocalFile();
74 void syncPhone(); 93 void syncPhone();
75 void syncSharp(); 94 void syncSharp();
76 bool syncExternalApplication(QString); 95 bool syncExternalApplication(QString);
77 void multiSync( bool askforPrefs ); 96 void multiSync( bool askforPrefs );
78 int mCurrentSyncProfile ; 97 int mCurrentSyncProfile ;
79 void syncRemote( KSyncProfile* prof, bool ask = true); 98 void syncRemote( KSyncProfile* prof, bool ask = true);
80 void edit_sync_options(); 99 void edit_sync_options();
81 int ringSync(); 100 int ringSync();
82 QString getPassword( ); 101 QString getPassword( );
83 102
84 private slots: 103 private slots:
85 void confSync(); 104 void confSync();
86 // ********************* 105 // *********************
87 106
88 private: 107 private:
89 bool mBlockSaveFlag; 108 bool mBlockSaveFlag;
90 109
91 110
92 QWidget* mParent; 111 QWidget* mParent;
93 KSyncInterface* mImplementation; 112 KSyncInterface* mImplementation;
94 TargetApp mTargetApp; 113 TargetApp mTargetApp;
95 KPimPrefs* mPrefs;
96 QPopupMenu* mSyncMenu; 114 QPopupMenu* mSyncMenu;
97 115
98 QProgressBar* bar; 116 QProgressBar* bar;
99 117
100 118
101 119
102 120
103 121
104}; 122};
105 123
106 124
107class KSyncInterface 125class KSyncInterface
108{ 126{
109 public: 127 public:
110 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; 128 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
111 129
112 virtual bool syncExternal(KSyncManager* manager, QString resource) 130 virtual bool syncExternal(KSyncManager* manager, QString resource)
113 { 131 {
114 // empty implementation, because some syncable applications do not have an external(sharpdtm) syncmode, like pwmanager. 132 // empty implementation, because some syncable applications do not have an external(sharpdtm) syncmode, like pwmanager.
115 return false; 133 return false;
116 } 134 }
117 135
118 //called by the syncmanager to indicate that the work has to be marked as dirty. 136 //called by the syncmanager to indicate that the work has to be marked as dirty.
119 virtual void sync_setModified() = 0; 137 virtual void sync_setModified() = 0;
120 138
121 //called by the syncmanager to ask if the dirty flag is set. 139 //called by the syncmanager to ask if the dirty flag is set.
122 virtual bool sync_isModified() = 0; 140 virtual bool sync_isModified() = 0;
123 141
124 //called by the syncmanager to indicate that the work has to be saved. 142 //called by the syncmanager to indicate that the work has to be saved.
125 virtual void sync_save() = 0; 143 virtual void sync_save() = 0;
126}; 144};
127 145
128 146
129#endif 147#endif