00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCOMMUNICATIONWIDGET_H
00026 #define GCOMMUNICATIONWIDGET_H
00027
00028 #include <qwidget.h>
00029
00030 class QTextEdit;
00031 class QLineEdit;
00032 class QListWidget;
00033
00034 namespace GCE
00035 {
00036
00043 class GCommunicationWidget : public QWidget
00044 {
00045 Q_OBJECT
00046
00047 protected:
00048
00052 QListWidget* InternalServerList;
00053
00057 QListWidget* ExternalServerList;
00058
00062 QTextEdit* MessageHistory;
00063
00067 QLineEdit* MessageDestination;
00068
00072 QLineEdit* MessageText;
00073
00074 public:
00075
00079 GCommunicationWidget(QWidget* parent = 0, Qt::WFlags f = 0);
00080
00084 virtual ~GCommunicationWidget();
00085
00086 protected:
00087
00092 void removeContactFromList(QString contact, QListWidget* list);
00093
00094 public slots:
00095
00096
00097
00102 void replaceInternalContactList(QStringList contacts);
00103
00104 void replaceExternalContactList(QStringList contacts);
00105
00106 void clearInternalContacts();
00107
00108 void clearExternalContacts();
00109
00110 void addInternalContact(QString contact);
00111
00112 void addExternalContact(QString contact);
00113
00114 void removeInternalContact(QString contact);
00115
00116 void removeExternalContact(QString contact);
00117
00124 void updateContactState(QString contact, bool available, bool internal);
00125
00126
00127
00128
00129
00130 protected slots:
00131
00138 void prepareMessageForSending();
00139
00140 public slots:
00141
00142 void receiveMessage(QString message, QString from, bool internal);
00143
00144 void setDestination(const QString& destination);
00145
00146
00147
00148 signals:
00149
00150 void contactSelected(QString contact);
00151
00152 void sendMessage(QString message, QString destination);
00153 };
00154
00155 }
00156
00157 #endif