Planeshift
pawsChatWindow Class Reference

Main Chat window for PlaneShift. More...

#include <chatwindow.h>

Public Member Functions

void AddAutoCompleteName (const char *name)
 
void AutoReply (void)
 
void BadWordsFilter (csString &s)
 Remove bad words from the output string. More...
 
void ChatOutput (const char *data, int colour=-1, int type=CHAT_SYSTEM, bool flashEnabled=true, bool hasCharName=false, int hotkeyChannel=0)
 Function that handles output of various tabbed windows. More...
 
void Clear (int mode=-2)
 Clear history. More...
 
csString GetBracket (int type)
 Generates a bracket like [tell] starting from the msgtype. More...
 
char const * GetFontName ()
 return the name of the font More...
 
pawsIgnoreWindowGetIgnoredList ()
 
pawsEditTextBoxgetInputTextBox ()
 
ChatSettingsGetSettings ()
 
const char * HandleCommand (const char *cmd)
 For the iCommandSubscriber interface. More...
 
void HandleMessage (MsgEntry *message)
 For the iNetSubsciber interface. More...
 
bool InputActive ()
 Check to see if the text input box is active. More...
 
void JoinChannel (csString name)
 Joins the channel and adds the hotkey when the server accepts the join. More...
 
bool LeaveChannel (int hotkeyChannel)
 Leaves the channel and removes the hotkey association. More...
 
void LoadChatSettings ()
 
bool LoadSetting ()
 load the settings stored by pawsConfigChatFont More...
 
int mixColours (int colour1, int colour2)
 mixes two colours and returns their mixed colour More...
 
virtual bool OnButtonPressed (int button, int keyModifier, pawsWidget *widget)
 Called whenever a button is pressed. More...
 
bool OnChildMouseEnter (pawsWidget *widget)
 Called when mouse enters a child widget. More...
 
bool OnChildMouseExit (pawsWidget *widget)
 Called when a mouse exits a child widget. More...
 
bool OnDoubleClick (int button, int modifiers, int x, int y)
 Handle double click events. More...
 
bool OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers)
 Process keydown messages. More...
 
virtual void OnLostFocus ()
 Sets hasFocus false and notifys parent. More...
 
bool OnMenuAction (pawsWidget *widget, const pawsMenuAction &action)
 Called whenever a menu action occurs. More...
 
bool OnMouseDown (int button, int modifiers, int x, int y)
 Manage mouse down event to test for and apply window changes. More...
 
 pawsChatWindow ()
 
void PerformAction (const char *action)
 Does an action based on this string. More...
 
bool PostSetup ()
 This is called after the widget and all of it's children have been created. More...
 
void RefreshCommandList ()
 
void ReloadChatWindow ()
 Reload Chat Window. More...
 
void RemoveAutoCompleteName (const char *name)
 
void SaveChatSettings ()
 
void SelectChatTab (int tab)
 
void SetAway (const char *text)
 Sets the away message. More...
 
void SetChatWindowFont (const char *FontName, int FontSize)
 change the font on only the windows that display the chat text More...
 
virtual void Show ()
 When the window is opened let the controller window know about it. More...
 
void SwitchChannel (const csString &name, pawsWidget *widget=NULL)
 
void writeChatHistory ()
 
virtual ~pawsChatWindow ()
 
- Public Member Functions inherited from pawsControlledWindow
virtual void Hide ()
 When the window is closed let the controller window know about it. More...
 
 pawsControlledWindow ()
 
virtual void Register ()
 Called to register new window with the controller window. More...
 
- Public Member Functions inherited from pawsWidget
void AddChild (pawsWidget *widget)
 Add a child widget to this widget. More...
 
void AddChild (size_t Index, pawsWidget *widget)
 Add a child widget to this widget at a specified position. More...
 
virtual void BringToTop (pawsWidget *widget)
 Move this widget up the z order to the top. More...
 
virtual double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
 
virtual void CenterTo (int x, int y)
 Move this widget so that its center is at given location. More...
 
virtual void CenterToMouse ()
 Move this widget so that its center is at mouse pointer, but it is fully on screen. More...
 
void ChangeFontSize (float newSize)
 Change font to new size and reload font to make it take effect. More...
 
virtual bool CheckButtonPressed (int button, int modifiers, pawsWidget *pressedWidget)
 Test button for activity. More...
 
virtual bool CheckButtonReleased (int button, int modifiers, pawsWidget *pressedWidget)
 Test button for activity. More...
 
virtual bool CheckKeyHandled (int)
 Allow pawsButton to simulate button pushes based on keypresses. More...
 
void ClearBackgroundColor ()
 
void ClearMaskingImage ()
 Clears the masking image. More...
 
csRect ClipRect ()
 This returns the current clipping rectangle. More...
 
void ClipToParent (bool allowForBackgroundBorder)
 Determines clipping area to use. More...
 
