BrowserBox Class Reference

#include <browserbox.h>

List of all members.


Detailed Description

A simple browser box able to handle links and forward events to the parent conteiner.

Definition at line 43 of file browserbox.h.


Public Types

enum  { AUTO_SIZE, AUTO_WRAP }
 BrowserBox modes. More...
enum  {
  RED = 0xff0000, GREEN = 0x009000, BLUE = 0x0000ff, ORANGE = 0xe0980e,
  YELLOW = 0xf1dc27, PINK = 0xff00d8, PURPLE = 0x8415e2, GRAY = 0x919191,
  BROWN = 0x8e4c17
}
 BrowserBox colors. More...
enum  { UNDERLINE = 1, BACKGROUND = 2 }
 Highlight modes for links. More...

Public Member Functions

 BrowserBox (unsigned int mode=AUTO_SIZE, bool opaque=true)
 Constructor.
 ~BrowserBox ()
 Destructor.
void setLinkHandler (LinkHandler *linkHandler)
 Sets the handler for links.
void setOpaque (bool opaque)
 Sets the BrowserBox opacity.
void setHighlightMode (unsigned int highMode)
 Sets the Highlight mode for links.
void setMaxRow (int max)
 Sets the maximum numbers of rows in the browser box.
void disableLinksAndUserColors ()
 Disable links & user defined colors to be used in chat input.
void addRow (const std::string &row)
 Adds a text row to the browser.
void clearRows ()
 Remove all rows.
void mousePressed (gcn::MouseEvent &event)
 Handles mouse actions.
void mouseMoved (gcn::MouseEvent &event)
void draw (gcn::Graphics *graphics)
 Draws the browser box.

Private Types

typedef std::list< std::string > TextRows
typedef TextRows::iterator TextRowIterator
typedef std::vector< BROWSER_LINKLinks
typedef Links::iterator LinkIterator

Private Attributes

TextRows mTextRows
Links mLinks
LinkHandlermLinkHandler
unsigned int mMode
unsigned int mHighMode
bool mOpaque
bool mUseLinksAndUserColors
int mSelectedLink
unsigned int mMaxRows

Member Typedef Documentation

typedef std::list<std::string> BrowserBox::TextRows [private]

Definition at line 142 of file browserbox.h.

typedef TextRows::iterator BrowserBox::TextRowIterator [private]

Definition at line 143 of file browserbox.h.

typedef std::vector<BROWSER_LINK> BrowserBox::Links [private]

Definition at line 146 of file browserbox.h.

typedef Links::iterator BrowserBox::LinkIterator [private]

Definition at line 147 of file browserbox.h.


Member Enumeration Documentation

anonymous enum

BrowserBox modes.

Enumerator:
AUTO_SIZE 
AUTO_WRAP  Maybe it needs a fix or to be redone.

Definition at line 105 of file browserbox.h.

anonymous enum

BrowserBox colors.

NOTES (by Javila):

  • color values is "0x" prefix followed by HTML color style.
  • we can add up to 10 different colors: [0..9].
  • not all colors will be fine with all backgrounds due transparent windows and widgets. So, I think it's better keep BrowserBox opaque (white background) by default.
Enumerator:
RED  Color 1.
GREEN  Color 2.
BLUE  Color 3.
ORANGE  Color 4.
YELLOW  Color 5.
PINK  Color 6.
PURPLE  Color 7.
GRAY  Color 8.
BROWN  Color 9.

Definition at line 120 of file browserbox.h.

anonymous enum

Highlight modes for links.

This can be used for a bitmask.

Enumerator:
UNDERLINE 
BACKGROUND 

Definition at line 136 of file browserbox.h.


Constructor & Destructor Documentation

BrowserBox::BrowserBox ( unsigned int  mode = AUTO_SIZE,
bool  opaque = true 
)

Constructor.

Definition at line 32 of file browserbox.cpp.

BrowserBox::~BrowserBox (  ) 

Destructor.

Definition at line 44 of file browserbox.cpp.


Member Function Documentation

void BrowserBox::setLinkHandler ( LinkHandler linkHandler  ) 

Sets the handler for links.

Definition at line 48 of file browserbox.cpp.

void BrowserBox::setOpaque ( bool  opaque  ) 

Sets the BrowserBox opacity.

Definition at line 53 of file browserbox.cpp.

void BrowserBox::setHighlightMode ( unsigned int  highMode  ) 

Sets the Highlight mode for links.

Definition at line 58 of file browserbox.cpp.

void BrowserBox::setMaxRow ( int  max  )  [inline]

Sets the maximum numbers of rows in the browser box.

0 = no limit.

Definition at line 74 of file browserbox.h.

void BrowserBox::disableLinksAndUserColors (  ) 

Disable links & user defined colors to be used in chat input.

Definition at line 63 of file browserbox.cpp.

void BrowserBox::addRow ( const std::string &  row  ) 

Adds a text row to the browser.

Definition at line 68 of file browserbox.cpp.

void BrowserBox::clearRows (  ) 

Remove all rows.

Definition at line 211 of file browserbox.cpp.

void BrowserBox::mousePressed ( gcn::MouseEvent &  event  ) 

Handles mouse actions.

Definition at line 230 of file browserbox.cpp.

void BrowserBox::mouseMoved ( gcn::MouseEvent &  event  ) 

Definition at line 241 of file browserbox.cpp.

void BrowserBox::draw ( gcn::Graphics *  graphics  ) 

Draws the browser box.

Definition at line 249 of file browserbox.cpp.


Member Data Documentation

Definition at line 144 of file browserbox.h.

Definition at line 148 of file browserbox.h.

Definition at line 150 of file browserbox.h.

unsigned int BrowserBox::mMode [private]

Definition at line 151 of file browserbox.h.

unsigned int BrowserBox::mHighMode [private]

Definition at line 152 of file browserbox.h.

bool BrowserBox::mOpaque [private]

Definition at line 153 of file browserbox.h.

Definition at line 154 of file browserbox.h.

Definition at line 155 of file browserbox.h.

unsigned int BrowserBox::mMaxRows [private]

Definition at line 156 of file browserbox.h.


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

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5