Source for file Component.interface.php

Documentation is available at Component.interface.php

  1. <?php
  2.  
  3. /**
  4. * A constant defining the BLANK component type.
  5. * @const integer BLANK
  6. * @package harmoni.gui
  7. */
  8. define("BLANK", 13);
  9. /**
  10. * A constant defining the HEADING component type.
  11. * @const integer HEADING
  12. * @package harmoni.gui
  13. */
  14. define("HEADING", 6);
  15.  
  16.  
  17. /**
  18. * A constant defining the HEADING component type.
  19. * @const integer HEADING
  20. * @package harmoni.gui
  21. */
  22. define("HEADER", 15);
  23. /**
  24. * A constant defining the FOOTER component type.
  25. * @const integer FOOTER
  26. * @package harmoni.gui
  27. */
  28. define("FOOTER", 7);
  29. /**
  30. * A constant defining the BLOCK component type.
  31. * @const integer BLOCK
  32. * @package harmoni.gui
  33. */
  34. define("BLOCK", 8);
  35. /**
  36. * A constant defining the MENU component type.
  37. * @const integer MENU
  38. * @package harmoni.gui
  39. */
  40. define("MENU", 9);
  41.  
  42. /**
  43. * A constant defining the MENU component type.
  44. * @const integer MENU
  45. * @package harmoni.gui
  46. */
  47. define("SUB_MENU", "SUB_MENU");
  48. /**
  49. * A constant defining the MENU_ITEM_LINK_UNSELECTED component type.
  50. * @const integer MENU_ITEM_LINK_UNSELECTED
  51. * @package harmoni.gui
  52. */
  53. define("MENU_ITEM_LINK_UNSELECTED", 10);
  54. /**
  55. * A constant defining the MENU_ITEM_LINK_SELECTED component type.
  56. * @const integer MENU_ITEM_LINK_SELECTED
  57. * @package harmoni.gui
  58. */
  59. define("MENU_ITEM_LINK_SELECTED", 11);
  60. /**
  61. * A constant defining the MENU_ITEM_HEADING component type.
  62. * @const integer MENU_ITEM_HEADING
  63. * @package harmoni.gui
  64. */
  65. define("MENU_ITEM_HEADING", 12);
  66.  
  67. /**
  68. * A constant defining the OTHER component type.
  69. * @const integer OTHER
  70. * @package harmoni.gui
  71. */
  72. define("OTHER", 13);
  73.  
  74.  
  75. /*********************************************************/
  76. * A constant defining the BLOCK indexes.
  77. * @const integer BACKGROUND_BLOCK
  78. * @package harmoni.gui
  79. */
  80. define("BACKGROUND_BLOCK", 1);
  81.  
  82. /**
  83. * A constant defining the BLOCK indexes.
  84. * @const integer STANDARD_BLOCK
  85. * @package harmoni.gui
  86. */
  87. define("STANDARD_BLOCK", 2);
  88.  
  89. /**
  90. * A constant defining the BLOCK indexes.
  91. * @const integer EMPHASIZED_BLOCK
  92. * @package harmoni.gui
  93. */
  94. define("EMPHASIZED_BLOCK", 3);
  95.  
  96. /**
  97. * A constant defining the BLOCK indexes.
  98. * @const integer WIZARD_BLOCK
  99. * @package harmoni.gui
  100. */
  101. define("WIZARD_BLOCK", 3);
  102.  
  103. /**
  104. * A constant defining the BLOCK indexes.
  105. * @const integer HIGHLIT_BLOCK
  106. * @package harmoni.gui
  107. */
  108. define("HIGHLIT_BLOCK", 4);
  109.  
  110. /**
  111. * A constant defining the BLOCK indexes.
  112. * @const integer ALERT_BLOCK
  113. * @package harmoni.gui
  114. */
  115. define("ALERT_BLOCK", 4);
  116.  
  117. /**
  118. * <code>Components</code> are the basic units that can be displayed on
  119. * the screen. The main method <code>render()</code> which renders the component
  120. * on the screen.
  121. *
  122. * @package harmoni.gui
  123. *
  124. * @copyright Copyright &copy; 2005, Middlebury College
  125. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  126. *
  127. * @version $Id: Component.interface.php,v 1.14 2007/09/04 20:25:21 adamfranco Exp $
  128. */
  129. class ComponentInterface {
  130.  
  131. /**
  132. * Adds a new <code>StyleCollection</code> to this component. The component
  133. * can have 0 or more style collections attached; each of the latter will
  134. * affect the appearance of the component. The uniqueness of the collections
  135. * is enforce by their selector (i.e., you can't have two collections
  136. * with the same selector). If a style collection has been registered with
  137. * the Theme for this Component's type and level, then the new style collection
  138. * @access public
  139. * @param ref object styleCollection The <code>StyleCollection</code> to add
  140. * to this component.
  141. * @return ref object The style collection that was just added.
  142. ***/
  143. function addStyle($styleCollection) {
  144. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  145. }
  146. /**
  147. * Returns the style collection with the specified selector.
  148. * @access public
  149. * @param string selector The selector.
  150. * @return ref object The style collection.
  151. ***/
  152. function getStyle($selector) {
  153. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  154. }
  155. /**
  156. * Remove the given StyleCollection from this Component.
  157. * @access public
  158. * @param string selector The selector of the style collection to remove.
  159. * @return ref object The style collection that was removed. <code>NULL</code>
  160. * if it could not be found.
  161. ***/
  162. function removeStyle($selector) {
  163. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  164. }
  165. /**
  166. * Returns all style collections for this component.
  167. * @access public
  168. * @return array An array of style collections; the key corresponds to the
  169. * selector of each collection.
  170. ***/
  171. function getStyles() {
  172. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  173. }
  174. /**
  175. * Returns the index of this component. The index has no semantic meaning:
  176. * you can think of the index as 'level' of the component. Alternatively,
  177. * the index could serve as means of distinguishing between components with
  178. * the same type. Most often one would use the index in conjunction with
  179. * the <code>getStylesForComponentType()</code> and <code>addStyleForComponentType()</code>
  180. * Theme methods.
  181. * @access public
  182. * @return integer The index of the component.
  183. ***/
  184. function getIndex() {
  185. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  186. }
  187. /**
  188. * Returns any pre HTML code that needs to be printed. This method should be called
  189. * at the beginnig of <code>render()</code>.
  190. * @access public
  191. * @param ref object theme The Theme object to use in producing the result
  192. * of this method.
  193. * @param string tabs This is a string (normally a bunch of tabs) that will be
  194. * prepended to each text line. This argument is optional but its usage is highly
  195. * recommended in order to produce a nicely formatted HTML output.
  196. * @return string The HTML string.
  197. ***/
  198. function getPreHTML($theme, $tabs = "") {
  199. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  200. }
  201. /**
  202. * Set pre HTML code that needs to surround this compontent. This is used to
  203. * properly nest form-tags around tables/divs to generate valid XHTML.
  204. *
  205. * @param string $html
  206. * @return void
  207. * @access public
  208. * @since 7/15/05
  209. */
  210. function setPreHTML ( $html ) {
  211. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  212. }
  213. /**
  214. * Returns any post HTML code that needs to be printed. This method should be called
  215. * at the end of <code>render()</code>.
  216. * @access public
  217. * @param ref object theme The Theme object to use in producing the result
  218. * of this method.
  219. * @param string tabs This is a string (normally a bunch of tabs) that will be
  220. * prepended to each text line. This argument is optional but its usage is highly
  221. * recommended in order to produce a nicely formatted HTML output.
  222. * @return string The HTML string.
  223. ***/
  224. function getPostHTML($theme, $tabs = "") {
  225. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  226. }
  227. /**
  228. * Set post HTML code that needs to surround this compontent. This is used to
  229. * properly nest form-tags around tables/divs to generate valid XHTML.
  230. *
  231. * @param string $html
  232. * @return void
  233. * @access public
  234. * @since 7/15/05
  235. */
  236. function setPostHTML ( $html ) {
  237. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  238. }
  239.  
  240. /**
  241. * Renders the component on the screen.
  242. * @param ref object theme The Theme object to use in producing the result
  243. * of this method.
  244. * @param string tabs This is a string (normally a bunch of tabs) that will be
  245. * prepended to each text line. This argument is optional but its usage is highly
  246. * recommended in order to produce a nicely formatted HTML output.
  247. * @access public
  248. ***/
  249. function render($theme, $tabs = "") {
  250. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  251. }
  252. /**
  253. * Returns the type of this component. One of BLANK, HEADING, FOOTER, BLOCK,
  254. * MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
  255. * @access public
  256. * @return integer The type of this component.
  257. ***/
  258. function getType() {
  259. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  260. }
  261. }
  262.  
  263. ?>

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