virtual void Close ()
 Simply calls Hide() unless overidden. More...
 
virtual bool Contains (int x, int y)
 Determines if the coordinates are within this widget. More...
 
virtual void CreateWidgetConfigWindow ()
 Creates a popup window that the user can use to adjust the settings of this window. More...
 
virtual void DeleteChild (pawsWidget *widget)
 Removes the widget from list of children and destructs it. More...
 
void DeleteYourself ()
 Removes and destructs itself. More...
 
virtual void DestroyWidgetConfigWindow ()
 Called by ApplyAlphaOnChildren to remove the config window to prevent weird stuff. More...
 
virtual void Draw ()
 Draws the widget and all of it's children. More...
 
virtual void Draw3D (iGraphics3D *)
 
virtual void DrawBackground ()
 Draws the background with a color or an image. More...
 
virtual void DrawChildren ()
 Draws all children marked visible. More...
 
void DrawForeground ()
 Does the second part of the drawing drawing the background of the window. More...
 
virtual void DrawMask ()
 Draws the mask picture. More...
 
virtual void DrawToolTip (int x, int y)
 This draws the tool tip if a widget is visible and a tool tip is available. More...
 
void DrawWidgetText (const char *text, int x, int y, int style=-1)
 Draw text in the widget at specified location. More...
 
bool DrawWindow ()
 Does the first part of the drawing. More...
 
virtual void Dump (csString tab="")
 Prints the widget names for the widget and all it's children. More...
 
const char * FindDefaultWidgetStyle (const char *factoryName)
 
pawsWidgetFindWidget (const char *name, bool complain=true)
 Find a child widget of this widget. More...
 
pawsWidgetFindWidget (int id, bool complain=true)
 Find a child widget of this widget. More...
 
pawsWidgetFindWidgetXMLBinding (const char *xmlbinding)
 Find a child widget of this widget with the given XML binding. More...
 
void FormatToolTip (const char *fmt,...)
 Changes the format of a tool tip. More...
 
int GetActualHeight (int myValue=-1)
 Returns the actual Height assuming the passed value was in 800x600 resolution. More...
 
int GetActualWidth (int myValue=-1)
 Returns the actual width assuming the passed value was in 800x600 resolution. More...
 
csString GetBackground ()
 Retrieve the background image name. More...
 
virtual pawsBorderGetBorder ()
 This returns the border created by UseBorder(). More...
 
virtual int GetBorderColour (int which)
 Get the color for this widgets border. More...
 
virtual int GetBorderStyle ()
 This returns the BORDER_BUMP style. More...
 
pawsWidgetGetChild (size_t i)
 Used if you need to loop through the children of a widget. More...
 
size_t GetChildrenCount ()
 Used if you need to loop through the children of a widget. More...
 
const char * GetCloseName ()
 Returns the closeName of this widget. More...
 
virtual csRect GetDefaultFrame ()
 Returns the default csRect. More...
 
iWidgetDataGetExtraData ()
 Grabs extra data stored in the widget. More...
 
float GetFadeSpeed ()
 Gets the fading speed. More...
 
int GetFadeVal ()
 Gets the fade value of this widget. More...
 
const char * GetFilename ()
 Returns the filename. More...
 
virtual bool GetFocusOverridesControls () const
 Test if the widget should intercept all key presses. More...
 
iFont * GetFont (bool scaled=true)
 Gets the current font as an iFont. More...
 
virtual int GetFontColour ()
 Gets the current font color. More...
 
int GetFontShadowColour ()
 Gets the current shadow color. More...
 
float GetFontSize ()
 Gets the current font size. More...
 
int GetFontStyle ()
 Gets the current font style. More...
 
int GetID ()
 Gets the id of a widget. More...
 
int GetLogicalHeight (int myValue)
 
int GetLogicalWidth (int myValue)
 
int GetMaxAlpha ()
 Gets the maximum alpha value of this widget. More...
 
int GetMinAlpha ()
 Gets the minimim alpha value of this widget. More...
 
void GetMinSize (int &width, int &height)
 
const char * GetName ()
 Get the name of this widget. More...
 
pawsWidgetGetParent ()
 Get this widget's parent. More...
 
csString GetPathInWidgetTree ()
 Returns textual description of path to our widget through the widget tree. More...
 
virtual double GetProperty (MathEnvironment *env, const char *ptr)
 
virtual csRect GetScreenFrame ()
 Returns the csRect that defines widget area. More...
 
csString & GetToolTip ()
 Gets the text from a tool tip. More...
 
const char * GetType ()
 Gets the current factory type. More...
 
csRect GetWidgetTextRect (const char *text, int x, int y, int style=-1)
 Get the rectangle containing the text DrawWidgetText will produce. More...
 
virtual const csString & GetXMLBinding ()
 Get the xml nodes of this widget. More...
 
