Source for file FontSizeSC.class.php

Documentation is available at FontSizeSC.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."GUIManager/StyleComponent.class.php");
  4. require_once(HARMONI."GUIManager/StyleComponents/LengthSC.class.php");
  5.  
  6. /**
  7. * The FontSizeSC represents CSS "font-size" values. The allowed
  8. * values are:
  9. * <ul style="font-family: monospace;">
  10. * <li> xx-small </li>
  11. * <li> x-small </li>
  12. * <li> small </li>
  13. * <li> medium </li>
  14. * <li> large </li>
  15. * <li> x-large </li>
  16. * <li> xx-large </li>
  17. * <li> smaller </li>
  18. * <li> larger </li>
  19. * <li> [specific font size value] - a length value (i.e. units are %, px, in, etc.) </li>
  20. * </ul>
  21. * <br /><br />
  22. * The <code>StyleComponent</code> (SC) is the most basic of the three building pieces
  23. * of CSS styles. It combines a CSS property value with a ValidatorRule to ensure that
  24. * the value follows a certain format.<br /><br />
  25. *
  26. * @package harmoni.gui.scs
  27. *
  28. * @copyright Copyright &copy; 2005, Middlebury College
  29. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  30. *
  31. * @version $Id: FontSizeSC.class.php,v 1.10 2007/09/04 20:25:22 adamfranco Exp $
  32. */
  33. class FontSizeSC extends StyleComponent {
  34.  
  35. /**
  36. * The constructor.
  37. * @param string value The value to assign to this SC.
  38. * @access public
  39. ***/
  40. function FontSizeSC($value=null) {
  41. $options = array("xx-small","x-small","small","medium",
  42. "large","x-large","xx-large","smaller","larger");
  43.  
  44. $errDescription = "Could not validate the font-size StyleComponent value \"%s\".
  45. Allowed values are: ".implode(", ", $options)."
  46. or a specific font-size value (in length units, i.e. px,
  47. in, %, etc).";
  48. $rule = CSSLengthValidatorRuleWithOptions::getRule($options);
  49. $displayName = "Font Size";
  50. $description = "Specifies the font size to use. Allowed values are: ".implode(", ", $options)."
  51. or a specific font-size value (in length units, i.e. px,
  52. in, %, etc).";
  53. $this->StyleComponent($value, $rule, $options, false, $errDescription, $displayName, $description);
  54. }
  55. }
  56. ?>

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