Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CHAT_EVENTS_H_INCLUDED
00018 #define CHAT_EVENTS_H_INCLUDED
00019
00020 #include "global.hpp"
00021
00022 #include <string>
00023
00024 namespace events {
00025
00026 class chat_handler
00027 {
00028 public:
00029 chat_handler();
00030 virtual ~chat_handler();
00031
00032 enum MESSAGE_TYPE { MESSAGE_PUBLIC, MESSAGE_PRIVATE };
00033
00034 void send_command(const std::string& cmd, const std::string& args="");
00035 protected:
00036 void do_speak(const std::string& message, bool allies_only=false);
00037
00038
00039 virtual void add_chat_message(const time_t& time,
00040 const std::string& speaker, int side, const std::string& message,
00041 MESSAGE_TYPE type=MESSAGE_PRIVATE)=0;
00042
00043 virtual void send_chat_message(const std::string& message, bool allies_only=false)=0;
00044
00045 virtual void send_whisper(const std::string& receiver, const std::string& message);
00046
00047 virtual void add_whisper_sent(const std::string& receiver, const std::string& message);
00048
00049 virtual void add_whisper_received(const std::string& sender, const std::string& message);
00050
00051 virtual void send_chat_room_message(const std::string& room, const std::string& message);
00052
00053 virtual void add_chat_room_message_sent(const std::string& room, const std::string& message);
00054
00055 virtual void add_chat_room_message_received(const std::string& room,
00056 const std::string& speaker, const std::string& message);
00057
00058
00059
00060
00061
00062 virtual void user_relation_changed(const std::string& name);
00063
00064 void change_logging(const std::string& data);
00065
00066 friend class chat_command_handler;
00067 };
00068
00069 }
00070 #endif