Mana
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
WhisperTab Class Reference

A tab for whispers from a single player. More...

#include <whispertab.h>

Inheritance diagram for WhisperTab:
ChatTab Tab AutoCompleteLister EventListener

Public Member Functions

const std::string & getNick () const
 
void showHelp () override
 Add any extra help text to the output.
 
bool handleCommand (const std::string &type, const std::string &args) override
 Handle special commands.
 
void saveToLogFile (std::string &msg) override
 
- Public Member Functions inherited from ChatTab
 ChatTab (const std::string &name)
 
 ~ChatTab () override
 
void chatLog (std::string line, Own own=BY_SERVER, bool ignoreRecord=false)
 Adds a line of text to our message list.
 
void chatLog (const std::string &nick, const std::string &msg)
 Adds the text to the message list.
 
void chatInput (const std::string &msg)
 Determines whether the message is a command or message, then sends the given message to the game server to be said, or to the command handler.
 
void scroll (int amount)
 Scrolls the chat window.
 
void clearText ()
 Clears the text from the tab.
 
void getAutoCompleteList (std::vector< std::string > &names) const override
 
void event (Event::Channel channel, const Event &event) override
 
- Public Member Functions inherited from Tab
 Tab ()
 
void setCaption (const std::string &caption)
 Sets the caption of the tab.
 
void draw (gcn::Graphics *graphics) override
 Draw the tab.
 
void drawFrame (gcn::Graphics *graphics) override
 Draw the tab frame.
 
void setTabColor (const gcn::Color *color)
 Set the normal color fo the tab's text.
 
void setFlash (bool flash)
 Set tab flashing state.
 
- Public Member Functions inherited from AutoCompleteLister
virtual ~AutoCompleteLister ()=default
 
- Public Member Functions inherited from EventListener
virtual ~EventListener ()
 
void listen (Event::Channel channel)
 
void ignore (Event::Channel channel)
 

Protected Member Functions

 WhisperTab (const std::string &nick)
 Constructor.
 
 ~WhisperTab () override
 
void handleInput (const std::string &msg) override
 
void handleCommand (const std::string &msg) override
 
bool checkNotify (Own) const override
 Returns whether a notify sound may be played for the given type of message.
 
- Protected Member Functions inherited from ChatTab
void setCurrent () override
 
void updateTextFormat (int alpha)
 Adapts the text format to the current gui opacity, for better readability.
 

Private Attributes

std::string mNick
 

Friends

class ChatWindow
 

Additional Inherited Members

- Protected Attributes inherited from ChatTab
ScrollAreamScrollArea
 
BrowserBoxmTextOutput
 

Detailed Description

A tab for whispers from a single player.

Definition at line 31 of file whispertab.h.

Constructor & Destructor Documentation

◆ WhisperTab()

WhisperTab::WhisperTab ( const std::string &  nick)
protected

Constructor.

Parameters
nickthe name of the player this tab is whispering to

Definition at line 35 of file whispertab.cpp.

◆ ~WhisperTab()

WhisperTab::~WhisperTab ( )
overrideprotected

Definition at line 42 of file whispertab.cpp.

Member Function Documentation

◆ checkNotify()

bool WhisperTab::checkNotify ( Own  own) const
inlineoverrideprotectedvirtual

Returns whether a notify sound may be played for the given type of message.

By default, only returns true for inline whispers.

Is never called for server-messages or when the window has focus and this is the current tab.

Reimplemented from ChatTab.

Definition at line 59 of file whispertab.h.

◆ getNick()

const std::string & WhisperTab::getNick ( ) const
inline

Definition at line 34 of file whispertab.h.

◆ handleCommand() [1/2]

void WhisperTab::handleCommand ( const std::string &  msg)
overrideprotectedvirtual

Reimplemented from ChatTab.

Definition at line 61 of file whispertab.cpp.

◆ handleCommand() [2/2]

bool WhisperTab::handleCommand ( const std::string &  type,
const std::string &  args 
)
overridevirtual

Handle special commands.

Allows a tab to handle commands it defines itself.

Returns
true if the command was handled false if the command was not handled

Reimplemented from ChatTab.

Definition at line 76 of file whispertab.cpp.

◆ handleInput()

void WhisperTab::handleInput ( const std::string &  msg)
overrideprotectedvirtual

Reimplemented from ChatTab.

Definition at line 48 of file whispertab.cpp.

◆ saveToLogFile()

void WhisperTab::saveToLogFile ( std::string &  msg)
overridevirtual

Reimplemented from ChatTab.

Definition at line 119 of file whispertab.cpp.

◆ showHelp()

void WhisperTab::showHelp ( )
overridevirtual

Add any extra help text to the output.

Allows tabs to define help for commands defined by the tab itself.

Reimplemented from ChatTab.

Definition at line 69 of file whispertab.cpp.

Friends And Related Symbol Documentation

◆ ChatWindow

friend class ChatWindow
friend

Definition at line 44 of file whispertab.h.

Member Data Documentation

◆ mNick

std::string WhisperTab::mNick
private

Definition at line 63 of file whispertab.h.


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