The Battle for Wesnoth  1.19.0-dev
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
display_chat_manager Class Reference

#include <display_chat_manager.hpp>

Classes

struct  chat_message
 

Public Member Functions

 display_chat_manager (display &disp)
 
void add_observer (const std::string &name)
 
void remove_observer (const std::string &name)
 
const std::set< std::string > & observers () const
 
void add_whisperer (const std::string &nick)
 
void remove_whisperer (const std::string &nick)
 
const std::set< std::string > & whisperers () const
 
void add_chat_message (const std::time_t &time, const std::string &speaker, int side, const std::string &msg, events::chat_handler::MESSAGE_TYPE type, bool bell)
 
void clear_chat_messages ()
 

Private Member Functions

void prune_chat_messages (bool remove_all=false)
 

Private Attributes

std::set< std::string > observers_
 
std::set< std::string > whisperers_
 
std::vector< chat_messagechat_messages_
 
displaymy_disp_
 

Friends

class game_display
 

Detailed Description

Definition at line 28 of file display_chat_manager.hpp.

Constructor & Destructor Documentation

◆ display_chat_manager()

display_chat_manager::display_chat_manager ( display disp)
inline

Definition at line 30 of file display_chat_manager.hpp.

Member Function Documentation

◆ add_chat_message()

void display_chat_manager::add_chat_message ( const std::time_t &  time,
const std::string &  speaker,
int  side,
const std::string &  msg,
events::chat_handler::MESSAGE_TYPE  type,
bool  bell 
)

Definition at line 48 of file display_chat_manager.cpp.

References font::add_floating_label(), add_whisperer(), chat_messages_, ERR_NG, mp::ui_alerts::friend_message(), preferences::get_chat_timestamp(), display::get_disp_context(), font::get_floating_label_rect(), team::get_side_color_range(), video::headless(), preferences::is_friend(), preferences::is_ignored(), display_context::is_observer(), font::LEFT_ALIGN, preferences::login(), display::map_outside_area(), events::chat_handler::MESSAGE_PRIVATE, events::chat_handler::MESSAGE_PUBLIC, color_range::mid(), wfl::msg(), my_disp_, font::pango_word_wrap(), preferences::parse_should_show_lobby_join(), mp::ui_alerts::private_message(), prune_chat_messages(), mp::ui_alerts::public_message(), remove_whisperer(), mp::ui_alerts::server_message(), font::floating_label::set_alignment(), font::floating_label::set_bg_color(), font::floating_label::set_border_size(), font::floating_label::set_clip_rect(), font::floating_label::set_color(), font::floating_label::set_font_size(), font::floating_label::set_position(), font::SIZE_15, font::floating_label::use_markup(), w, whisperers(), and utils::word_match().

Referenced by chat_message(), wfl::builtins::DEFINE_WFL_FUNCTION(), gui2::dialogs::lua_interpreter::display(), ai::formula_ai::display_message(), do_replay_handle(), ai::readonly_context_impl::log_message(), game_lua_kernel::lua_chat(), playmp_controller::process_network_data_impl(), game_events::wml_event_pump::show_wml_messages(), and gui::floating_textbox::tab().

◆ add_observer()

void display_chat_manager::add_observer ( const std::string &  name)
inline

Definition at line 32 of file display_chat_manager.hpp.

References observers_.

Referenced by playmp_controller::process_network_data_impl().

◆ add_whisperer()

void display_chat_manager::add_whisperer ( const std::string &  nick)
inline

Definition at line 36 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

◆ clear_chat_messages()

void display_chat_manager::clear_chat_messages ( )
inline

Definition at line 42 of file display_chat_manager.hpp.

References prune_chat_messages().

Referenced by game_lua_kernel::intf_clear_messages().

◆ observers()

const std::set<std::string>& display_chat_manager::observers ( ) const
inline

Definition at line 34 of file display_chat_manager.hpp.

References observers_.

◆ prune_chat_messages()

void display_chat_manager::prune_chat_messages ( bool  remove_all = false)
private

◆ remove_observer()

void display_chat_manager::remove_observer ( const std::string &  name)
inline

Definition at line 33 of file display_chat_manager.hpp.

References observers_.

Referenced by playmp_controller::process_network_data_impl().

◆ remove_whisperer()

void display_chat_manager::remove_whisperer ( const std::string &  nick)
inline

Definition at line 37 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

◆ whisperers()

const std::set<std::string>& display_chat_manager::whisperers ( ) const
inline

Definition at line 38 of file display_chat_manager.hpp.

References whisperers_.

Referenced by add_chat_message().

Friends And Related Function Documentation

◆ game_display

friend class game_display
friend

Definition at line 44 of file display_chat_manager.hpp.

Member Data Documentation

◆ chat_messages_

std::vector<chat_message> display_chat_manager::chat_messages_
private

Definition at line 60 of file display_chat_manager.hpp.

Referenced by add_chat_message(), and prune_chat_messages().

◆ my_disp_

display& display_chat_manager::my_disp_
private

Definition at line 62 of file display_chat_manager.hpp.

Referenced by add_chat_message().

◆ observers_

std::set<std::string> display_chat_manager::observers_
private

Definition at line 46 of file display_chat_manager.hpp.

Referenced by add_observer(), observers(), and remove_observer().

◆ whisperers_

std::set<std::string> display_chat_manager::whisperers_
private

Definition at line 47 of file display_chat_manager.hpp.

Referenced by add_whisperer(), remove_whisperer(), and whisperers().


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