virtual bool HasFocus ()
 Test focus of the widget. More...
 
virtual void Ignore (bool ig)
 
bool Includes (pawsWidget *widget)
 Returns true if widget equals this, or widget is a child of this. More...
 
bool IsAlwaysOnTop ()
 Tests value of this widgets alwaysOnTop flag. More...
 
bool IsChildOf (pawsWidget *someParent)
 Returns true, if this widget is the child of 'someParent'. More...
 
bool IsConfigurable ()
 Tests if widget settings (alpha, fade, etc) are configurable. More...
 
bool isFadeEnabled ()
 Gets the fade status of this widget. More...
 
bool IsIndirectChild (pawsWidget *widget)
 Returns true, if 'widget' is child of our widget, even if it is indirect. More...
 
bool IsResizable ()
 Test widget to see if it is resizable. More...
 
bool isScalingFont ()
 Returns whether or not font is being auto-scaled. More...
 
bool IsVisible ()
 Is the widget currently set visible? More...
 
virtual bool Load (iDocumentNode *node)
 Load a widget based on its <widget></widget> tag. More...
 
virtual bool LoadAttributes (iDocumentNode *node)
 Load standard widget attributes based on its <widget></widget> tag. More...
 
virtual bool LoadChildren (iDocumentNode *node)
 Load widget children based on subtags of its <widget></widget> tag. More...
 
virtual bool LoadEventScripts (iDocumentNode *node)
 Load event scripts for this widget. More...
 
bool LoadFromFile (const csString &fileName)
 Parses XML file 'fileName', finds first widget tag and Load()s itself from this tag. More...
 
virtual csRect LoadPositions ()
 Get the position of this widget that was stored in a cfg file. More...
 
virtual void LoadSettings ()
 Loads current widget settings from an XML file. More...
 
void MakeFullyVisible ()
 If some part of the widget is not within the rectangle of its parent, then the widget is moved inside (if it is small enough). More...
 
virtual void MouseOver (bool value)
 Sets hasMouseFocus. More...
 
virtual void MoveDelta (int dx, int dy)
 Move a widget by a delta amount. More...
 
virtual void MoveTo (int x, int y)
 Moves this widget and all of its children to a new screen location. More...
 
bool NeedsRender () const
 Whether we need to r2t. More...
 
virtual void NewSubscription (const char *dataname)
 
virtual bool OnButtonReleased (int button, int keyModifier, pawsWidget *widget)
 Called whenever a button is released. More...
 
virtual bool OnChange (pawsWidget *widget)
 Called whenever a widget is selected. More...
 
virtual bool OnClipboard (const csString &content)
 Process Clipboard content, as a response to RequestClipboardContent. More...
 
virtual bool OnGainFocus (bool=true)
 Changes hasFocus to TRUE and reports status to parent. More...
 
virtual bool OnJoypadDown (int key, int modifiers)
 Process joypadDown messages. More...
 
virtual void OnListAction (pawsListBox *selected, int status)
 Called whenever an item in a child list box is selected. More...
 
virtual bool OnMouseEnter ()
 Called whenever the mouse enters this widget. More...
 
virtual bool OnMouseExit ()
 Called whenever the mouse leaves this widget. More...
 
virtual bool OnMouseUp (int button, int modifiers, int x, int y)
 Manage mouse up event. More...
 
virtual void OnResize ()
 Sets the new position of the close button. More...
 
virtual bool OnScroll (int scrollDirection, pawsScrollBar *widget)
 Called whenever a window is scrolled. More...
 
virtual bool OnSelected (pawsWidget *widget)
 Called whenever a widget is selected. More...
 
virtual void OnUpdateData (const char *, PAWSData &)
 
virtual bool ParentDraw () const
 Whether to draw via the parent-child draw tree. More...
 
 pawsWidget ()
 
 pawsWidget (const pawsWidget &origin)
 
void RecalcScreenPositions ()
 This re-calculates a widget's on screen position to draw based on it's relative position and parent screen location. More...
 
void ReloadWidget ()
 Reloads widget from XML file. More...
 
void RemoveChild (pawsWidget *widget)
 Removes the widget from list of children but does NOT destruct it. More...
 
void RemoveTitle ()
 
virtual void ResetToDefaultFrame ()
 Resets the position, width and height to the default position. More...
 
virtual void Resize (int flags)
 Resize a widget based on the current mouse position. More...
 
virtual void Resize (int dx, int dy, int flags)
 Resize a widget by a delta amount. More...
 
virtual void Resize ()
 Resize a widget based on it's parent's size. More...
 
void RunScriptEvent (PAWS_WIDGET_SCRIPT_EVENTS event)
 Executes any pawsScript associated with the given event. More...
 
virtual void SavePosition ()
 Saves the position of this widget to the config file. More...
 
virtual void SaveSettings ()
 Saves current widget settings to an XML file. More...
 
