Source for file Container.interface.php

Documentation is available at Container.interface.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/Component.interface.php");
  4.  
  5. /**
  6. * An alignment constant.
  7. * @const integer LEFT
  8. * @package harmoni.gui
  9. */
  10. define("LEFT", 5);
  11.  
  12. /**
  13. * An alignment constant.
  14. * @const integer RIGHT
  15. * @package harmoni.gui
  16. */
  17. define("RIGHT", 6);
  18.  
  19. /**
  20. * An alignment constant.
  21. * @const integer TOP
  22. * @package harmoni.gui
  23. */
  24. define("TOP", 7);
  25.  
  26. /**
  27. * An alignment constant.
  28. * @const integer BOTTOM
  29. * @package harmoni.gui
  30. */
  31. define("BOTTOM", 8);
  32.  
  33. /**
  34. * An alignment constant.
  35. * @const integer CENTER
  36. * @package harmoni.gui
  37. */
  38. define("CENTER", 9);
  39.  
  40. /**
  41. * The <code>Container</code> interface is an extension of the <code>Component</code>
  42. * interface; <code>Containers</code> are capable of storing multiple sub-<code>Components</code>
  43. * and when rendering Containers, all sub-<code>Components</code> will be rendered as well.
  44. *
  45. * @package harmoni.gui
  46. *
  47. * @copyright Copyright &copy; 2005, Middlebury College
  48. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  49. *
  50. * @version $Id: Container.interface.php,v 1.7 2007/09/04 20:25:21 adamfranco Exp $
  51. */
  52. class ContainerInterface extends ComponentInterface {
  53.  
  54. /**
  55. * Adds the given component to this container.
  56. * @access public
  57. * @param ref object component The component to add.
  58. * @param string width The available width for the added component. If null, will be ignored.
  59. * @param string height The available height for the added component. If null, will be ignored.
  60. * @param integer alignmentX The horizontal alignment for the added component. Allowed values are
  61. * <code>LEFT</code>, <code>CENTER</code>, and <code>RIGHT</code>.
  62. * If null, will be ignored.
  63. * @param integer alignmentY The vertical alignment for the added component. Allowed values are
  64. * <code>TOP</code>, <code>CENTER</code>, and <code>BOTTOM</code>.
  65. * If null, will be ignored.
  66. * @return ref object The component that was just added.
  67. ***/
  68. function add($component, $width, $height, $alignmentX, $alignmentY) {
  69. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  70. }
  71. /**
  72. * Returns the component of this container with the specified id. Ids
  73. * reflect the order in which components are added. That is, the very first
  74. * component has an id of 1, the second component has an id of 2, and so forth.
  75. * @access public
  76. * @param integer id The id of the component which should be returned.
  77. * @return ref object The component.
  78. ***/
  79. function getComponent($id) {
  80. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  81. }
  82. /**
  83. * Returns the number of components in this container.
  84. * @access public
  85. * @return integer The number of components in this container.
  86. ***/
  87. function getComponentsCount() {
  88. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  89. }
  90. /**
  91. * Returns all components in this <code>Container</code>.
  92. * @access public
  93. * @return ref array An array of the components in this <code>Container</code>.
  94. ***/
  95. function getComponents() {
  96. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  97. }
  98. /**
  99. * Returns the width for the component of this container with the specified id. Ids
  100. * reflect the order in which components are added. That is, the very first
  101. * component has an id of 1, the second component has an id of 2, and so forth.
  102. * @access public
  103. * @param integer id The id of the component which should be returned.
  104. * @return string The width.
  105. ***/
  106. function getComponentWidth($id) {
  107. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  108. }
  109. /**
  110. * Returns the height for the component of this container with the specified id. Ids
  111. * reflect the order in which components are added. That is, the very first
  112. * component has an id of 1, the second component has an id of 2, and so forth.
  113. * @access public
  114. * @param integer id The id of the component which should be returned.
  115. * @return string The height.
  116. ***/
  117. function getComponentHeight($id) {
  118. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  119. }
  120. /**
  121. * Returns the horizontal alignment for the component of this container with the specified id. Ids
  122. * reflect the order in which components are added. That is, the very first
  123. * component has an id of 1, the second component has an id of 2, and so forth.
  124. * @access public
  125. * @param integer id The id of the component which should be returned.
  126. * @return integer The horizontal alignment.
  127. ***/
  128. function getComponentAlignmentX($id) {
  129. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  130. }
  131. /**
  132. * Returns the vertical alignment for the component of this container with the specified id. Ids
  133. * reflect the order in which components are added. That is, the very first
  134. * component has an id of 1, the second component has an id of 2, and so forth.
  135. * @access public
  136. * @param integer id The id of the component which should be returned.
  137. * @return integer The vertical alignment.
  138. ***/
  139. function getComponentAlignmentY($id) {
  140. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  141. }
  142.  
  143. /**
  144. * Removes the component with the specified id from this container. Ids
  145. * reflect the order in which components are added. That is, the very first
  146. * component has an id of 1, the second component has an id of 2, and so forth.
  147. * @access public
  148. * @param integer id The id of the component which should be removed from
  149. * this container..
  150. * @return ref object The component that was just removed.
  151. ***/
  152. function remove($id) {
  153. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  154. }
  155. /**
  156. * Removes all components from this <code>Container</code>.
  157. * @access public
  158. ***/
  159. function removeAll() {
  160. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  161. }
  162. /**
  163. * Returns the <code>Layout</code> of this container.
  164. * @access public
  165. * @return ref object The <code>Layout</code> of this container.
  166. ***/
  167. function getLayout() {
  168. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  169. }
  170. /**
  171. * Sets the <code>Layout</code> of this container
  172. * @access public
  173. * @param ref object layout The Layout to assign to this container.
  174. ***/
  175. function setLayout($layout) {
  176. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  177. }
  178. }
  179.  
  180. ?>

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