24 #ifndef PAWS_CHAT_WINDOW 25 #define PAWS_CHAT_WINDOW 28 #include <csutil/array.h> 29 #include <csutil/redblacktree.h> 30 #include <csutil/hashr.h> 37 #include <hunspell.hxx> 46 #define CONFIG_CHAT_FILE_NAME "/planeshift/userdata/options/chat.xml" 47 #define CONFIG_CHAT_FILE_NAME_DEF "/planeshift/data/options/chat_def.xml" 101 csHash<csString, csString>
bindings;
116 if(type <
CHAT_END && newName != logChannelFile[type])
118 dirtyLogChannelFile[type] =
true;
119 logChannelFile[type] = newName;
141 void HandleMessage(
MsgEntry* message );
145 const char* HandleCommand(
const char* cmd );
153 bool OnMouseDown(
int button,
int modifiers,
int x ,
int y );
155 bool OnKeyDown( utf32_char keyCode, utf32_char key,
int modifiers );
165 bool OnDoubleClick(
int button,
int modifiers,
int x ,
int y) {
return OnMouseDown(button, modifiers, x, y); }
172 virtual bool OnButtonPressed(
int button,
int keyModifier,
pawsWidget* widget );
173 void SwitchChannel(
const csString &name,
pawsWidget* widget = NULL);
175 void PerformAction(
const char* action );
178 void Clear(
int mode = -2);
180 void SelectChatTab(
int tab);
183 void AutoReply(
void);
186 void SetAway(
const char* text);
188 virtual void OnLostFocus();
191 csString GetBracket(
int type);
194 void ChatOutput(
const char* data,
int colour = -1,
int type =
CHAT_SYSTEM,
bool flashEnabled =
true,
bool hasCharName =
false,
int hotkeyChannel = 0);
196 void AddAutoCompleteName(
const char *name);
197 void RemoveAutoCompleteName(
const char *name);
201 void SaveChatSettings();
202 void LoadChatSettings();
204 void RefreshCommandList();
209 void BadWordsFilter(csString& s);
212 int mixColours(
int colour1,
int colour2);
215 bool LeaveChannel(
int hotkeyChannel);
218 void JoinChannel(csString name);
224 void writeChatHistory();
227 void ReloadChatWindow();
234 return fontName.GetData();
245 void SetChatWindowFont(
const char *FontName,
int FontSize);
250 void HandleSystemMessage(
MsgEntry* message );
260 void FormatMessage(csString &sText, csString &sPerson, csString prependingText, csString &buff,
bool &hasCharName);
263 void SendChatLine(csString& inputText);
266 void SubscribeCommands();
269 void TabCompleteCommand(
const char *cmd);
270 void TabCompleteName(
const char *cmd);
272 void DetermineChatTabAndSelect(
int chattype);
276 csString replyList[4];
328 void CreateSettingNode(iDocumentNode* mNode,
int color,
const char* name);
333 void ReplayMessages(
unsigned int reqLines);
360 void Insert(
const char *str);
366 csString* GetCommand(
int n);
375 unsigned int curLoc() {
return getLoc; };
382 csPDelArray<csString> buffer;
This is a window that is controlled by a button on the control bar.
bool isInChannel
Is already in default channel?
bool enabledLogging[CHAT_END]
Stores if a chat type should be put in the logs.
bool OnDoubleClick(int button, int modifiers, int x, int y)
Handle double click events.
csHashReversible< uint32_t, csString > channelIDs
Subscribed channel name to server channel ID reversible mapping.
csArray< csString > badWords
ChatSettings & GetSettings()
csString channelBracket[CHAT_END]
Stores the brackets to add for each chat type.
csArray< csString > subNames
csHash< csString, csString > bindings
Main Chat window for PlaneShift.
The structure of 1 queue entry (pointer to a message)
A player's ignore list window.
CREATE_PAWS_FACTORY(pawsChatWindow)
char const * GetFontName()
return the name of the font
int playerColor
Player Color.
bool dirtyLogChannelFile[CHAT_END]
Stores if the log file name was changed.
unsigned int tabSetting
The param's low 10 bits are used. Each of these 10 bits stands for the state of the corresponding cha...
pawsIgnoreWindow * GetIgnoredList()
csRedBlackTree< psString > commandList
list of last commands
csHash< csRef< iFile >, uint > openLogFiles
Stores a reference to all opened log files for easy search.
bool enableBadWordsFilterOutgoing
csArray< csString > completionItems
List of items for autocompletion from xml file chat type to subscription name binding.
ChatSettings settings
Stores the settings for the chat.
bool enableBadWordsFilterIncoming
csString currLine
Current line, stored for when scrolling back in the chat history.
csArray< uint16_t > channels
Hotkeys for server channel IDs.
csArray< csArray< csString > * > autoCompleteLists
Contains pointers to all the autocompletion lists (excluding command lists)
int vicinityFilters
Flags int.
void SetGetLoc(unsigned int pos)
csArray< csString > autoCompleteNames
list of names to auto-complete
This is a special type of text box that is used for messages.
csArray< csString > systemTriggers
bool yourColorMix
If it's true the yourColor will be mixed with the Color of the destination Example: if you send a tel...
csString noCasePlayerForename
This stores the text the player has entered into their edit window.
pawsEditTextBox * getInputTextBox()
csString logChannelFile[CHAT_END]
Stores the log files to use for each chat type.
bool havePlayerName
Decides if we have a player name.
This window is supposed to be a generic widget for using tabs to show and hide subwindows automatical...
Struct for returning and setting settings.
pawsIgnoreWindow * IgnoredList
void SetLogChannelFile(unsigned int type, csString newName)
Helper function to set correctly the.
csArray< csString > goodWords
csArray< csString > chatTriggers
pawsChatHistory * chatHistory
Chat history.
pawsEditTextBox * inputText
Input box for quick access.
csString noCasePlayerName
Player name, with no upercase.
bool mainBrackets
If it's true brackets like [guild] [tell] will be put in main tab.