kitchensync Library API Documentation

qtopia/socket.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002,2003 Holger Freyther <freyther@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 QTOPIA_OPIE_SOCKET_H
00022 #define QTOPIA_OPIE_SOCKET_H
00023 
00024 #include <qobject.h>
00025 
00026 #include <stderror.h>
00027 #include <stdprogress.h>
00028 
00029 #include "qtopiakonnector.h"
00030 
00031 class KURL;
00032 
00033 namespace KSync {
00034 
00035 class AddressBookSyncee;
00036 class CalendarSyncee;
00037 
00038 class QtopiaSocket : public QObject
00039 {
00040     Q_OBJECT
00041   public:
00042     QtopiaSocket( QObject *obj, const char *name );
00043     ~QtopiaSocket();
00044 
00045     void setUser( const QString &user );
00046     void setPassword( const QString &pass );
00047     void setSrcIP( const QString & );
00048     void setDestIP( const QString & );
00049     void setModel( const QString &model, const QString &name );
00050 
00051     void startUp();
00052     void hangUP();
00053 
00054     bool startSync();
00055     bool isConnected();
00056 
00057     void write( SynceeList );
00058     void download( const QString &res );
00059     void setResources( const QStringList & );
00060     QString metaId() const;
00061 
00062   signals:
00063     void sync( SynceeList );
00064     void error( const Error & );
00065     void prog( const Progress & );
00066 
00067   private slots:
00068     void slotError(int);
00069     void slotConnected();
00070     void slotClosed();
00071     void slotNOOP();
00072     void process();
00073     void slotStartSync();
00074 
00075   private:
00076     class Private;
00077     Private *d;
00078 
00079   private:
00080     enum Type
00081     {
00082         AddressBook,
00083         TodoList,
00084         DateBook
00085     };
00086     
00087     KURL url( Type );
00088     KURL url( const QString &path );
00089     void writeCategory();
00090     void writeAddressbook( AddressBookSyncee * );
00091     void writeDatebook( CalendarSyncee * );
00092     void writeTodoList( CalendarSyncee * );
00093     void readAddressbook();
00094     void readDatebook();
00095     void readTodoList();
00096 
00097     CalendarSyncee* defaultCalendarSyncee();
00098 
00099     /* for processing the connection and authentication */
00100     void start(const QString & );
00101     void user( const QString & );
00102     void pass( const QString & );
00103     void call( const QString & );
00104     void flush( const QString & );
00105     void noop( const QString & );
00106 
00107     void handshake( const QString & );
00108     void download();
00109     void initSync( const QString & );
00110 
00111     void initFiles();
00112     QString partnerIdPath() const;
00113     void readTimeZones();
00114 
00115     void sendCommand( const QString& cmd );
00116 
00117     /* download relative from the home dir */
00118     bool downloadFile( const QString &str, QString &newDest );
00119     int m_flushedApps;
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 Thu May 3 20:20:52 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003