SimpleChatWidget Class Reference
[Chat example]

A self-contained chat widget. More...

#include <SimpleChatWidget.h>

Inheritance diagram for SimpleChatWidget:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 SimpleChatWidget (SimpleChatServer &server, Wt::WContainerWidget *parent=0)
 Create a chat widget that will connect to the given server.
 ~SimpleChatWidget ()
 Delete a chat widget.
void letLogin ()
 Show a simple login screen.
bool startChat (const Wt::WString &user)
 Start a chat for the given user.

Private Member Functions

void login ()
void logout ()
void send ()
void updateUsers ()
void processChatEvent (const ChatEvent &event)
void onEditBlur ()
void onEditFocus ()

Private Attributes

Wt::WContainerWidgetlayout_
SimpleChatServerserver_
Wt::WApplicationapp_
Wt::WString user_
Wt::WLineEdituserNameEdit_
Wt::WTextstatusMsg_
Wt::WContainerWidgetmessages_
Wt::WContainerWidgetmessageEditArea_
Wt::WTextAreamessageEdit_
Wt::WPushButtonsendButton_
Wt::WContainerWidgetuserList_
boost::signals::connection eventConnection_


Detailed Description

A self-contained chat widget.

Definition at line 33 of file SimpleChatWidget.h.


Constructor & Destructor Documentation

SimpleChatWidget::SimpleChatWidget ( SimpleChatServer server,
Wt::WContainerWidget parent = 0 
)

Create a chat widget that will connect to the given server.

Definition at line 23 of file SimpleChatWidget.C.

SimpleChatWidget::~SimpleChatWidget (  ) 

Delete a chat widget.

Definition at line 39 of file SimpleChatWidget.C.


Member Function Documentation

void SimpleChatWidget::letLogin (  ) 

Show a simple login screen.

Definition at line 44 of file SimpleChatWidget.C.

bool SimpleChatWidget::startChat ( const Wt::WString user  ) 

Start a chat for the given user.

Returns false if the user could not login.

Definition at line 84 of file SimpleChatWidget.C.

void SimpleChatWidget::login (  )  [private]

Definition at line 63 of file SimpleChatWidget.C.

void SimpleChatWidget::logout (  )  [private]

Definition at line 71 of file SimpleChatWidget.C.

void SimpleChatWidget::send (  )  [private]

Definition at line 154 of file SimpleChatWidget.C.

void SimpleChatWidget::updateUsers (  )  [private]

Definition at line 166 of file SimpleChatWidget.C.

void SimpleChatWidget::processChatEvent ( const ChatEvent event  )  [private]

Definition at line 185 of file SimpleChatWidget.C.

void SimpleChatWidget::onEditBlur (  )  [private]

void SimpleChatWidget::onEditFocus (  )  [private]


Member Data Documentation

Wt::WContainerWidget* SimpleChatWidget::layout_ [private]

Definition at line 55 of file SimpleChatWidget.h.

SimpleChatServer& SimpleChatWidget::server_ [private]

Definition at line 56 of file SimpleChatWidget.h.

Wt::WApplication* SimpleChatWidget::app_ [private]

Definition at line 57 of file SimpleChatWidget.h.

Wt::WString SimpleChatWidget::user_ [private]

Definition at line 59 of file SimpleChatWidget.h.

Wt::WLineEdit* SimpleChatWidget::userNameEdit_ [private]

Definition at line 61 of file SimpleChatWidget.h.

Wt::WText* SimpleChatWidget::statusMsg_ [private]

Definition at line 62 of file SimpleChatWidget.h.

Wt::WContainerWidget* SimpleChatWidget::messages_ [private]

Definition at line 64 of file SimpleChatWidget.h.

Wt::WContainerWidget* SimpleChatWidget::messageEditArea_ [private]

Definition at line 65 of file SimpleChatWidget.h.

Wt::WTextArea* SimpleChatWidget::messageEdit_ [private]

Definition at line 66 of file SimpleChatWidget.h.

Wt::WPushButton* SimpleChatWidget::sendButton_ [private]

Definition at line 67 of file SimpleChatWidget.h.

Wt::WContainerWidget* SimpleChatWidget::userList_ [private]

Definition at line 68 of file SimpleChatWidget.h.

boost::signals::connection SimpleChatWidget::eventConnection_ [private]

Definition at line 70 of file SimpleChatWidget.h.


The documentation for this class was generated from the following files:
Generated on Mon Apr 14 15:15:04 2008 for Wt by doxygen 1.5.3