diff options
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r-- | src/gui/chat.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h index 1c673556..3a001432 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -22,6 +22,8 @@ #ifndef CHAT_H #define CHAT_H +#include "listener.h" + #include "gui/widgets/window.h" #include "gui/widgets/textfield.h" @@ -36,8 +38,8 @@ #include <vector> class BrowserBox; -class Channel; class ChatTab; +class Channel; class ChatInput; class Recorder; class ScrollArea; @@ -48,12 +50,24 @@ class WhisperTab; #define DEFAULT_CHAT_WINDOW_SCROLL 7 // 1 means `1/8th of the window size'. +enum Own +{ + BY_GM, + BY_PLAYER, + BY_OTHER, + BY_SERVER, + BY_CHANNEL, + ACT_WHISPER, // getting whispered at + ACT_IS, // equivalent to "/me" on IRC + BY_LOGGER +}; + /** One item in the chat log */ struct CHATLOG { std::string nick; std::string text; - int own; + Own own; }; /** @@ -62,7 +76,8 @@ struct CHATLOG * \ingroup Interface */ class ChatWindow : public Window, - public gcn::ActionListener + public gcn::ActionListener, + public Mana::Listener { public: /** @@ -143,6 +158,8 @@ class ChatWindow : public Window, void mousePressed(gcn::MouseEvent &event); void mouseDragged(gcn::MouseEvent &event); + void event(const std::string &channel, const Mana::Event &event); + /** * Scrolls the chat window * @@ -165,7 +182,7 @@ class ChatWindow : public Window, void doPresent(); void whisper(const std::string &nick, const std::string &mes, - bool own = false); + Own own = BY_OTHER); ChatTab *addWhisperTab(const std::string &nick, bool switchTo = false); |