chat_events.hpp

Go to the documentation of this file.
00001 /* $Id: chat_events.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2006 - 2012 by Joerg Hinrichs <joerg.hinrichs@alice-dsl.de>
00004    wesnoth playturn Copyright (C) 2003 by David White <dave@whitevine.net>
00005    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY.
00013 
00014    See the COPYING file for more details.
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     //called from do_speak
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      * Called when a processed command results in a relation (friend/ignore) change
00060      * for a user whose name is passed as the 'name' arg
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:34 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs