Rocket::Core::LayoutInlineBox Class Reference

#include <LayoutInlineBox.h>

Inheritance diagram for Rocket::Core::LayoutInlineBox:
Collaboration diagram for Rocket::Core::LayoutInlineBox:

Public Member Functions

 LayoutInlineBox (Element *element, const Box &box)
 LayoutInlineBox (LayoutInlineBox *chain)
void SetLine (LayoutLineBox *line)
void SetParent (LayoutInlineBox *parent)
void Close ()
 Closes the box.
virtual LayoutInlineBoxFlowContent (bool first_box, float available_width, float right_spacing_width)
virtual void CalculateBaseline (float &ascender, float &descender)
virtual void OffsetBaseline (float ascender)
virtual bool CanOverflow () const
bool IsLastChild () const
const Vector2fGetPosition () const
void SetHorizontalPosition (float position)
void SetVerticalPosition (float position)
virtual void PositionElement ()
 Positions the inline box's element.
virtual void SizeElement (bool split)
int GetVerticalAlignProperty () const
ElementGetElement ()
LayoutInlineBoxGetParent ()
const BoxGetBox () const
float GetHeight () const
float GetBaseline () const
void * operator new (size_t size)
void operator delete (void *chunk)

Protected Member Functions

FontFaceHandleGetParentFont () const
float GetParentLineHeight () const

Protected Attributes

Elementelement
Vector2f position
Box box
float width
float height
int vertical_align_property
float baseline
LayoutInlineBoxparent
LayoutLineBoxline
std::vector< LayoutInlineBox * > children
LayoutInlineBoxchain
bool chained

Friends

class LayoutInlineBoxText

Detailed Description

Author:
Peter Curry

Constructor & Destructor Documentation

Rocket::Core::LayoutInlineBox::LayoutInlineBox ( Element element,
const Box box 
)

Constructs a new inline box for an element.

Parameters:
element[in] The element this inline box is flowing.
box[in] The extents of the inline box's element.

Rocket::Core::LayoutInlineBox::LayoutInlineBox ( LayoutInlineBox chain  ) 

Constructs a new inline box for a split box.

Parameters:
chain[in] The box that has overflowed into us.


Member Function Documentation

void Rocket::Core::LayoutInlineBox::SetLine ( LayoutLineBox line  ) 

Sets the inline box's line.

Parameters:
line[in] The line this inline box resides in.

void Rocket::Core::LayoutInlineBox::SetParent ( LayoutInlineBox parent  ) 

Sets the inline box's parent.

Parameters:
parent[in] The parent this inline box resides in.

virtual LayoutInlineBox* Rocket::Core::LayoutInlineBox::FlowContent ( bool  first_box,
float  available_width,
float  right_spacing_width 
) [virtual]

Flows the inline box's content into its parent line.

Parameters:
[in] first_box True if this box is the first box containing content to be flowed into this line.
[in] available_width The width available for flowing this box's content. This is measured from the left side of this box's content area.
[in] right_spacing_width The width of the spacing that must be left on the right of the element if no overflow occurs. If overflow occurs, then the entire width can be used.
Returns:
The overflow box containing any content that spilled over from the flow. This must be NULL if no overflow occured.

Reimplemented in Rocket::Core::LayoutInlineBoxText.

void Rocket::Core::LayoutInlineBox::CalculateBaseline ( float &  ascender,
float &  descender 
) [virtual]

Computes and sets the vertical position of this element, relative to its parent inline box (or block box, for an un-nested inline box).

Parameters:
ascender[out] The maximum ascender of this inline box and all of its children.
descender[out] The maximum descender of this inline box and all of its children.

Reimplemented in Rocket::Core::LayoutInlineBoxText.

void Rocket::Core::LayoutInlineBox::OffsetBaseline ( float  ascender  )  [virtual]

Offsets the baseline of this box, and all of its children, by the ascender of the parent line box.

Parameters:
ascender[in] The ascender of the line box.

Reimplemented in Rocket::Core::LayoutInlineBoxText.

bool Rocket::Core::LayoutInlineBox::CanOverflow (  )  const [virtual]

Returns true if this box is capable of overflowing, or if it must be rendered on a single line.

Returns:
True if this box can overflow, false otherwise.

Reimplemented in Rocket::Core::LayoutInlineBoxText.

bool Rocket::Core::LayoutInlineBox::IsLastChild (  )  const

Returns true if this box's element is the last child of its parent.

Parameters:
True if this box is a last child.

const Vector2f & Rocket::Core::LayoutInlineBox::GetPosition (  )  const

Returns the inline box's offset from its line.

Returns:
The box's offset from its line.

void Rocket::Core::LayoutInlineBox::SetHorizontalPosition ( float  position  ) 

Sets the inline box's horizontal offset from its parent's content area.

Parameters:
position[in] The box's horizontal offset.

void Rocket::Core::LayoutInlineBox::SetVerticalPosition ( float  position  ) 

Sets the inline box's vertical offset from its parent's content area.

Parameters:
position[in] The box's vertical offset.

void Rocket::Core::LayoutInlineBox::SizeElement ( bool  split  )  [virtual]

Sizes the inline box's element.

Parameters:
split[in] True if this box is split, false otherwise.

Reimplemented in Rocket::Core::LayoutInlineBoxText.

int Rocket::Core::LayoutInlineBox::GetVerticalAlignProperty (  )  const

Returns the vertical align property of the box's element.

Returns:
the vertical align property, or -1 if it is set to a numerical value.

Element * Rocket::Core::LayoutInlineBox::GetElement (  ) 

Returns the inline box's element.

Returns:
The inline box's element.

LayoutInlineBox * Rocket::Core::LayoutInlineBox::GetParent (  ) 

Returns the inline box's parent.

Parameters:
The parent of this inline box. This will be NULL for a root-level inline box (ie, one that has a block element has a parent in the true hierarchy).

const Box & Rocket::Core::LayoutInlineBox::GetBox (  )  const

Returns the inline box's dimension box.

Returns:
The inline box's dimension box.

float Rocket::Core::LayoutInlineBox::GetHeight (  )  const

Returns the height of the inline box. This is separate from the the box, as different types of inline elements generate different line heights. The possible types are: replaced elements (or inline-block elements), which use their entire box (including margins) as their height non-replaced elements, which use the maximum line-height of their children text elements, which use their line-height

float Rocket::Core::LayoutInlineBox::GetBaseline (  )  const

Returns the baseline of the inline box.

Returns:
The box's baseline.

FontFaceHandle * Rocket::Core::LayoutInlineBox::GetParentFont (  )  const [protected]

Returns our parent box's font face handle.

Returns:
The font face handle of our parent box.

float Rocket::Core::LayoutInlineBox::GetParentLineHeight (  )  const [protected]

Returns our parent box's line height.

Returns:
The line height of our parent box.


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