/FD3/FlashDevelop/Bin/Debug/Library/AS3/frameworks/FlashIDE/fl/managers/StyleManager.as

https://bitbucket.org/kkszysiu/flashdevelop · ActionScript · 98 lines · 33 code · 2 blank · 63 comment · 0 complexity · 78d451786a1f9229609523c468f59efc MD5 · raw file

  1. package fl.managers
  2. {
  3. import fl.core.UIComponent;
  4. import flash.display.Sprite;
  5. import flash.text.TextFormat;
  6. import flash.utils.Dictionary;
  7. import flash.utils.getDefinitionByName;
  8. import flash.utils.getQualifiedClassName;
  9. import flash.utils.getQualifiedSuperclassName;
  10. /**
  11. * The StyleManager class provides static methods that can be used to get and * set styles for a component instance, an entire component type, or all user * interface components in a Flash document. Styles are defined as values that * affect the display of a component, including padding, text formats, and skins. * * @includeExample examples/StyleManagerExample.as * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  12. */
  13. public class StyleManager
  14. {
  15. /**
  16. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  17. */
  18. private static var _instance : StyleManager;
  19. /**
  20. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  21. */
  22. private var styleToClassesHash : Object;
  23. /**
  24. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  25. */
  26. private var classToInstancesDict : Dictionary;
  27. /**
  28. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  29. */
  30. private var classToStylesDict : Dictionary;
  31. /**
  32. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  33. */
  34. private var classToDefaultStylesDict : Dictionary;
  35. /**
  36. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  37. */
  38. private var globalStyles : Object;
  39. /**
  40. * Creates a new StyleManager object. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  41. */
  42. public function StyleManager ();
  43. /**
  44. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  45. */
  46. private static function getInstance ();
  47. /**
  48. * Registers a component instance with the style manager. After a component instance is * instantiated, it can register with the style manager to be notified of changes * in style. Component instances can register to receive notice of style changes that are * component-based or global in nature. * * @param instance The component instance to be registered for style * management. * * @internal Do you guys have a code snippet/test case/sample you could give us for this? (pdehaan(at)adobe.com) * Adobe: [LM] Although this method is public, it is all handled internally by UIComponent. Each component registers itself when it instantiates. * @internal Should this then be (at)private in the docs? * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  49. */
  50. public static function registerInstance (instance:UIComponent) : void;
  51. /**
  52. * @private * * Sets an inherited style on a component. * * @param instance The component object on which to set the inherited style. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  53. */
  54. private static function setSharedStyles (instance:UIComponent) : void;
  55. /**
  56. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  57. */
  58. private static function getSharedStyle (instance:UIComponent, name:String) : Object;
  59. /**
  60. * Gets a style that exists on a specific component. * * @param component The name of the component instance on which to find the * requested style. * * @param name The name of the style to be retrieved. * * @return The requested style from the specified component. This function returns <code>null</code> * if the specified style is not found. * * @see #clearComponentStyle() * @see #getStyle() * @see #setComponentStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  61. */
  62. public static function getComponentStyle (component:Object, name:String) : Object;
  63. /**
  64. * Removes a style from the specified component. * * @param component The name of the component from which the style is to be removed. * * @param name The name of the style to be removed. * * @see #clearStyle() * @see #getComponentStyle() * @see #setComponentStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  65. */
  66. public static function clearComponentStyle (component:Object, name:String) : void;
  67. /**
  68. * Sets a style on all instances of a component type, for example, on all instances of a * Button component, or on all instances of a ComboBox component. * * @param component The type of component, for example, Button or ComboBox. This parameter also accepts * a component instance or class that can be used to identify all instances of a component type. * * @param name The name of the style to be set. * * @param style The style object that describes the style that is to be set. * * @see #clearComponentStyle() * @see #getComponentStyle() * @see #setStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  69. */
  70. public static function setComponentStyle (component:Object, name:String, style:Object) : void;
  71. /**
  72. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  73. */
  74. private static function getClassDef (component:Object) : Class;
  75. /**
  76. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  77. */
  78. private static function invalidateStyle (name:String) : void;
  79. /**
  80. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  81. */
  82. private static function invalidateComponentStyle (componentClass:Class, name:String) : void;
  83. /**
  84. * Sets a global style for all user interface components in a document. * * @param name A String value that names the style to be set. * * @param style The style object to be set. The value of this property depends on the * style that the user sets. For example, if the style is set to "textFormat", the style * property should be set to a TextFormat object. A mismatch between the style name and * the value of the style property may cause the component to behave incorrectly. * * @see #clearStyle() * @see #getStyle() * @see #setComponentStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  85. */
  86. public static function setStyle (name:String, style:Object) : void;
  87. /**
  88. * Removes a global style from all user interface components in a document. * * @param name The name of the global style to be removed. * * @see #clearComponentStyle() * @see #getStyle() * @see #setStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  89. */
  90. public static function clearStyle (name:String) : void;
  91. /**
  92. * Gets a global style by name. * * @param name The name of the style to be retrieved. * * @return The value of the global style that was retrieved. * * @internal "that was removed" - doesn't sound right. Do you guys have a code snippet/test * case/sample you could give us for this? (rberry(at)adobe.com) * Adobe: [LM] Correct - description was wrong. Code sample would be simple: {var textFormat:TextFormat = StyleManager.getStyle("textFormat") as TextFormat;} * * @see #clearStyle() * @see #getComponentStyle() * @see #setStyle() * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  93. */
  94. public static function getStyle (name:String) : Object;
  95. }
  96. }