Source for file FontWeightSC.class.php

Documentation is available at FontWeightSC.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/StyleComponent.class.php");
  4.  
  5. /**
  6. * The FontWeightSC represents CSS "font-weight" values. The allowed
  7. * values are:
  8. * <ul style="font-family: monospace;">
  9. * <li> 100 </li>
  10. * <li> 200 </li>
  11. * <li> 300 </li>
  12. * <li> 400 </li>
  13. * <li> 500 </li>
  14. * <li> 600 </li>
  15. * <li> 700 </li>
  16. * <li> 800 </li>
  17. * <li> 900 </li>
  18. * <li> normal </li>
  19. * <li> bold </li>
  20. * <li> lighter </li>
  21. * <li> bolder </li>
  22. * </ul>
  23. * <br /><br />
  24. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  25. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  26. * the value follows a certain format.<br /><br />
  27. *
  28. * @package harmoni.gui.scs
  29. *
  30. * @copyright Copyright &copy; 2005, Middlebury College
  31. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  32. *
  33. * @version $Id: FontWeightSC.class.php,v 1.8 2006/08/15 20:44:58 sporktim Exp $
  34. */
  35. class FontWeightSC extends StyleComponent {
  36.  
  37. /**
  38. * The constructor.
  39. * @param string value The value to assign to this SC.
  40. * @access public
  41. ***/
  42. function FontWeightSC($value=null) {
  43. $options = array("100", "200", "300", "400", "500",
  44. "600", "700", "800", "900", "normal",
  45. "bold", "lighter", "bolder");
  46.  
  47. $errDescription = "Could not validate the font-weight StyleComponent value \"%s\".
  48. Allowed values are: ".implode(", ", $options).".";
  49. $displayName = "Font Weight";
  50. $description = "Specifies the font weight (thickness). Allowed values are: ".implode(", ", $options).".";
  51. $rule = RegexValidatorRule::getRuleByArray($options);
  52. $this->StyleComponent($value, $rule, $options, true, $errDescription, $displayName, $description);
  53. }
  54. }
  55. ?>

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