-rw-r--r-- | kaddressbook/kabcore.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index e89bf41..ef61d6d 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -19,32 +19,33 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KABCORE_H | 24 | #ifndef KABCORE_H |
25 | #define KABCORE_H | 25 | #define KABCORE_H |
26 | 26 | ||
27 | #include <kabc/field.h> | 27 | #include <kabc/field.h> |
28 | 28 | ||
29 | #ifndef KAB_EMBEDDED | 29 | #ifndef KAB_EMBEDDED |
30 | #endif //KAB_EMBEDDED | 30 | #endif //KAB_EMBEDDED |
31 | #include <qdict.h> | 31 | #include <qdict.h> |
32 | 32 | ||
33 | #include <qwidget.h> | 33 | #include <qwidget.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <ksyncmanager.h> | ||
35 | 36 | ||
36 | namespace KABC { | 37 | namespace KABC { |
37 | class AddressBook; | 38 | class AddressBook; |
38 | } | 39 | } |
39 | 40 | ||
40 | #ifndef KAB_EMBEDDED | 41 | #ifndef KAB_EMBEDDED |
41 | class KAboutData; | 42 | class KAboutData; |
42 | class KConfig; | 43 | class KConfig; |
43 | 44 | ||
44 | class KAddressBookService; | 45 | class KAddressBookService; |
45 | class LDAPSearchDialog; | 46 | class LDAPSearchDialog; |
46 | #else //KAB_EMBEDDED | 47 | #else //KAB_EMBEDDED |
47 | class KAddressBookMain; | 48 | class KAddressBookMain; |
48 | //US class QAction; | 49 | //US class QAction; |
49 | #endif //KAB_EMBEDDED | 50 | #endif //KAB_EMBEDDED |
50 | class KCMultiDialog; | 51 | class KCMultiDialog; |
@@ -54,33 +55,33 @@ class XXPortManager; | |||
54 | class JumpButtonBar; | 55 | class JumpButtonBar; |
55 | class IncSearchWidget; | 56 | class IncSearchWidget; |
56 | class KDGanttMinimizeSplitter; | 57 | class KDGanttMinimizeSplitter; |
57 | class KAction; | 58 | class KAction; |
58 | class KActionCollection; | 59 | class KActionCollection; |
59 | class KToggleAction; | 60 | class KToggleAction; |
60 | class KSyncProfile; | 61 | class KSyncProfile; |
61 | 62 | ||
62 | class QAction; | 63 | class QAction; |
63 | class QMenuBar; | 64 | class QMenuBar; |
64 | class QSplitter; | 65 | class QSplitter; |
65 | class ViewContainer; | 66 | class ViewContainer; |
66 | class ViewManager; | 67 | class ViewManager; |
67 | class AddresseeEditorDialog; | 68 | class AddresseeEditorDialog; |
68 | class Ir; | 69 | class Ir; |
69 | 70 | ||
70 | class KABCore : public QWidget | 71 | class KABCore : public QWidget, public KSyncInterface |
71 | { | 72 | { |
72 | Q_OBJECT | 73 | Q_OBJECT |
73 | 74 | ||
74 | public: | 75 | public: |
75 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); | 76 | KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name = 0 ); |
76 | 77 | ||
77 | 78 | ||
78 | ~KABCore(); | 79 | ~KABCore(); |
79 | 80 | ||
80 | 81 | ||
81 | #ifdef KAB_EMBEDDED | 82 | #ifdef KAB_EMBEDDED |
82 | //US added functionality | 83 | //US added functionality |
83 | QPopupMenu* getViewMenu() {return viewMenu;} | 84 | QPopupMenu* getViewMenu() {return viewMenu;} |
84 | QPopupMenu* getFilterMenu() {return filterMenu;} | 85 | QPopupMenu* getFilterMenu() {return filterMenu;} |
85 | QPopupMenu* getSettingsMenu() {return settingsMenu;} | 86 | QPopupMenu* getSettingsMenu() {return settingsMenu;} |
86 | void addActionsManually(); | 87 | void addActionsManually(); |
@@ -328,33 +329,33 @@ class KABCore : public QWidget | |||
328 | 329 | ||
329 | /** | 330 | /** |
330 | Registers a new GUI client, so plugins can register its actions. | 331 | Registers a new GUI client, so plugins can register its actions. |
331 | */ | 332 | */ |
332 | void addGUIClient( KXMLGUIClient *client ); | 333 | void addGUIClient( KXMLGUIClient *client ); |
333 | 334 | ||
334 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); | 335 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
335 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 336 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
336 | 337 | ||
337 | 338 | ||
338 | signals: | 339 | signals: |
339 | void contactSelected( const QString &name ); | 340 | void contactSelected( const QString &name ); |
340 | void contactSelected( const QPixmap &pixmap ); | 341 | void contactSelected( const QPixmap &pixmap ); |
341 | public slots: | 342 | public slots: |
342 | void setDetailsVisible( bool visible ); | 343 | void setDetailsVisible( bool visible ); |
343 | void setDetailsToState(); | 344 | void setDetailsToState(); |
344 | void slotSyncMenu( int ); | 345 | // void slotSyncMenu( int ); |
345 | private slots: | 346 | private slots: |
346 | void setJumpButtonBarVisible( bool visible ); | 347 | void setJumpButtonBarVisible( bool visible ); |
347 | void importFromOL(); | 348 | void importFromOL(); |
348 | void extensionModified( const KABC::Addressee::List &list ); | 349 | void extensionModified( const KABC::Addressee::List &list ); |
349 | void extensionChanged( int id ); | 350 | void extensionChanged( int id ); |
350 | void clipboardDataChanged(); | 351 | void clipboardDataChanged(); |
351 | void updateActionMenu(); | 352 | void updateActionMenu(); |
352 | void configureKeyBindings(); | 353 | void configureKeyBindings(); |
353 | void removeVoice(); | 354 | void removeVoice(); |
354 | #ifdef KAB_EMBEDDED | 355 | #ifdef KAB_EMBEDDED |
355 | void configureResources(); | 356 | void configureResources(); |
356 | #endif //KAB_EMBEDDED | 357 | #endif //KAB_EMBEDDED |
357 | 358 | ||
358 | void slotEditorDestroyed( const QString &uid ); | 359 | void slotEditorDestroyed( const QString &uid ); |
359 | void configurationChanged(); | 360 | void configurationChanged(); |
360 | void addressBookChanged(); | 361 | void addressBookChanged(); |
@@ -434,52 +435,47 @@ class KABCore : public QWidget | |||
434 | QPopupMenu *filterMenu; | 435 | QPopupMenu *filterMenu; |
435 | QPopupMenu *settingsMenu; | 436 | QPopupMenu *settingsMenu; |
436 | QPopupMenu *changeMenu; | 437 | QPopupMenu *changeMenu; |
437 | //US QAction *mActionSave; | 438 | //US QAction *mActionSave; |
438 | QPopupMenu *ImportMenu; | 439 | QPopupMenu *ImportMenu; |
439 | QPopupMenu *ExportMenu; | 440 | QPopupMenu *ExportMenu; |
440 | //LR additional methods | 441 | //LR additional methods |
441 | KAction *mActionRemoveVoice; | 442 | KAction *mActionRemoveVoice; |
442 | KAction * mActionImportOL; | 443 | KAction * mActionImportOL; |
443 | 444 | ||
444 | #ifndef KAB_EMBEDDED | 445 | #ifndef KAB_EMBEDDED |
445 | KAddressBookService *mAddressBookService; | 446 | KAddressBookService *mAddressBookService; |
446 | #endif //KAB_EMBEDDED | 447 | #endif //KAB_EMBEDDED |
447 | 448 | ||
448 | class KABCorePrivate; | 449 | class KABCorePrivate; |
449 | KABCorePrivate *d; | 450 | KABCorePrivate *d; |
450 | bool mBlockSaveFlag; | 451 | //US bool mBlockSaveFlag; |
451 | 452 | ||
452 | #ifdef KAB_EMBEDDED | 453 | #ifdef KAB_EMBEDDED |
453 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 454 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
454 | #endif //KAB_EMBEDDED | 455 | #endif //KAB_EMBEDDED |
456 | |||
457 | //this are the overwritten callbackmethods from the syncinterface | ||
458 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | ||
459 | virtual bool syncExternal(KSyncManager* manager, QString resource); | ||
460 | |||
461 | //called by the syncmanager to indicate that the work has to marked as dirty. | ||
462 | virtual void sync_setModified(); | ||
463 | //called by the syncmanager to ask if the dirty flag is set. | ||
464 | virtual bool KABCore::sync_isModified(); | ||
465 | //called by the syncmanager to indicate that the work has to be saved. | ||
466 | virtual void sync_save(); | ||
467 | |||
455 | // LR ******************************* | 468 | // LR ******************************* |
456 | // sync stuff! | 469 | // sync stuff! |
457 | QPopupMenu *syncMenu; | 470 | QPopupMenu *syncMenu; |
458 | void fillSyncMenu(); | 471 | KSyncManager* syncManager; |
459 | QString mCurrentSyncDevice; | ||
460 | QString mCurrentSyncName; | ||
461 | void quickSyncLocalFile(); | ||
462 | bool syncWithFile( QString fn , bool quick ); | ||
463 | void syncLocalFile(); | ||
464 | void syncPhone(); | ||
465 | void syncSharp(); | ||
466 | bool syncExternal(QString); | ||
467 | void multiSync( bool askforPrefs ); | ||
468 | int mCurrentSyncProfile ; | ||
469 | void syncRemote( KSyncProfile* prof, bool ask = true); | ||
470 | void edit_sync_options(); | ||
471 | bool syncAB(QString filename, int mode); | ||
472 | int ringSync(); | ||
473 | QString getPassword( ); | ||
474 | int mGlobalSyncMode; | 472 | int mGlobalSyncMode; |
475 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); | 473 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); |
476 | KABC::Addressee getLastSyncAddressee(); | 474 | KABC::Addressee getLastSyncAddressee(); |
477 | QDateTime mLastAddressbookSync; | 475 | QDateTime mLastAddressbookSync; |
478 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); | 476 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); |
479 | public slots: | ||
480 | void confSync(); | ||
481 | // ********************* | 477 | // ********************* |
482 | 478 | ||
483 | }; | 479 | }; |
484 | 480 | ||
485 | #endif | 481 | #endif |