connectionprocess.h

00001 /***************************************************************************
00002                           connectionprocess.h  -  description
00003                              -------------------
00004     begin                : jeu avr 20 2006
00005     copyright            : (C) 2006 by 
00006                 - Sylvain Archenault <sylvain.archenault@laposte.net> 
00007                 - Yves Houpert <yves.houpert@insa-rouen.fr>
00008  
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   (at your option) any later version.                                   *
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: //public slots
00107   void performConnection();
00108 
00109 private: //private methods
00111   void updateWidget();
00112 
00113 private: //private members
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

Generated on Fri May 19 12:15:54 2006 for Bamboo Ch@t by  doxygen 1.4.6