38 struct builder_chatbox;
86 void load_log(std::map<std::string, chatroom_log>& log,
bool show_lobby);
100 const std::string& speaker,
108 const std::string&
message)
override;
112 const std::string&
message)
override;
116 const std::string&
message)
override;
120 const std::string& speaker,
121 const std::string&
message)
override;
136 std::map<std::string, chatroom_log>*
log_;
140 static const std::string&
type();
154 void append_to_chatbox(
const std::string& text,
const bool force_scroll =
false);
156 void append_to_chatbox(
const std::string& text, std::size_t
id,
const bool force_scroll =
false);
179 const bool force_scroll =
false);
183 const std::string& sender,
189 const bool force_scroll =
false);
216 const bool open_new,
const bool allow_close =
true);
266 virtual std::unique_ptr<widget>
build()
const override;
A config object defines a single node in a WML file, with access to child nodes.
std::map< std::string, chatroom_log > * log_
bool room_window_active(const std::string &room)
lobby_chat_window * room_window_open(const std::string &room, const bool open_new, const bool allow_close=true)
Check if a room window for "room" is open, if open_new is true then it will be created if not found.
lobby_chat_window * find_or_create_window(const std::string &name, const bool whisper, const bool open_new, const bool allow_close, const std::string &initial_text)
Helper function to find and open a new window, used by *_window_open.
virtual void clear_messages() override
void add_active_window_whisper(const std::string &sender, const std::string &message, const bool force_scroll=false)
Add a whisper message to the current window which is not the whisper window for "name".
void append_to_chatbox(const std::string &text, const bool force_scroll=false)
virtual unsigned get_state() const override
See styled_widget::get_state.
virtual void user_relation_changed(const std::string &name) override
Inherited form chat_handler.
virtual void send_chat_message(const std::string &message, bool allies_only) override
Inherited form chat_handler.
void add_active_window_message(const std::string &sender, const std::string &message, const bool force_scroll=false)
Add a message to the window for room "room".
void close_window(std::size_t idx)
void add_whisper_window_whisper(const std::string &sender, const std::string &message)
Add a whisper message to the whisper window.
void close_window_button_callback(std::string room_name, bool &handled, bool &halt)
virtual void add_chat_room_message_sent(const std::string &room, const std::string &message) override
Inherited form chat_handler.
multi_page * chat_log_container_
void process_message(const ::config &data, bool whisper=false)
lobby_chat_window * whisper_window_open(const std::string &name, bool open_new)
Check if a whisper window for user "name" is open, if open_new is true then it will be created if not...
void switch_to_window(lobby_chat_window *t)
Switch to the window given by a valid pointer (e.g.
std::size_t active_window_
virtual void set_self_active(const bool) override
See container_base::set_self_active.
virtual void add_whisper_sent(const std::string &receiver, const std::string &message) override
Inherited form chat_handler.
virtual void add_chat_message(const std::time_t &time, const std::string &speaker, int side, const std::string &message, events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE) override
Inherited form chat_handler.
void process_network_data(const ::config &data)
void increment_waiting_whispers(const std::string &name)
Mark the whisper window for "name" as having one more pending message.
chatbox(const implementation::builder_chatbox &builder)
void set_active_window_changed_callback(const std::function< void(void)> &f)
std::function< void(void)> active_window_changed_callback_
void increment_waiting_messages(const std::string &room)
Mark the room window for "room" as having one more pending message.
void signal_handler_receive_keyboard_focus(const event::ui_event event)
void send_to_server(const ::config &cfg) override
virtual void add_chat_room_message_received(const std::string &room, const std::string &speaker, const std::string &message) override
Inherited form chat_handler.
void load_log(std::map< std::string, chatroom_log > &log, bool show_lobby)
virtual void add_whisper_received(const std::string &sender, const std::string &message) override
Inherited form chat_handler.
virtual void set_active(const bool) override
See styled_widget::set_active.
virtual bool get_active() const override
See styled_widget::get_active.
virtual const std::string & get_control_type() const override
Inherited from styled_widget, implemented by REGISTER_WIDGET.
void finalize_setup()
Initializes the internal sub-widget pointers.
void chat_input_keypress_callback(const SDL_Keycode key)
void add_room_window_message(const std::string &room, const std::string &sender, const std::string &message)
Add a message to the window for room "room".
void active_window_changed()
std::vector< lobby_chat_window > open_windows_
bool whisper_window_active(const std::string &name)
static const std::string & type()
Static type getter that does not rely on the widget being constructed.
A generic container base class.
Main class to show messages to the user.
A widget that allows the user to input text in single line.
ui_event
The event sent to the dispatcher.
std::shared_ptr< builder_grid > builder_grid_ptr
Contains the implementation details for lexical_cast and shouldn't be used directly.
resolution(const config &cfg)
chatbox_definition(const config &cfg)
builder_chatbox(const config &cfg)
virtual std::unique_ptr< widget > build() const override
lobby_chat_window(const std::string &name, bool whisper)