virtual bool SelfPopulate (iDocumentNode *node)
 This function allows a widget to fill in its own contents from an xml node supplied and calls the same function for all children. More...
 
virtual bool SelfPopulateXML (const char *xmlstr)
 This function parses the xml string and calls SelfPopulate with the resulting DOM structure if valid. More...
 
virtual void SendToBottom (pawsWidget *widget)
 Move this widget down the z order to the bottom. More...
 
void SetAlwaysOnTop (bool value)
 Sets value of this widgets alwaysOnTop flag. More...
 
virtual void SetAttachFlags (int flags)
 Modify attachFlags to control widget construction. More...
 
virtual void SetBackground (const char *imageName)
 Sets the background image, logs error if NULL. More...
 
virtual void SetBackgroundAlpha (int alphaValue)
 Sets the alpha level of the background. More...
 
void SetBackgroundColor (int r, int g, int b)
 Sets the background color. More...
 
void SetColour (int newColour=-2)
 Set text color. More...
 
void SetContextMenu (const csString &fileName)
 Sets name of the PAWS xml-file that describes context menu of our widget. More...
 
void SetDefaultToolTip ()
 Sets the tool tip to the one defined in the XML. More...
 
void SetExtraData (iWidgetData *data)
 Stores extra data into this widget. More...
 
void SetFactory (const char *myfactory)
 Sets the type of factory. More...
 
void SetFade (bool value)
 Used to control the fading feature of the widget. More...
 
void SetFadeSpeed (float speed)
 Sets the fading speed. More...
 
void SetFilename (const char *name)
 Changes filename to the name provided. More...
 
void SetFont (const char *fontName, int Size=0)
 Set font to use programmatically. More...
 
void SetFontScaling (bool value)
 Used to control the font scaling of the widget. More...
 
void SetFontStyle (int style)
 Sets the current font style. More...
 
virtual void SetForceSize (int newWidth, int newHeight)
 Same as above, but does not resize children. More...
 
void SetID (int newID)
 Change the id of a widget. More...
 
void SetMaskingImage (const char *image)
 Sets a masking image which will be drawn after the normal stuff. More...
 
void SetMaxAlpha (int value)
 Sets the maximum alpha of this widget. More...
 
void SetMaxSize (int width, int height)
 Set the max size for height and width. More...
 
void SetMinAlpha (int value)
 Sets the minimim alpha of this widget. More...
 
void SetMinSize (int width, int height)
 Set the minimum height and width to protect the widget from negatives. More...
 
void SetModalState (bool isModal)
 Registers mode with the windowManager. More...
 
void SetMovable (bool value)
 Makes a widget movable. More...
 
void SetName (const char *newName)
 Set the name of this widget. More...
 
void SetNeedsRender (bool needs)
 Marks that we need to r2t. More...
 
void SetParent (pawsWidget *widget)
 Set the owner of this widget. More...
 
virtual void SetProperty (const char *ptr, double value)
 
virtual void SetRelativeFrame (int x, int y, int width, int height)
 Set the size of this widget and it's position relative to the parent. More...
 
virtual void SetRelativeFramePos (int x, int y)
 Set the position of this widget relative to the parent. More...
 
virtual void SetRelativeFrameSize (int width, int height)
 Sets defaultFrame and screenFrame size attributes. More...
 
void SetResizeShow (bool v)
 Sets the showResize flag, controlling if the resize widget should be drawn. More...
 
virtual void SetSize (int newWidth, int newHeight)
 Set the size of a particlar widget. More...
 
void SetTitle (const char *title)
 Sets the border title of this widget. More...
 
bool SetTitle (const char *text, const char *image, const char *align, const char *close_button, const bool shadowTitle=true)
 Sets up the title bar for the widget. More...
 
void SetToolTip (const char *text)
 Changes the text for a tool tip. More...
 
virtual bool Setup (iDocumentNode *)
 Setup this widget. More...
 
void SetVisibility (bool visible)
 Make the widget visible or hides it. More...
 
virtual void SetXMLBinding (csString &xmlbinding)
 Sets the xml nodes of this widget. More...
 
virtual void ShowBehind ()
 Makes widget visible and brings it to the front but behind widget with current focus. More...
 
virtual void StopResize ()
 Called once the mouse up is done after resizing a widget. More...
 
const char * ToString ()
 
virtual void UseBorder (const char *style=0)
 Creates a new border and links it to the widget. More...
 
virtual pawsWidgetWidgetAt (int x, int y)
 Locate a widget that is at these screen coordindates. More...
 
virtual ~pawsWidget ()
 
- Public Member Functions inherited from iPAWSSubscriber
virtual ~iPAWSSubscriber ()
 
- Public Member Functions inherited from iScriptableVar
virtual ~iScriptableVar ()
 
