From da88f5f0bb5e73bc69bf7ed3962691622b1ae4f9 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Wed, 8 Sep 2010 09:23:18 +0000 Subject: add Gui Client example --- examples/GuiClient/chatDialog.h | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 examples/GuiClient/chatDialog.h (limited to 'examples/GuiClient/chatDialog.h') diff --git a/examples/GuiClient/chatDialog.h b/examples/GuiClient/chatDialog.h new file mode 100644 index 00000000..9840ac49 --- /dev/null +++ b/examples/GuiClient/chatDialog.h @@ -0,0 +1,56 @@ +#ifndef CHATDIALOG_H +#define CHATDIALOG_H + +#include +#include + +namespace Ui +{ + class chatDialogClass; +} + +class chatGraphicsView; +class chatGraphicsScene; +class QXmppClient; +class QPushButton; + +class chatDialog : public QDialog +{ + Q_OBJECT + +public: + chatDialog(QWidget *parent = 0); + void show(); + + QString getBareJid() const; + QString getDisplayName() const; + void setBareJid(const QString&); + void setDisplayName(const QString&); + void setQXmppClient(QXmppClient* client); + void messageReceived(const QString& msg); + +private slots: + void sendMessage(); + +protected: + void keyPressEvent(QKeyEvent*); + void paintEvent(QPaintEvent* event); + virtual void resizeEvent(QResizeEvent*); + virtual void moveEvent(QMoveEvent*); + +private: + void updateSendButtonGeomerty(); + + Ui::chatDialogClass *ui; + chatGraphicsView* m_view; + chatGraphicsScene* m_scene; + QPushButton* m_pushButtonSend; + + // holds a reference to the the connected client + QXmppClient* m_client; + + QString m_bareJid; + QString m_displayName; +}; + +#endif // CHATDIALOG_H -- cgit v1.2.3