Faith::Layout Class Reference

#include <faith/layout.h>

Inheritance diagram for Faith::Layout:

Faith::BoxLayout Faith::GridLayout Faith::HBoxLayout Faith::VBoxLayout List of all members.

Public Member Functions

 Layout (Faith::Widget *widget, int margin=0, int spacing=-1)
virtual ~Layout ()
Faith::Widgetwidget ()
const Faith::Widgetwidget () const
int spacing () const
int margin () const
Faith::Rect geometry () const
Faith::Size size () const

Protected Member Functions

virtual void layout ()=0
void invalidate ()
virtual void childAdded (Faith::Widget *w)=0
virtual void childRemoved (Faith::Widget *w)=0
virtual Faith::Size minimumSize () const =0
virtual Faith::Size maximumSize () const =0
Faith::Size sizeHint () const
void resizeChild (LayoutItem *child, const Faith::Rect &rect)

Classes

class  LayoutItem
class  LayoutLayoutItem
class  LayoutWidgetItem

Detailed Description

An abstract class to represent anything that can layout child widgets


Constructor & Destructor Documentation

Faith::Layout::Layout ( Faith::Widget widget,
int  margin = 0,
int  spacing = -1 
)

virtual Faith::Layout::~Layout (  )  [virtual]


Member Function Documentation

virtual void Faith::Layout::childAdded ( Faith::Widget w  )  [protected, pure virtual]

every time a child widget is added to the widget, this is called

If you inherit from Layout, you must call this implementation if the child was indeed added

Implemented in Faith::BoxLayout, and Faith::GridLayout.

virtual void Faith::Layout::childRemoved ( Faith::Widget w  )  [protected, pure virtual]

every time a child widget is added to the widget, this is called

If you inherit from Layout, you must call this implementation if the child was indeed added

Implemented in Faith::BoxLayout, and Faith::GridLayout.

Faith::Rect Faith::Layout::geometry (  )  const [inline]

Returns:
the rectangle this layout is using in its widget

void Faith::Layout::invalidate (  )  [protected]

virtual void Faith::Layout::layout (  )  [protected, pure virtual]

this function is called when the child widgets need to be layed out again

Implemented in Faith::BoxLayout, and Faith::GridLayout.

int Faith::Layout::margin (  )  const

Returns:
the number of pixels on the edge of the widget. (spacing is not used here)

virtual Faith::Size Faith::Layout::maximumSize (  )  const [protected, pure virtual]

Implemented in Faith::BoxLayout, and Faith::GridLayout.

virtual Faith::Size Faith::Layout::minimumSize (  )  const [protected, pure virtual]

Implemented in Faith::BoxLayout, and Faith::GridLayout.

void Faith::Layout::resizeChild ( LayoutItem child,
const Faith::Rect rect 
) [protected]

implementations of this class should use this function to lay out children

this takes into account the geometry() of this layout

Faith::Size Faith::Layout::size (  )  const [inline]

Returns:
the rectangle this layout is using in its widget

Faith::Size Faith::Layout::sizeHint (  )  const [protected]

int Faith::Layout::spacing (  )  const

Returns:
the number of pixels in between each child widget

const Faith::Widget* Faith::Layout::widget (  )  const [inline]

Faith::Widget* Faith::Layout::widget (  )  [inline]


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 00:23:09 2006 for Faith by  doxygen 1.4.7