00001 #ifndef GUIACTIVEUSERLIST2_H 00002 #define GUIACTIVEUSERLIST2_H 00003 #include <QMenu> 00004 #include <QString> 00005 #include <QTreeWidget> 00006 #include <QHash> 00007 #include <QHostAddress> 00008 00009 00010 00016 class GuiActiveUserList : public QTreeWidget 00017 { 00018 Q_OBJECT 00019 00020 private: 00021 QMenu *user_menu; 00022 QHash<QString, QHostAddress> all_users; 00023 QString my_nick; 00025 public: 00026 00031 GuiActiveUserList(QWidget *parent=0); 00036 void demo(); 00042 QString returnNameUser(QHostAddress host); 00048 QHostAddress returnIpUser(QString nick); 00053 void clearAllUsers(); 00060 void setMyNick(QString nick); 00066 bool isUserOnList(QString nick); 00067 public slots: 00068 00076 void addUser(QHostAddress host, QString nick); 00082 void delUser(QHostAddress host); 00091 void showUserMenu (const QPoint&); 00096 void sendSignalPrivateChat(); 00101 void sendSignalSendFile(); 00106 void sendSignalCheckIp(); 00111 void sendSignalCheckPing(); 00112 00113 00114 signals: 00119 void signalPrivateChat(QHostAddress &host); 00124 void signalSendFile(QHostAddress &host); 00129 void signalCheckIp(QHostAddress &host); 00134 void signalCheckPing(QHostAddress &host); 00138 void disconectChatUserExists(); 00139 }; 00140 00141 00142 00143 #endif //GUIACTIVEUSERLIST2_H