- Public Member Functions inherited from psCmdBase
virtual void HandleMessage (MsgEntry *msg, Client *)
 Interprets a received message and executes the command. More...
 
 psCmdBase (ClientMsgHandler *mh, CmdHandler *ch, iObjectRegistry *obj)
 
void Report (int severity, const char *msgtype, const char *description,...)
 
virtual bool Setup (ClientMsgHandler *mh, CmdHandler *ch)
 
virtual bool Verify (MsgEntry *, unsigned int, Client *&)
 
virtual ~psCmdBase ()
 

Protected Member Functions

void CreateSettingNode (iDocumentNode *mNode, int color, const char *name)
 
void DetermineChatTabAndSelect (int chattype)
 
void FormatMessage (csString &sText, csString &sPerson, csString prependingText, csString &buff, bool &hasCharName)
 Takes as input a message and formats it with colours, /me and /my support. More...
 
void HandleSystemMessage (MsgEntry *message)
 
void LogMessage (const char *message, int type=CHAT_SAY)
 Logs a message coming from the chat. More...
 
void ReplayMessages (unsigned int reqLines)
 Replay recent message history on load. More...
 
void SendChatLine (csString &inputText)
 Sends the contents of the input text to the server. More...
 
void SubscribeCommands ()
 Subscribe the player commands. More...
 
void TabCompleteCommand (const char *cmd)
 Tab completion. More...
 
void TabCompleteName (const char *cmd)
 
- Protected Member Functions inherited from pawsWidget
int CalcChildPosition (pawsWidget *child)
 Calculates the right position in array of children for a given child (depends on always-on-top state). More...
 
bool CreateContextMenu ()
 Creates context menu from file ('contextMenuFile' attribute) More...
 
int GetAttachFlag (const char *flag)
 Convert from string flag to int flag. More...
 
void LoadBorderColours (iDocumentNode *node)
 Loads custom border color preferences. More...
 
bool ReadDefaultWidgetStyles (iDocumentNode *node)
 
int ResizeFlags (int mouseX, int mouseY)
 This will check to see if the mouse is over the resize hot spot. More...
 
void SetCloseButtonPos ()
 Gets button from widget and sets it's location. More...
 

Protected Attributes

csArray< csArray< csString > * > autoCompleteLists
 Contains pointers to all the autocompletion lists (excluding command lists) More...
 
csArray< csString > autoCompleteNames
 list of names to auto-complete More...
 
csString awayText
 
csHashReversible< uint32_t, csString > channelIDs
 Subscribed channel name to server channel ID reversible mapping. More...
 
csArray< uint16_t > channels
 Hotkeys for server channel IDs. More...
 
pawsChatHistorychatHistory
 Chat history. More...
 
csArray< csString > chatTriggers
 
csRedBlackTree< psStringcommandList
 list of last commands More...
 
csString currLine
 Current line, stored for when scrolling back in the chat history. More...
 
bool havePlayerName
 Decides if we have a player name. More...
 
pawsIgnoreWindowIgnoredList
 
pawsEditTextBoxinputText
 Input box for quick access. More...
 
bool isInChannel
 Is already in default channel? More...
 
csRef< iFile > logFile [CHAT_END]
 Stores the references to the actually used files for each chat type. More...
 
csString noCasePlayerForename
 
csString noCasePlayerName
 Player name, with no upercase. More...
 
csHash< csRef< iFile >, uint > openLogFiles
 Stores a reference to all opened log files for easy search. More...
 
int replyCount
 
csString replyList [4]
 
ChatSettings settings
 Stores the settings for the chat. More...
 
csArray< csString > systemTriggers
 
pawsTabWindowtabs
 
- Protected Attributes inherited from pawsWidget
int alpha
 The original background alpha. More...
 
int alphaMin
 The minimum background alpha. More...
 
bool alwaysOnTop
 Is this windows painted on top of other windows. More...
 
int attachFlags
 The attachpoints for when a resize takes place. More...
 
int bgColour
 Stores the bgColour for this widget. More...
 
csRef< iPawsImagebgImage
 Background image. More...
 
pawsBorderborder
 border created by GetBorder(). More...
 
int borderColours [5]
 Custom border colors for this window. More...
 
bool borderTitleShadow
 whether the title in the border should be shadow font More...
 
csArray< pawsWidget * > children
 The child widgets. More...
 
csRect clipRect
 Current clipping rectangle. More...
 
pawsButtonclose_widget
 Used in SetTitle() for the new close button. More...
 
csString closeName
 Old name of the widget with "_close" appended by SetName(). More...
 
bool configurable
 Determines if the settings (alpha, fade, etc) of this widget are configurable. More...
 
pawsMenucontextMenu
 Existing context menu of the widget. More...
 
csString contextMenuFile
 Path to the file that describes context menu of our widget (invoked by mouse right-click). More...
 
int defaultFontColour
 Optional color to use when drawing text with this widget. More...
 
