GCommunicationWidget.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005-2006 by the G System Team                          *
00003  *   http://www.g-system.at                                                *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
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     //BEGIN CONTACT MANAGEMENT
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     //END CONTACT MANAGEMENT
00127     
00128     //BEGIN MESSAGE MANAGEMENT
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     //END MESSAGE MANAGEMENT
00147     
00148   signals:
00149     
00150     void contactSelected(QString contact);
00151     
00152     void sendMessage(QString message, QString destination);
00153 };
00154 
00155 }
00156 
00157 #endif

Generated on Thu Nov 16 07:49:12 2006 for G System by  doxygen 1.4.7