Source for file StyleCollection.interface.php

Documentation is available at StyleCollection.interface.php

  1. <?php
  2.  
  3. /**
  4. * A StyleCollection is one of the tree building pieces of CSS styles. As the name
  5. * suggests it handles a collection of StyleProperties.
  6. *
  7. * The other two CSS styles building pieces are <code>StylePropertiy</code> and
  8. * <code>StyleComponent</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: StyleCollection.interface.php,v 1.8 2007/09/04 20:25:21 adamfranco Exp $
  30. ***/
  31.  
  32. class StyleCollectionInterface {
  33.  
  34. /**
  35. * Returns the CSS code for this StyleCollection.
  36. * @access public
  37. * @param string tabs This is a string (normally a bunch of tabs) that will be
  38. * prepended to each text line. This argument is optional but its usage is highly
  39. * recommended in order to produce a nicely formatted HTML output.
  40. * @return string The CSS code for this StyleCollection.
  41. ***/
  42. function getCSS($tabs = "") {
  43. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  44. }
  45. /**
  46. * Returns the class selector of this style collection. A class selector is the string
  47. * that would be included in the 'class' attribute of HTML tags. One can use
  48. * this method in order to apply the style collection to an arbitrary component.
  49. * @access public
  50. * @return string The class name of this style collection.
  51. ***/
  52. function getClassSelector() {
  53. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  54. }
  55.  
  56. /**
  57. * Determines whether this <code>StyleCollection</code> can be applied to <code>Components</code>.
  58. * @access public
  59. * @return boolean <code>TRUE</code> if this <code>StyleCollection</code> can be applied to <code>Components</code>.
  60. ***/
  61. function canBeApplied() {
  62. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  63. }
  64.  
  65. /**
  66. * Returns the selector of this StyleCollection.
  67. * @access public
  68. * @return string The selector of this StyleCollection.
  69. ***/
  70. function getSelector() {
  71. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  72. }
  73. /**
  74. * Returns the display name of this StyleCollection.
  75. * @access public
  76. * @return string The display name of this StyleCollection.
  77. ***/
  78. function getDisplayName() {
  79. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  80. }
  81. /**
  82. * Returns the description of this StyleCollection.
  83. * @access public
  84. * @return string The description of this StlyeProperty.
  85. ***/
  86. function getDescription() {
  87. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  88. }
  89. /**
  90. * Adds one StyleProperty to this StyleCollection.
  91. * @access public
  92. * @param ref object sc A StyleProperty object.
  93. * @return ref object The style property that was just added.
  94. ***/
  95. function addSP($sp) {
  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 StyleProperties of this StyleCollection in a suitable
  100. * for CSS generation order.
  101. * @access public
  102. * @return array An array of the StyleProperties of this StyleCollection.
  103. ***/
  104. function getSPs() {
  105. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  106. }
  107. /**
  108. * Remove the given StyleProperty from this Style Collection.
  109. * @access public
  110. * @param ref object The style property to remove.
  111. * @return ref object The style property that was removed. <code>NULL</code>
  112. * if it could not be found.
  113. ***/
  114. function removeSP($sp) {
  115. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  116. }
  117. }
  118.  
  119. ?>

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