int defaultFontShadowColour
 Optional color to use when doing text dropshadows. More...
 
float defaultFontSize
 Default font size. More...
 
csRect defaultFrame
 The default frame for the widget. More...
 
csString defaultToolTip
 Default tool tip string for the widget. More...
 
csHash< csString, csString > defaultWidgetStyles
 
iWidgetDataextraData
 Holds any extra data the widget may need. More...
 
csString factory
 factory name More...
 
bool fade
 Set to false to disable fading. More...
 
float fadeSpeed
 The speed of the fading process. More...
 
float fadeVal
 The direction and percentage of current fade in progress. More...
 
csString filename
 filename to load from or save to. More...
 
csString fontName
 Name of currently selected font. More...
 
float fontSize
 Current font size. More...
 
int fontStyle
 Current font style. More...
 
csRef< iGraphics2D > graphics2D
 The 2D graphics interface. More...
 
bool hasBorderColours
 Flag to indicate using custom border colors. More...
 
bool hasFocus
 Flag for widget focus. More...
 
bool hasMouseFocus
 Flag for mouse over behavior. More...
 
int id
 The id of the widget. More...
 
bool ignore
 Flag determines if WidgetAT() ignores this widget. More...
 
bool isResizable
 Determines if this widget can be resized by user. More...
 
bool keepaspect
 Enforce keeping the default aspect ratio when resizing. More...
 
int margin
 Stores margin value. Used in LoadAttributes(). More...
 
csRef< iPawsImagemaskImage
 Masking image, used for nice-looking stuff. More...
 
int max_height
 Defines the maximum height that the widget can be. More...
 
int max_width
 Defines the maximum width that the widget can be. More...
 
int min_height
 Defines the minimum height that the widget can be. More...
 
int min_width
 Defines the minimum width that the widget can be. More...
 
bool movable
 Determines if this widget is movable. More...
 
csRef< iFont > myFont
 Optional font to use when drawing this widget. More...
 
csString name
 The name of this widget. More...
 
bool needsRender
 Whether we need to do a r2t update. More...
 
pawsWidgetonEnter
 Widget to call if enter is pressed. More...
 
bool overwrite_subscription
 Flag of whether OnUpdateData should overwrite the previous value or add to it. More...
 
pawsWidgetparent
 This widget's parent. More...
 
bool parentDraw
 Whether to draw this widget (different from visible, used to decide if Draw() is called via parent-child tree). More...
 
bool resizeToScreen
 Determines if this widget should be auto resized with screen resolution. More...
 
bool saveWidgetPositions
 Determines if this widget should write/load it's position from a config file. More...
 
bool scaleFont
 Determines whether or not to scale font when a widget it resized. More...
 
csRect screenFrame
 The screen area of the widget. More...
 
pawsScriptscriptEvents [PW_SCRIPT_EVENT_COUNT]
 
bool showOnMouseOver
 Stores status of showOnMouseOver. More...
 
csString showOnMouseOver_image
 Stores the bgimage name if showOnMouseOver is true. More...
 
bool showResize
 If the resize widget should be drawn. More...
 
csString subscribedVar
 The variable that this widget is subscribed to. More...
 
csString subscription_format
 
csArray< pawsWidget * > taborder
 Contains the children for tabbing. More...
 
pawsTitletitleBar
 reference to titleBar object, if any More...
 
csString toolTip
 Tooltip to be displayed. More...
 
bool visible
 Flag to determine visiblity. More...
 
csString xmlbinding
 Used in the SelfPopulate functions to map to xml nodes for each widget. More...
 
- Protected Attributes inherited from psCmdBase
CmdHandlercmdsource
 
ClientMsgHandlermsgqueue
 
iObjectRegistry * objreg
 

Additional Inherited Members

- Public Attributes inherited from pawsWidget
csArray< csString > publishList
 

Detailed Description

Main Chat window for PlaneShift.

This class will handle most of the communication that goes on between players and system messages from the server. This class also tracks the ignore list on the client.

Definition at line 133 of file chatwindow.h.

Constructor & Destructor Documentation

pawsChatWindow::pawsChatWindow ( )
virtual pawsChatWindow::~pawsChatWindow ( )
virtual

Member Function Documentation

void pawsChatWindow::AddAutoCompleteName ( const char *  name)
void pawsChatWindow::AutoReply ( void  )
void pawsChatWindow::BadWordsFilter ( csString &  s)

Remove bad words from the output string.

void pawsChatWindow::ChatOutput ( const char *  data,
int  colour = -1,
int  type = CHAT_SYSTEM,
bool  flashEnabled = true,
bool  hasCharName = false,
int  hotkeyChannel = 0 
)

Function that handles output of various tabbed windows.

void pawsChatWindow::Clear ( int  mode = -2)

Clear history.

