2009-04-02 09:23:05 -04:00
|
|
|
#ifndef FORM_CHATWIDGET_h
|
|
|
|
#define FORM_CHATWIDGET_h
|
|
|
|
|
|
|
|
|
|
|
|
#include "ui_form_chatwidget.h"
|
2009-04-20 08:42:47 -04:00
|
|
|
#include "gui_icons.h"
|
|
|
|
|
2009-04-02 09:23:05 -04:00
|
|
|
#include <QtGui>
|
|
|
|
#include <Qt>
|
|
|
|
#include <QClipboard>
|
2009-04-20 08:42:47 -04:00
|
|
|
#include <QKeyEvent>
|
|
|
|
class ChatEventEater : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
ChatEventEater(QWidget *parent = 0) : QObject(parent){ }
|
|
|
|
bool m_send_on_enter;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void sendMessage();
|
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
|
|
|
};
|
2009-04-02 09:23:05 -04:00
|
|
|
|
|
|
|
class cUser;
|
|
|
|
class form_ChatWidget : public QWidget, public Ui::form_chatwidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
form_ChatWidget(cUser* user,QWidget* parent = 0);
|
|
|
|
void closeEvent(QCloseEvent *e);
|
|
|
|
private slots:
|
|
|
|
void sendMessageSignal();
|
|
|
|
void addMessage(QString text);
|
|
|
|
void setTextColor();
|
|
|
|
void newMessageRecived();
|
|
|
|
void setBold(bool t);
|
|
|
|
void setFont();
|
2009-04-20 08:42:47 -04:00
|
|
|
void WorkAround();
|
|
|
|
void changeWindowsTitle();
|
2009-04-02 09:23:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void sendChatMessage(QString chatMessage);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QColor textColor;
|
|
|
|
QStringList history;
|
|
|
|
cUser* user;
|
|
|
|
QFont mCurrentFont;
|
2009-04-20 08:42:47 -04:00
|
|
|
ChatEventEater *m_event_eater;
|
2009-04-02 09:23:05 -04:00
|
|
|
};
|
2009-04-20 08:42:47 -04:00
|
|
|
#endif
|