Source for file StyleComponent.interface.php

Documentation is available at StyleComponent.interface.php

  1. <?php
  2.  
  3. /**
  4. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  5. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  6. * the value follows a certain format.<br /><br />
  7. * The other two CSS styles building pieces are <code>StyleProperties</code> and
  8. * <code>StyleCollections</code>. To clarify the relationship between these three
  9. * building pieces, consider the following example:
  10. * <pre>
  11. * div {
  12. * margin: 20px;
  13. * border: 1px solid #000;
  14. * }
  15. * </pre>
  16. * <code>div</code> is a <code>StyleCollection</code> consisting of 2
  17. * <code>StyleProperties</code>: <code>margin</code> and <code>border</code>. Each
  18. * of the latter consists of one or more <code>StyleComponents</code>. In
  19. * specific, <code>margin</code> consists of one <code>StyleComponent</code>
  20. * with the value <code>20px</code>, and <code>border</code> has three
  21. * <code>StyleComponents</code> with values <code>1px</code>, <code>solid</code>,
  22. * and <code>#000</code> correspondingly.
  23. *
  24. * @package harmoni.gui
  25. *
  26. * @copyright Copyright &copy; 2005, Middlebury College
  27. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  28. *
  29. * @version $Id: StyleComponent.interface.php,v 1.6 2005/02/07 21:38:13 adamfranco Exp $
  30. */
  31. class StyleComponentInterface {
  32.  
  33. /**
  34. * Returns the display name of this SC.
  35. * @access public
  36. * @return string The display name of this SC.
  37. ***/
  38. function getDisplayName() {
  39. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  40. }
  41. /**
  42. * Returns the description of this StlyeProperty.
  43. * @access public
  44. * @return string The description of this StlyeProperty.
  45. ***/
  46. function getDescription() {
  47. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  48. }
  49. /**
  50. * Get the value of this SC.
  51. * @access public
  52. * @return string The value of this SC.
  53. ***/
  54. function getValue() {
  55. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  56. }
  57. /**
  58. * Sets the value of this SC and validates it using the attached <code>ValidatorRule</code>.
  59. * @access public
  60. * @param string value The new value.
  61. ***/
  62. function setValue($value) {
  63. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  64. }
  65. /**
  66. * Determines whether this SC has a list of options. If there is a list of
  67. * options, then the ValidatorRule of this SC would be a ChoiceValidatorRule.
  68. * If not, the ValidatorRule could be any ValidatorRule.
  69. * @access public
  70. * @return boolean True if the SC has a list of options. FALSE if
  71. * the SC can take any value.
  72. ***/
  73. function hasOptions() {
  74. (throwError(new Error("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.", "Interface", TRUE)) || die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class."));
  75. }
  76. /**
  77. * This function will return <code>TRUE</code> if the value of this SC is
  78. * restricted only to the list of options. It will return <code>FALSE</code>,
  79. * if not.
  80. * @access public
  81. * @return boolean <code>TRUE</code> if the value of this SC is
  82. * restricted only to the list of options. <code>FALSE</code>,
  83. * if not.
  84. ***/
  85. function isLimitedToOptions() {
  86. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  87. }
  88.  
  89. /**
  90. * Returns the list of options (list of allowed values) of this SC.
  91. * @access public
  92. * @return array An array containing the list of options
  93. * (list of allowed values) of this SC.
  94. ***/
  95. function getOptions() {
  96. (throwError(new Error("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.", "Interface", TRUE)) || die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class."));
  97. }
  98.  
  99. }
  100. ?>

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