void pawsChatWindow::CreateSettingNode ( iDocumentNode *  mNode,
int  color,
const char *  name 
)
protected
void pawsChatWindow::DetermineChatTabAndSelect ( int  chattype)
protected
void pawsChatWindow::FormatMessage ( csString &  sText,
csString &  sPerson,
csString  prependingText,
csString &  buff,
bool &  hasCharName 
)
protected

Takes as input a message and formats it with colours, /me and /my support.

Parameters
sTextThe message main text.
sPersonThe message sender.
prependingTextthe text which will be prepended before the message. This will get translated.
buffwhere the formatted message will be stored.
hasCharNameTells if the player character name is inside the message.
csString pawsChatWindow::GetBracket ( int  type)

Generates a bracket like [tell] starting from the msgtype.

char const* pawsChatWindow::GetFontName ( )
inline

return the name of the font

Definition at line 232 of file chatwindow.h.

pawsIgnoreWindow* pawsChatWindow::GetIgnoredList ( )
inline

Definition at line 206 of file chatwindow.h.

pawsEditTextBox* pawsChatWindow::getInputTextBox ( )
inline

Definition at line 222 of file chatwindow.h.

ChatSettings& pawsChatWindow::GetSettings ( )
inline

Definition at line 199 of file chatwindow.h.

const char* pawsChatWindow::HandleCommand ( const char *  cmd)
virtual

For the iCommandSubscriber interface.

Implements psCmdBase.

void pawsChatWindow::HandleMessage ( MsgEntry message)
virtual

For the iNetSubsciber interface.

Implements psCmdBase.

void pawsChatWindow::HandleSystemMessage ( MsgEntry message)
protected
bool pawsChatWindow::InputActive ( )

Check to see if the text input box is active.

Returns
true if the text box is active.
void pawsChatWindow::JoinChannel ( csString  name)

Joins the channel and adds the hotkey when the server accepts the join.

bool pawsChatWindow::LeaveChannel ( int  hotkeyChannel)

Leaves the channel and removes the hotkey association.

void pawsChatWindow::LoadChatSettings ( )
bool pawsChatWindow::LoadSetting ( )

load the settings stored by pawsConfigChatFont

void pawsChatWindow::LogMessage ( const char *  message,
int  type = CHAT_SAY 
)
protected

Logs a message coming from the chat.

It handles the book keeping of the log files, opens and closes them on need, Formats the log files by adding headings when opening a new one and adds brackets to them.

Parameters
messageThe message to log.
typeThe chat type of this message to log.
int pawsChatWindow::mixColours ( int  colour1,
int  colour2 
)

mixes two colours and returns their mixed colour

virtual bool pawsChatWindow::OnButtonPressed ( int  button,
int  keyModifier,
pawsWidget widget 
)
virtual

Called whenever a button is pressed.

Parameters
buttonThe button pressed.
keyModifierModifier key in effect.
widgetThe widget the button belongs to.
Returns
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

bool pawsChatWindow::OnChildMouseEnter ( pawsWidget child)
virtual

Called when mouse enters a child widget.

If child wants to inform parent.

Parameters
childThe child widget.
Returns
true

Reimplemented from pawsWidget.

bool pawsChatWindow::OnChildMouseExit ( pawsWidget child)
virtual

Called when a mouse exits a child widget.

If child wants to inform parent.

Parameters
childThe child widget.
Returns
bool Parent's result or TRUE if no parent.

Reimplemented from pawsWidget.

bool pawsChatWindow::OnDoubleClick ( int  button,
int  modifiers,
int  x,
int  y 
)
inlinevirtual

Handle double click events.

We handle double mouse click like mouse down events. As we don't need to handle them particularly and we don't want to pass events to the widgets.

Parameters
buttonThe button being pressed.
modifiersThe modifiers being actually held.
xThe x position of the mouse.
yThe y position of the mouse.

Reimplemented from pawsWidget.

Definition at line 165 of file chatwindow.h.

bool pawsChatWindow::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
)
virtual

Process keydown messages.

Parameters
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns
bool TRUE for success FALSE if no action.
Remarks
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsWidget.

virtual void pawsChatWindow::OnLostFocus ( )
virtual

Sets hasFocus false and notifys parent.

Reimplemented from pawsWidget.

bool pawsChatWindow::OnMenuAction ( pawsWidget widget,
const pawsMenuAction action 
)
virtual

Called whenever a menu action occurs.

Parameters
widgetThe widget acted upon.
actionThe action to take.
Returns
TRUE on menu destroy and FALSE on configure

Reimplemented from pawsWidget.

bool pawsChatWindow::OnMouseDown ( int  button,
int  modifiers,
int  x,
int  y 
)
virtual

Manage mouse down event to test for and apply window changes.

Parameters
buttonType of button: 1 resizable or movable, 2 context menu or config window.
modifiersUsed with PAWS_CONSTRUCTION.
xUsed to test for resize.
yUsed to test for resize.
Returns
bool TRUE if movable or resizable.
Remarks
calls OnMouseDown on it's parent.

