The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
events::chat_handler Class Referenceabstract

#include <chat_events.hpp>

Inheritance diagram for events::chat_handler:
Inheritance graph

Public Types

enum  MESSAGE_TYPE { MESSAGE_PUBLIC, MESSAGE_PRIVATE }
 

Public Member Functions

 chat_handler ()
 
virtual ~chat_handler ()
 
void send_command (const std::string &cmd, const std::string &args="")
 
virtual void send_to_server (const config &cfg)=0
 

Protected Member Functions

void do_speak (const std::string &message, bool allies_only=false)
 
virtual void add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &message, MESSAGE_TYPE type=MESSAGE_PRIVATE)=0
 
virtual void send_chat_message (const std::string &message, bool allies_only=false)=0
 
virtual void send_whisper (const std::string &receiver, const std::string &message)
 
virtual void add_whisper_sent (const std::string &receiver, const std::string &message)
 
virtual void add_whisper_received (const std::string &sender, const std::string &message)
 
virtual void send_chat_room_message (const std::string &room, const std::string &message)
 
virtual void add_chat_room_message_sent (const std::string &room, const std::string &message)
 
virtual void add_chat_room_message_received (const std::string &room, const std::string &speaker, const std::string &message)
 
virtual void user_relation_changed (const std::string &name)
 Called when a processed command results in a relation (friend/ignore) change for a user whose name is passed as the 'name' arg. More...
 
void change_logging (const std::string &data)
 Change the log level of a log domain. More...
 

Friends

class chat_command_handler
 

Detailed Description

Definition at line 24 of file chat_events.hpp.

Member Enumeration Documentation

Enumerator
MESSAGE_PUBLIC 
MESSAGE_PRIVATE 

Definition at line 30 of file chat_events.hpp.

Constructor & Destructor Documentation

events::chat_handler::chat_handler ( )

Definition at line 34 of file chat_events.cpp.

events::chat_handler::~chat_handler ( )
virtual

Definition at line 38 of file chat_events.cpp.

Member Function Documentation

virtual void events::chat_handler::add_chat_message ( const time_t &  time,
const std::string &  speaker,
int  side,
const std::string &  message,
MESSAGE_TYPE  type = MESSAGE_PRIVATE 
)
protectedpure virtual
void events::chat_handler::add_chat_room_message_received ( const std::string &  room,
const std::string &  speaker,
const std::string &  message 
)
protectedvirtual

Reimplemented in gui2::chatbox.

Definition at line 188 of file chat_events.cpp.

References add_chat_message(), and MESSAGE_PRIVATE.

Referenced by add_chat_room_message_sent().

void events::chat_handler::add_chat_room_message_sent ( const std::string &  room,
const std::string &  message 
)
protectedvirtual

Reimplemented in gui2::chatbox.

Definition at line 183 of file chat_events.cpp.

References add_chat_room_message_received(), and preferences::login().

Referenced by events::chat_command_handler::do_chanmsg().

void events::chat_handler::add_whisper_received ( const std::string &  sender,
const std::string &  message 
)
protectedvirtual

Reimplemented in gui2::chatbox.

Definition at line 165 of file chat_events.cpp.

References add_chat_message(), and VGETTEXT.

void events::chat_handler::add_whisper_sent ( const std::string &  receiver,
const std::string &  message 
)
protectedvirtual

Reimplemented in gui2::chatbox.

Definition at line 158 of file chat_events.cpp.

References add_chat_message(), and VGETTEXT.

Referenced by events::chat_command_handler::do_whisper().

void events::chat_handler::change_logging ( const std::string &  data)
protected

Change the log level of a log domain.

Parameters
datastring of the form: "@<level@> @<domain@>"

Definition at line 47 of file chat_events.cpp.

References _(), add_chat_message(), lg::debug(), lg::err(), ERR_NG, gui2::event::find(), lg::logger::get_severity(), lg::info(), game_config::images::level, LOG_NG, wfl::msg(), lg::set_log_domain_severity(), vgettext(), and lg::warn().

Referenced by events::chat_command_handler::do_log().

void events::chat_handler::do_speak ( const std::string &  message,
bool  allies_only = false 
)
protected

Definition at line 123 of file chat_events.cpp.

References send_chat_message().

Referenced by events::menu_handler::do_speak().

virtual void events::chat_handler::send_chat_message ( const std::string &  message,
bool  allies_only = false 
)
protectedpure virtual
void events::chat_handler::send_chat_room_message ( const std::string &  room,
const std::string &  message 
)
protectedvirtual
void events::chat_handler::send_command ( const std::string &  cmd,
const std::string &  args = "" 
)
virtual void events::chat_handler::send_to_server ( const config cfg)
pure virtual
void events::chat_handler::send_whisper ( const std::string &  receiver,
const std::string &  message 
)
protectedvirtual
void events::chat_handler::user_relation_changed ( const std::string &  name)
protectedvirtual

Called when a processed command results in a relation (friend/ignore) change for a user whose name is passed as the 'name' arg.

Reimplemented in gui2::chatbox.

Definition at line 144 of file chat_events.cpp.

Referenced by events::chat_command_handler::do_friend(), events::chat_command_handler::do_ignore(), and events::chat_command_handler::do_remove().

Friends And Related Function Documentation

friend class chat_command_handler
friend

Definition at line 66 of file chat_events.hpp.


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