33#ifdef NDEVR_SUPPORTS_SOCKET_IO
36#include <QPlainTextEdit>
38#include <sio_client.h>
39#include "UsernameDialog.h"
50 class ChatDialog :
public QWidget
59 explicit ChatDialog(QWidget *parent = 0);
69 void SendBtnClicked();
77 void OnMessageReturn();
83 void showEvent(QShowEvent* event);
90 void RequestAddListItem(QListWidgetItem *item);
95 void RequestRemoveListItem(QListWidgetItem *item);
100 void RequestToggleInputs(
bool loginOrNot);
106 void AddListItem(QListWidgetItem *item);
111 void RemoveListItem(QListWidgetItem *item);
116 void ToggleInputs(
bool loginOrNot);
124 void NicknameAccept();
128 void NicknameCancelled();
137 void OnNewMessage(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
145 void OnUserJoined(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
153 void OnUserLeft(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
161 void OnTyping(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
169 void OnStopTyping(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
177 void OnLogin(std::string
const& name, message::ptr
const& data,
bool hasAck, message::list &ack_resp);
182 void OnConnected(std::string
const& nsp);
187 void OnClosed(client::close_reason
const& reason);
195 void ShowLoginDialog();
197 Ui::ChatDialogUI *ui;
199 std::unique_ptr<client> _io;
201 std::unique_ptr<UsernameDialog> m_dialog;
205 std::unique_ptr<QTimer> m_timer;
207 QListWidgetItem *m_typingItem;
The primary namespace for the NDEVR SDK.