The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
events::chat_command_handler Class Reference

#include <chat_command_handler.hpp>

Inheritance diagram for events::chat_command_handler:
Inheritance graph

Public Types

typedef map_command_handler
< chat_command_handler
map
 
- Public Types inherited from events::map_command_handler< chat_command_handler >
typedef void(chat_command_handler::* command_handler )()
 
typedef std::map< std::string,
command > 
command_map
 
typedef std::map< std::string,
std::string
command_alias_map
 

Public Member Functions

 chat_command_handler (chat_handler &chathandler, bool allies_only)
 
- Public Member Functions inherited from events::map_command_handler< chat_command_handler >
 map_command_handler ()
 
virtual ~map_command_handler ()
 
bool empty () const
 
void dispatch (std::string cmd)
 
std::vector< std::stringget_commands_list () const
 
void command_failed (const std::string &message, bool=false)
 

Protected Member Functions

void do_emote ()
 
void do_network_send ()
 
void do_network_send_req_arg ()
 
void do_room_query ()
 
void do_room_query_noarg ()
 
void do_gen_room_query ()
 
void do_whisper ()
 
void do_chanmsg ()
 
void do_log ()
 
void do_ignore ()
 
void do_friend ()
 
void do_remove ()
 
void do_display ()
 
void do_version ()
 
void do_register ()
 Ask the server to register the currently used nick. More...
 
void do_drop ()
 Ask the server do drop the currently used (and registered) nick. More...
 
void do_set ()
 Update details for the currently used username. More...
 
void do_info ()
 Request information about a user from the server. More...
 
void do_details ()
 Request a list of details that can be set for a username as these might vary depending on the configuration of the server. More...
 
std::string get_flags_description () const
 
std::string get_command_flags_description (const map_command_handler< chat_command_handler >::command &c) const
 
bool is_enabled (const map_command_handler< chat_command_handler >::command &c) const
 
void print (const std::string &title, const std::string &message)
 
void init_map ()
 
- Protected Member Functions inherited from events::map_command_handler< chat_command_handler >
void init_map_default ()
 
virtual std::string get_command_flags_description (const command &) const
 
virtual bool is_enabled (const command &) const
 
virtual void parse_cmd (const std::string &cmd_string)
 
virtual std::string get_arg (unsigned argn) const
 
virtual std::string get_data (unsigned argn=1) const
 
virtual std::string get_cmd () const
 
void command_failed_need_arg (int argn)
 
void print_usage ()
 
std::string get_actual_cmd (const std::string &cmd) const
 
const command * get_command (const std::string &cmd) const
 
command * get_command (const std::string &cmd)
 
void help ()
 
bool help_command (const std::string &acmd)
 
virtual void register_command (const std::string &cmd, command_handler h, const std::string &help="", const std::string &usage="", const std::string &flags="")
 
virtual void assert_existence (const std::string &cmd)
 
virtual void register_alias (const std::string &to_cmd, const std::string &cmd)
 

Private Attributes

chat_handlerchat_handler_
 
bool allies_only_
 

Additional Inherited Members

- Static Protected Member Functions inherited from events::map_command_handler< chat_command_handler >
static void set_help_on_unknown (bool value)
 
static void set_cmd_prefix (std::string value)
 
static const std::vector
< std::string
get_aliases (const std::string &cmd)
 
- Protected Attributes inherited from events::map_command_handler< chat_command_handler >
cmd_arg_parser cap_
 

Detailed Description

Definition at line 9 of file chat_command_handler.hpp.

Member Typedef Documentation

Definition at line 12 of file chat_command_handler.hpp.

Constructor & Destructor Documentation

events::chat_command_handler::chat_command_handler ( chat_handler chathandler,
bool  allies_only 
)
inline

Definition at line 13 of file chat_command_handler.hpp.

Member Function Documentation

void events::chat_command_handler::do_chanmsg ( )
protected
void events::chat_command_handler::do_details ( )
protected

Request a list of details that can be set for a username as these might vary depending on the configuration of the server.

Definition at line 217 of file chat_command_handler.cpp.

References config::add_child(), chat_handler_, and events::chat_handler::send_to_server().

Referenced by init_map().

void events::chat_command_handler::do_display ( )
protected
void events::chat_command_handler::do_drop ( )
protected

Ask the server do drop the currently used (and registered) nick.

Definition at line 174 of file chat_command_handler.cpp.

References _(), config::add_child(), chat_handler_, print(), and events::chat_handler::send_to_server().

Referenced by init_map().

void events::chat_command_handler::do_emote ( )
protected
void events::chat_command_handler::do_friend ( )
protected
void events::chat_command_handler::do_gen_room_query ( )
protected
void events::chat_command_handler::do_ignore ( )
protected
void events::chat_command_handler::do_info ( )
protected
void events::chat_command_handler::do_log ( )
protected
void events::chat_command_handler::do_network_send ( )
protected
void events::chat_command_handler::do_network_send_req_arg ( )
protected
void events::chat_command_handler::do_register ( )
protected
void events::chat_command_handler::do_remove ( )
protected
void events::chat_command_handler::do_room_query ( )
protected
void events::chat_command_handler::do_room_query_noarg ( )
protected
void events::chat_command_handler::do_set ( )
protected
void events::chat_command_handler::do_version ( )
protected

Definition at line 144 of file chat_command_handler.cpp.

References _(), print(), and game_config::revision.

Referenced by init_map().

void events::chat_command_handler::do_whisper ( )
protected
std::string events::chat_command_handler::get_command_flags_description ( const map_command_handler< chat_command_handler >::command &  c) const
inlineprotected

Definition at line 56 of file chat_command_handler.hpp.

References _().

std::string events::chat_command_handler::get_flags_description ( ) const
inlineprotectedvirtual

Reimplemented from events::map_command_handler< chat_command_handler >.

Reimplemented in events::console_handler.

Definition at line 52 of file chat_command_handler.hpp.

References _().

void events::chat_command_handler::init_map ( )
inlineprotectedvirtual
bool events::chat_command_handler::is_enabled ( const map_command_handler< chat_command_handler >::command &  c) const
protected

Definition at line 11 of file chat_command_handler.cpp.

References preferences::is_authenticated().

void events::chat_command_handler::print ( const std::string title,
const std::string message 
)
protectedvirtual

Member Data Documentation

bool events::chat_command_handler::allies_only_
private

Definition at line 151 of file chat_command_handler.hpp.

Referenced by do_emote().

chat_handler& events::chat_command_handler::chat_handler_
private

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