27#include <guichan/mouselistener.hpp>
28#include <guichan/widget.hpp>
45 return rect.isPointInRect(x, y);
73 public gcn::MouseListener
130 void addRows(std::string_view rows);
135 void addRow(std::string_view row);
146 void mouseMoved(gcn::MouseEvent &event)
override;
A simple browser box able to handle links and forward events to the parent conteiner.
void setOutlinedText(bool outline)
Sets whether the font will use a shadow for text.
void addRows(std::string_view rows)
Adds one or more text rows to the browser, separated by ' '.
void setEnableKeys(bool enable)
Enable or disable the replacement of keys.
void setHighlightMode(unsigned int mode)
Sets the Highlight mode for links.
void mouseMoved(gcn::MouseEvent &event) override
void setShadowedText(bool shadows)
Sets whether the font will use a shadow for text.
void updateHoveredLink(int x, int y)
void mouseExited(gcn::MouseEvent &event) override
void draw(gcn::Graphics *graphics) override
Draws the browser box.
unsigned int mHighlightMode
void setMaxRows(unsigned maxRows)
Sets the maximum numbers of rows in the browser box.
std::optional< BrowserLink > mHoveredLink
void setPalette(int palette)
void drawFrame(gcn::Graphics *) override
Overridden to avoid drawing the default frame.
void addRow(std::string_view row)
Adds a text row to the browser.
void layoutTextRow(TextRow &row, LayoutContext &context)
Layers out the given row of text starting at the given context position.
LinkHandler * mLinkHandler
void setLinkHandler(LinkHandler *handler)
Sets the handler for links.
void clearRows()
Remove all rows.
LinkHighlightMode
Highlight modes for links.
@ AUTO_WRAP
Maybe it needs a fix or to be redone.
void disableLinksAndUserColors()
Disable links & user defined colors to be used in chat input.
void setWrapIndent(int indent)
Sets the wrap indent for the browser box.
std::deque< TextRow > mTextRows
bool mUseLinksAndUserColors
void mousePressed(gcn::MouseEvent &event) override
Handles mouse actions.
void relayoutText()
Relayouts all text rows and returns the new height of the BrowserBox.
A simple interface to windows that need to handle links from BrowserBox widget.
Simple timer that can be used to check if a certain amount of time has passed.
gcn::Rectangle rect
Where link is placed.
bool contains(int x, int y) const
std::optional< gcn::Color > outlineColor
std::vector< LinePart > parts
std::vector< BrowserLink > links