00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONNECTIONPROCESS_H
00020 #define CONNECTIONPROCESS_H
00021
00022 #include <string>
00023 #include <contact.h>
00024 #include <contactlist.h>
00025 #include <qstring.h>
00026 #include <qobject.h>
00027
00028 class ConnectionManager;
00029 class ConnectionWidget;
00030
00037 class ConnectionProcess : public QObject
00038 {
00039
00040 Q_OBJECT
00041
00042 public:
00044 enum State {
00045 Idle,
00046 WaitForConnection,
00047 SocketConnected,
00048 WaitForAuthentification,
00049 Authentified,
00050 WaitForList,
00051 Connected,
00052 ConnectionFailed
00053 };
00054
00061 ConnectionProcess(ConnectionManager& rConnection, const std::string& hostname,
00062 const int port,const std::string& username, const std::string& password);
00063
00065 ~ConnectionProcess();
00066
00071 void setConnectStatus(const bool bStatus);
00072
00075 State getConnectionStatus() const { return m_State ;}
00076
00083 void setAuthentificationStatus(const bool bStatus, const Contact& contact);
00084
00090 void setContactListStatus(const bool bStatus, const ContactList& list);
00091
00097 void abortConnection();
00098
00100 void close();
00101
00102 public slots:
00107 void performConnection();
00108
00109 private:
00111 void updateWidget();
00112
00113 private:
00115 ConnectionManager& m_rConnection;
00116
00118 std::string m_sHostname;
00119
00121 int m_iPort;
00122
00124 std::string m_sUsername;
00125
00127 std::string m_sPassword;
00128
00130 Contact m_Contact;
00131
00133 ContactList m_ContactList;
00134
00136 ConnectionWidget* m_pConnectionWidget;
00137
00139 State m_State;
00140
00142 int m_iProgress;
00143
00148 QString m_sStatus;
00149 };
00150
00151 #endif