Class ComponentInterface

Description

  1. Components
are the basic units that can be displayed on the screen. The main method
  1. render()
which renders the component on the screen.

  • version: $Id: Component.interface.php,v 1.14 2007/09/04 20:25:21 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/GUIManager/Component.interface.php (line 139)


	
			
Direct descendents
Class Description
Component This is a generic implementation of the Component interface that allows the user to output an arbitrary string (content).
MenuItemInterface
  1. MenuItem
is an extension of
  1. Component
;
  1. MenuItems
have display names and the ability to be added to
  1. Menu
objects.
ContainerInterface The
  1. Container
interface is an extension of the
  1. Component
interface;
  1. Containers
are capable of storing multiple sub-
  1. Components
and when rendering Containers, all sub-
  1. Components
will be rendered as well.
Method Summary
ref addStyle (ref $styleCollection)
integer getIndex ()
string getPostHTML (ref $theme, [string $tabs = ""])
string getPreHTML (ref $theme, [string $tabs = ""])
ref getStyle (string $selector)
array getStyles ()
integer getType ()
ref removeStyle (string $selector)
void render (ref $theme, [string $tabs = ""])
void setPostHTML (string $html)
void setPreHTML (string $html)
Methods
addStyle (line 153)

Adds a new

  1. StyleCollection
to this component. The component

can have 0 or more style collections attached; each of the latter will affect the appearance of the component. The uniqueness of the collections is enforce by their selector (i.e., you can't have two collections with the same selector). If a style collection has been registered with the Theme for this Component's type and level, then the new style collection

  • return: object The style collection that was just added.
  • access: public
ref addStyle (ref $styleCollection)
  • ref $styleCollection: object styleCollection The
    1. StyleCollection
    to add to this component.

Redefined in descendants as:
getIndex (line 198)

Returns the index of this component. The index has no semantic meaning:

you can think of the index as 'level' of the component. Alternatively, the index could serve as means of distinguishing between components with the same type. Most often one would use the index in conjunction with the

  1. getStylesForComponentType()
and
  1. addStyleForComponentType()
Theme methods.

  • return: The index of the component.
  • access: public
integer getIndex ()

Redefined in descendants as:
getPostHTML (line 241)

Returns any post HTML code that needs to be printed. This method should be called at the end of

  1. render()
.

  • return: The HTML string.
  • access: public
string getPostHTML (ref $theme, [string $tabs = ""])
  • ref $theme: object theme The Theme object to use in producing the result of this method.
  • string $tabs: tabs This is a string (normally a bunch of tabs) that will be prepended to each text line. This argument is optional but its usage is highly recommended in order to produce a nicely formatted HTML output.

Redefined in descendants as:
  • Component::getPostHTML() : Returns any post HTML code that needs to be printed. This method should be called at the end of
    1. render()
    .
getPreHTML (line 213)

Returns any pre HTML code that needs to be printed. This method should be called at the beginnig of

  1. render()
.

  • return: The HTML string.
  • access: public
string getPreHTML (ref $theme, [string $tabs = ""])
  • ref $theme: object theme The Theme object to use in producing the result of this method.
  • string $tabs: tabs This is a string (normally a bunch of tabs) that will be prepended to each text line. This argument is optional but its usage is highly recommended in order to produce a nicely formatted HTML output.

Redefined in descendants as:
  • Component::getPreHTML() : Returns any pre HTML code that needs to be printed. This method should be called at the beginnig of
    1. render()
    .
getStyle (line 163)

Returns the style collection with the specified selector.

  • return: object The style collection.
  • access: public
ref getStyle (string $selector)
  • string $selector: selector The selector.

Redefined in descendants as:
getStyles (line 184)

Returns all style collections for this component.

  • return: An array of style collections; the key corresponds to the selector of each collection.
  • access: public
array getStyles ()

Redefined in descendants as:
getType (line 277)

Returns the type of this component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.

  • return: The type of this component.
  • access: public
integer getType ()

Redefined in descendants as:
removeStyle (line 174)

Remove the given StyleCollection from this Component.

  • return: object The style collection that was removed.
    1. NULL
    if it could not be found.
  • access: public
ref removeStyle (string $selector)
  • string $selector: selector The selector of the style collection to remove.

Redefined in descendants as:
render (line 267)

Renders the component on the screen.

  • access: public
void render (ref $theme, [string $tabs = ""])
  • ref $theme: object theme The Theme object to use in producing the result of this method.
  • string $tabs: tabs This is a string (normally a bunch of tabs) that will be prepended to each text line. This argument is optional but its usage is highly recommended in order to produce a nicely formatted HTML output.

Redefined in descendants as:
setPostHTML (line 254)

Set post HTML code that needs to surround this compontent. This is used to properly nest form-tags around tables/divs to generate valid XHTML.

  • since: 7/15/05
  • access: public
void setPostHTML (string $html)
  • string $html

Redefined in descendants as:
  • Component::setPostHTML() : Set post HTML code that needs to surround this compontent. This is used to properly nest form-tags around tables/divs to generate valid XHTML.
setPreHTML (line 226)

Set pre HTML code that needs to surround this compontent. This is used to properly nest form-tags around tables/divs to generate valid XHTML.

  • since: 7/15/05
  • access: public
void setPreHTML (string $html)
  • string $html

Redefined in descendants as:
  • Component::setPreHTML() : Set pre HTML code that needs to surround this compontent. This is used to properly nest form-tags around tables/divs to generate valid XHTML.

Documentation generated on Wed, 19 Sep 2007 10:22:07 -0400 by phpDocumentor 1.3.0RC3