00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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
00118
bool downloadFile( const
QString &str,
QString &newDest );
00119
int m_flushedApps;
00120 };
00121
00122 }
00123
00124 #endif