Reimplemented from pawsWidget.

void pawsChatWindow::PerformAction ( const char *  action)
virtual

Does an action based on this string.

Parameters
actionThe action to perform.

Reimplemented from pawsWidget.

bool pawsChatWindow::PostSetup ( )
virtual

This is called after the widget and all of it's children have been created.

Remarks
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

void pawsChatWindow::RefreshCommandList ( )
void pawsChatWindow::ReloadChatWindow ( )

Reload Chat Window.

void pawsChatWindow::RemoveAutoCompleteName ( const char *  name)
void pawsChatWindow::ReplayMessages ( unsigned int  reqLines)
protected

Replay recent message history on load.

Parameters
reqLinesThe amount of lines to load from the log starting from the bottom.
void pawsChatWindow::SaveChatSettings ( )
void pawsChatWindow::SelectChatTab ( int  tab)
void pawsChatWindow::SendChatLine ( csString &  inputText)
protected

Sends the contents of the input text to the server.

void pawsChatWindow::SetAway ( const char *  text)

Sets the away message.

void pawsChatWindow::SetChatWindowFont ( const char *  FontName,
int  FontSize 
)

change the font on only the windows that display the chat text

virtual void pawsChatWindow::Show ( void  )
virtual

When the window is opened let the controller window know about it.

Reimplemented from pawsControlledWindow.

void pawsChatWindow::SubscribeCommands ( )
protected

Subscribe the player commands.

void pawsChatWindow::SwitchChannel ( const csString &  name,
pawsWidget widget = NULL 
)
void pawsChatWindow::TabCompleteCommand ( const char *  cmd)
protected

Tab completion.

void pawsChatWindow::TabCompleteName ( const char *  cmd)
protected
void pawsChatWindow::writeChatHistory ( )

Member Data Documentation

csArray<csArray<csString> *> pawsChatWindow::autoCompleteLists
protected

Contains pointers to all the autocompletion lists (excluding command lists)

Definition at line 284 of file chatwindow.h.

csArray<csString> pawsChatWindow::autoCompleteNames
protected

list of names to auto-complete

Definition at line 282 of file chatwindow.h.

csString pawsChatWindow::awayText
protected

Definition at line 279 of file chatwindow.h.

csHashReversible<uint32_t, csString> pawsChatWindow::channelIDs
protected

Subscribed channel name to server channel ID reversible mapping.

Definition at line 336 of file chatwindow.h.

csArray<uint16_t> pawsChatWindow::channels
protected

Hotkeys for server channel IDs.

Definition at line 338 of file chatwindow.h.

pawsChatHistory* pawsChatWindow::chatHistory
protected

Chat history.

Definition at line 304 of file chatwindow.h.

csArray<csString> pawsChatWindow::chatTriggers
protected

Definition at line 289 of file chatwindow.h.

csRedBlackTree<psString> pawsChatWindow::commandList
protected

list of last commands

Definition at line 287 of file chatwindow.h.

csString pawsChatWindow::currLine
protected

Current line, stored for when scrolling back in the chat history.

Definition at line 307 of file chatwindow.h.

bool pawsChatWindow::havePlayerName
protected

Decides if we have a player name.

Definition at line 297 of file chatwindow.h.

pawsIgnoreWindow* pawsChatWindow::IgnoredList
protected

Definition at line 275 of file chatwindow.h.

pawsEditTextBox* pawsChatWindow::inputText
protected

Input box for quick access.

Definition at line 292 of file chatwindow.h.

bool pawsChatWindow::isInChannel
protected

Is already in default channel?

Definition at line 318 of file chatwindow.h.

csRef<iFile> pawsChatWindow::logFile[CHAT_END]
protected

Stores the references to the actually used files for each chat type.

Definition at line 313 of file chatwindow.h.

csString pawsChatWindow::noCasePlayerForename
protected

Definition at line 301 of file chatwindow.h.

csString pawsChatWindow::noCasePlayerName
protected

Player name, with no upercase.

Definition at line 300 of file chatwindow.h.

csHash<csRef<iFile>, uint> pawsChatWindow::openLogFiles
protected

Stores a reference to all opened log files for easy search.

Definition at line 315 of file chatwindow.h.

int pawsChatWindow::replyCount
protected

Definition at line 277 of file chatwindow.h.

csString pawsChatWindow::replyList[4]
protected

Definition at line 276 of file chatwindow.h.

ChatSettings pawsChatWindow::settings
protected

Stores the settings for the chat.

Definition at line 310 of file chatwindow.h.

csArray<csString> pawsChatWindow::systemTriggers
protected

Definition at line 288 of file chatwindow.h.

pawsTabWindow* pawsChatWindow::tabs
protected

Definition at line 294 of file chatwindow.h.


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