#ifndef _HUBWDGT_H_ #define _HUBWDGT_H_ #include #include #include #include "userlist.h" #include "userfiledlg.h" #include class dctc_hub; class dc_hub; class transfer_widget; class QPushButton; class QTabWidget; class ChatWdgt; class SearchDlg; using namespace std; /*! \class HubWdgt \breif Provides functions for a hub connection and displays information about it This class is used for every hub we are connected to. It has a line edit and search button for performing searches, a button for disconnecting from the hub. It also has two tabs, one in which the chat messages are displayed and one in which all users are displayed along with that users information. */ class HubWdgt : public QWidget { Q_OBJECT public: /*! Constructor that creates all the widgets needed and connects to the hub adress we get \param transferWin The transfer lists \param parent The parent widget. \param name The name of this widget. */ HubWdgt( transfer_widget* transferWin, QWidget* parent = 0, const char* name = 0 ); /*! Sets the id of this hub tab. Has ro be done after the hub is created and added to the tabs in our main widget otherwise this willl get fucked when this tab is closed. \param hubId The id to be set */ void setId( int hubId ) { id = hubId; } /*! Returns true if the the hubwidget is connected. */ bool isConnected() const { return hubInterface!=NULL; } bool connect(); bool connect(const QString& ip, const QString &pwd,const QString& profile); public slots: void save_layout(); void handleSearchResult(const QString &user, const QString &file, const QString &size, const QString &slot, const QString &hubname); /*! Slot for disconnecting from this hub */ void disconnect(); void disconnect(int); void closeChatTab(); void activateChat(const QString& user); void privChatMsg(const QString& user, const QString& msg); void sendChatMes(const QString& msg,QWidget* originator); void setHubName(const QString& name); void removeFileDlg( const QString& user ); void loadUserList( const QString& user ); void openSearchDlg(); void queryUnattached(const QString& name); void requestPassword(); void progressBar(const QString& name,const QString& progress,const QStringList& msglst); void hubReached(); void reshare(); void userListArrived(const QStringList& l); void chatTabChanged( QWidget *); void sendDCTCCommand( QString &cmd ); signals: void gotName(const QString&,QWidget*); void multiSearchResult(const QString&,const QString&,const QString&,const QString&,const QString&); void disconnected(int); void showStatus(const QString& str); void showProgress(const QString &msg, const QString &progress); void connected(int); private: /*! Displys the users connected to this hub */ UserList* users; // Should be a listview /*! The id of this hub. We get this from the widget that created us. */ int id; /*! The dctc_hub object that is the interface for communicating with dctc. */ dctc_hub *hubInterface; dc_hub *hubs; /*! The transfer lists */ transfer_widget *transferWin; /*! The public chat */ ChatWdgt *publicChat; QTabWidget* tabs; QSplitter *chatusersplit; bool use_split_view; /// The hub name QString name; SearchDlg* searchDlg; list dialogs; void connectSignals(); }; #endif /* * * $Log: * */