kitchensync Library API Documentation

remotekonnector.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 #ifndef KSYNC_REMOTEKONNECTOR_H
00022 #define KSYNC_REMOTEKONNECTOR_H
00023 
00024 #include <libkcal/calendarlocal.h>
00025 #include <kabc/addressbook.h>
00026 #include <kbookmarkmanager.h>
00027 #include <kio/job.h>
00028 
00029 #include <konnector.h>
00030 
00031 #include <qiconset.h>
00032 #include <qptrlist.h>
00033 
00034 namespace KABC {
00035 class ResourceFile;
00036 }
00037 
00038 namespace KSync {
00039 
00040 class RemoteKonnectorConfig;
00041 
00042 class RemoteKonnector : public KSync::Konnector
00043 { 
00044     Q_OBJECT
00045   public:
00046     RemoteKonnector( const KConfig *config );
00047     ~RemoteKonnector();
00048 
00049     void writeConfig( KConfig * );
00050 
00052     KSync::Kapabilities capabilities();
00053 
00058     void setCapabilities( const KSync::Kapabilities & );
00059 
00060     SynceeList syncees() { return mSyncees; }
00061 
00062     bool readSyncees();
00063     bool writeSyncees();
00064 
00065     bool connectDevice();
00066     bool disconnectDevice();
00067 
00069     KSync::KonnectorInfo info() const;
00070 
00071     void setCalendarUrl( const QString &f ) { mCalendarUrl = f; }
00072     QString calendarUrl() const { return mCalendarUrl; }
00073     
00074     void setAddressBookUrl( const QString &f ) { mAddressBookUrl = f; }
00075     QString addressBookUrl() const { return mAddressBookUrl; }
00076 
00077     void setBookmarkUrl( const QString &f ) { mBookmarkUrl = f; }
00078     QString bookmarkUrl() const { return mBookmarkUrl; }
00079 
00080   protected:
00081     void finishRead();
00082     void finishWrite();
00083 
00084   protected slots:
00085     void slotCalendarData( KIO::Job *, const QByteArray &d );
00086     void slotCalendarReadResult( KIO::Job *job );
00087     void slotAddressBookData( KIO::Job *, const QByteArray &d );
00088     void slotAddressBookReadResult( KIO::Job *job );
00089     void slotCalendarDataReq( KIO::Job *, QByteArray &d );
00090     void slotCalendarWriteResult( KIO::Job *job );
00091     void slotAddressBookDataReq( KIO::Job *, QByteArray &d );
00092     void slotAddressBookWriteResult( KIO::Job *job );
00093 
00094   private:
00095     RemoteKonnectorConfig *mConfigWidget;
00096     QString mCalendarUrl;
00097     QString mAddressBookUrl;
00098     QString mBookmarkUrl;
00099 
00100     KCal::CalendarLocal mCalendar;
00101     KABC::AddressBook mAddressBook;
00102     
00103     KSync::AddressBookSyncee *mAddressBookSyncee;
00104     KSync::CalendarSyncee *mCalendarSyncee;
00105     
00106     class LocalBookmarkManager : public KBookmarkManager
00107     {
00108       public:
00109         LocalBookmarkManager() : KBookmarkManager() {}
00110     };
00111     LocalBookmarkManager mBookmarkManager;
00112     
00113     SynceeList mSyncees;
00114 
00115     int mSynceeReadCount;
00116     int mSynceeWriteCount;
00117 
00118     QString mCalendarData;
00119     QString mAddressBookData;
00120 };
00121 
00122 }
00123 
00124 #endif
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 04:47:07 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003