summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.h
Unidiff
Diffstat (limited to 'libkdepim/ksyncmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 389a005..9761107 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -10,110 +10,120 @@
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;
34 35
35class KSyncManager : public QObject 36class KSyncManager : public QObject
36{ 37{
37 Q_OBJECT 38 Q_OBJECT
38 39
39 public: 40 public:
40 enum TargetApp { 41 enum TargetApp {
41 KOPI = 0, 42 KOPI = 0,
42 KAPI = 1, 43 KAPI = 1,
43 PWMPI = 2 }; 44 PWMPI = 2 };
44 45
45 46
46 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); 47 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
47 ~KSyncManager() ; 48 ~KSyncManager() ;
48 49
49 bool blockSave() { return mBlockSaveFlag; } 50 bool blockSave() { return mBlockSaveFlag; }
50 void setBlockSave(bool sa) { mBlockSaveFlag = sa; } 51 void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
51 52
52 void fillSyncMenu(); 53 void fillSyncMenu();
53 54
54 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 55 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
55 QString getCurrentSyncName() { return mCurrentSyncName; } 56 QString getCurrentSyncName() { return mCurrentSyncName; }
56 57
58 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
59 void hideProgressBar();
60 bool isProgressBarCanceled();
61
62
57 public slots: 63 public slots:
58 void slotSyncMenu( int ); 64 void slotSyncMenu( int );
59 65
60 private: 66 private:
61 // LR ******************************* 67 // LR *******************************
62 // sync stuff! 68 // sync stuff!
63 QString mCurrentSyncDevice; 69 QString mCurrentSyncDevice;
64 QString mCurrentSyncName; 70 QString mCurrentSyncName;
65 void quickSyncLocalFile(); 71 void quickSyncLocalFile();
66 bool syncWithFile( QString fn , bool quick ); 72 bool syncWithFile( QString fn , bool quick );
67 void syncLocalFile(); 73 void syncLocalFile();
68 void syncPhone(); 74 void syncPhone();
69 void syncSharp(); 75 void syncSharp();
70 bool syncExternalApplication(QString); 76 bool syncExternalApplication(QString);
71 void multiSync( bool askforPrefs ); 77 void multiSync( bool askforPrefs );
72 int mCurrentSyncProfile ; 78 int mCurrentSyncProfile ;
73 void syncRemote( KSyncProfile* prof, bool ask = true); 79 void syncRemote( KSyncProfile* prof, bool ask = true);
74 void edit_sync_options(); 80 void edit_sync_options();
75 int ringSync(); 81 int ringSync();
76 QString getPassword( ); 82 QString getPassword( );
77 83
78 private slots: 84 private slots:
79 void confSync(); 85 void confSync();
80 // ********************* 86 // *********************
81 87
82 private: 88 private:
83 bool mBlockSaveFlag; 89 bool mBlockSaveFlag;
84 90
85 91
86 QWidget* mParent; 92 QWidget* mParent;
87 KSyncInterface* mImplementation; 93 KSyncInterface* mImplementation;
88 TargetApp mTargetApp; 94 TargetApp mTargetApp;
89 KPimPrefs* mPrefs; 95 KPimPrefs* mPrefs;
90 QPopupMenu* mSyncMenu; 96 QPopupMenu* mSyncMenu;
91 97
92 98 QProgressBar* bar;
93 99
94 100
95 101
96 102
97 103
98}; 104};
99 105
100 106
101class KSyncInterface 107class KSyncInterface
102{ 108{
103 public: 109 public:
104 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; 110 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
105 virtual bool syncExternal(KSyncManager* manager, QString resource) = 0;
106 111
112 virtual bool syncExternal(KSyncManager* manager, QString resource)
113 {
114 // empty implementation, because some syncable applications do not have an external(sharpdtm) syncmode, like pwmanager.
115 return false;
116 }
107 117
108 //called by the syncmanager to indicate that the work has to be marked as dirty. 118 //called by the syncmanager to indicate that the work has to be marked as dirty.
109 virtual void sync_setModified() = 0; 119 virtual void sync_setModified() = 0;
110 120
111 //called by the syncmanager to ask if the dirty flag is set. 121 //called by the syncmanager to ask if the dirty flag is set.
112 virtual bool sync_isModified() = 0; 122 virtual bool sync_isModified() = 0;
113 123
114 //called by the syncmanager to indicate that the work has to be saved. 124 //called by the syncmanager to indicate that the work has to be saved.
115 virtual void sync_save() = 0; 125 virtual void sync_save() = 0;
116}; 126};
117 127
118 128
119#endif 129#endif