AppChat  0.5.0
TCP client-server caht application with boost::asio library.
Public Slots | Signals | Public Member Functions | List of all members
Control Class Reference

Controller. More...

#include <control.h>

Inheritance diagram for Control:
Inheritance graph
[legend]
Collaboration diagram for Control:
Collaboration graph
[legend]

Public Slots

void autorisation (const std::string &login, const std::string &password)
 User autorization. More...
 
void registration (const std::string &login, const std::string &password)
 User registration. More...
 
void get_text_from_gui (const std::string &login, const std::string &text, int room_id)
 Send message. More...
 
void text_from_client (const std::string &from, const std::string &text, DateTime dt)
 Notify UI about received message. More...
 
void change_room (int new_room_id)
 Change chat room to another one. More...
 

Signals

void send_text_to_gui (const std::string &login, const std::string &text, DateTime dt)
 Show reveived message. More...
 

Public Member Functions

 Control (int argc, char **argv)
 
void connect_to_server (const std::string &login, const std::string &password, TypeCommand command)
 Start communication with server. More...
 
 ~Control ()
 Close client socket when destroy UI controller.
 

Detailed Description

Controller.

Parameters
ipand port server

Member Function Documentation

void Control::autorisation ( const std::string &  login,
const std::string &  password 
)
inlineslot

User autorization.

Parameters
loginuser's login
passworduser's password
Todo:
fix typo autorisation -> authorization
void Control::change_room ( int  new_room_id)
inlineslot

Change chat room to another one.

Parameters
new_room_idroom where user is switching
void Control::connect_to_server ( const std::string &  login,
const std::string &  password,
TypeCommand  command 
)

Start communication with server.

Parameters
loginuser's login
passworduser's password
commandrequest code that would have sent on opened connection it could be AutorisationRequest or RegistrationRequest
Todo:
fix noreturn
void Control::get_text_from_gui ( const std::string &  login,
const std::string &  text,
int  room_id 
)
inlineslot

Send message.

Parameters
loginsender's login
textmessage content
room_idsender's room
void Control::registration ( const std::string &  login,
const std::string &  password 
)
inlineslot

User registration.

Parameters
loginuser's login
passworduser's password
Todo:
replace to async?
void Control::send_text_to_gui ( const std::string &  login,
const std::string &  text,
DateTime  dt 
)
signal

Show reveived message.

Parameters
loginmessage sender's login
textmessage content
dtdate and time of sending the text
void Control::text_from_client ( const std::string &  from,
const std::string &  text,
DateTime  dt 
)
inlineslot

Notify UI about received message.

Parameters
fromsender's login
textmessage content
dtdate and time of sending the text

The documentation for this class was generated from the following files: