Hero Spark Formatters - Functional and Design Specification



Glossary


flash.globalization - A new package added to Flash player version 10.1 to access locale-specific functionality provided by the operating system on which the Flash player is running.

Locale data - All the data that is required by a framework/application/API in order to be able to honor various cultural conventions in a specific language and region. The data consists of month and day names, date patterns, decimal and thousand separators for number formatting, rules for language specific sorting, info on the measurement system used, and so on. The exact type of data each system chooses to store differs between systems.

Locale - In the context of this document, locale refers to the language, script, and region for which an operating system has a collection of locale data as described above. The identification of a locale can be further tailored using variants and keywords. See Locale ID below.

Locale ID - A string that identifies a locale. In the context of this specification, locale IDs use the syntax defined in Unicode Technical Standard #35, Unicode Locale Data Markup Language (LDML). In this syntax a locale ID consists of several sub-tags, that specify the language, script, region, variants, and key value pairs. E.g. the locale ID for Germany using the German language and sorting by the phonebook sort order is: de-DE@collation=phonebook. Note that not all sub-tags are required; in this case the script is inferred from the language.

Collation Order - When displaying a list of strings to the end user, they are often displayed in lexicographic order. For writing systems based on alphabets, this is also called alphabetic order. The default string comparison method provided by ActionScript uses the Unicode code point values for sorting, which does not sort lists in lexicographic order. Even for English this sort does not provide a correct lexicographic sort. (In a lexicographic sort lowercase a is between uppercase A and uppercase B, not after uppercase Z.) Different languages that use the same script have different sort orders and some languages support multiple orders. For example German has a dictionary and a phonebook sort order, while Chinese can be sorted based on the pinyin pronunciation or the radical and stroke count of the ideographic characters.

Wrapper Class - In this document a wrapper class refers to a class that "wraps" a flash.globalization class to provide support for inheriting the locale style from the Application, a Module, or other UIComponent and to provide the ability to use the classes from a MXML declaration.

Non-Visual Style Client - In order to make use of styles with non-UIComponents, a new type of object will be introduced in the Flex SDK which in this document is called a non-visual style client. This object will support all the same ways of setting a style as can be done with a UIComponent (e.g. style properties, stylenames, classnames, etc.)

Summary and Background


The flash.globalization classes that have been added to the Flash Player version 10.1, provide the following functionality:

  • Locale-specific formatting of dates, times, number, and currency amounts.
  • Locale-specific parsing of numbers and currency amounts.
  • Locale-specific string comparison.
  • Locale-specific uppercase and lower case string conversion.
  • Locale ID parsing and processing.

The formatting, sorting and case conversion methods are based on the functionality provided by the operating system. This allows one to develop applications that follow the behavior of the device running the application. However due to differences in the capabilities of the operating systems, the behavior may vary. For example the set of locales supported on a particular device may vary, or the formatting of dates may differ from one device to another. Some devices that do not have any locale support may not support the flash.globalization classes at all. In this case or in the case where specific functionality is not supported the flash.globalization classes report errors and warnings. The integration with the Flex SDK will provide a fallback behavior in case the flash.globalization classes are unsupported.

This specification covers enhancements to the Flex SDK to make use of the functionality provided by the flash.globalization classes.

The flash.globalization classes cannot be used directly using the MXML syntax, so a set of wrapper classes, in the Spark namespace, will be implemented that allow these classes to be used with MXML syntax. These wrapper classes will allow for the use of the existing locale style to select a locale for these classes.

Additionally NumberValidator, CurrencyValidator, SortField and Sort classes {that make use of the flash.globalization classes will be implemented in the Spark namespace. These classes will be covered in a separate specifications.

The Flex SDK has an existing set of formatters and validators in the MX namespace that provide similar functionality. The above classes will be replacements for these MX-based classes, and the MX formatters and validators can then be deprecated in a future release of the SDK.

Usage Scenarios


In the following user scenarios, there is an assumption that the end user of the application is using a device that has support for his or her preferred locale, and that in most cases they will only visit or use web sites that support languages and locales that are also supported on their device. When the end user visits a site with a locale not supported by their device, they will find that it is acceptable for the behavior to be consistent with a default locale on their device.

Scenarios that drive the must-have requirements

1. A Danish developer who is building a brand new Flex app in Flex 4.5 which will target Flash Player 10.1 or later dreams of fame, fortune, and global domination. She will create a web-based application that runs in the browser as well as an AIR application. From the start she will research the best practices for globalization. Since she is starting from scratch, she can use a new set of components available with the Flex 4.5 SDK.

For the browser-based application she will allow the user to select a locale that will be used to select the language for the UI and the locale for formatting and string comparison, but she also wants to choose a reasonable default locale based on the language settings from the browser. (Note that this is not the browser UI language that is available from Javascript, but rather is the list of preferred locales for web pages that the user has set in the browser preferences). The language used for formatting and sorting will use the same language as the UI of the Flex application. However for formatting the region also needs to be supplied. Thus in many cases the locale required for formatting is more specific than the UI locale. E.g. the UI locale may just be French where as the locale for formatting might be French-Canada.

For the AIR application, the default UI locale will be based on the user's system preferences for the UI locale. The behavior of most of the locale-specific sorting and formatting will follow the local settings from the user's platform, which for some users can be different from the system's UI locale.

2. An American developer is building a brand new Flex app in Flex 4.5. He only cares about the U.S. market today, but later discovers that his biggest user base is in Russia. He used the new Spark formatters, validators, and sort classes, and initially expects that they work according to the English-US locale. He will be pleasantly surprised that he just needs to make one simple change to have these components work for Russia. However the developer will still need a lot of work to externalize the string resources and ensure that his UI automatically resizes due to different string lengths for Russian.

3. An existing Flex 3 developer in Korea has written custom code to create a browser-based app that has a Korean UI and is designed for use by only Korean users. Although this application is for a single language and region, she would like to make use of the new flash.globalization functionality for sorting strings and formatting dates, times, numbers, and currency amounts according to the language and cultural conventions for the Korean language and as used in Korea. She would therefore like to set the locale in one location and have it apply to the behavior throughout the application.

Scenarios that drive the nice-to-have requirements

4. An existing Flex 3 developer in the U.S. is thinking about expanding his product into Europe but doesn't know much about internationalization. He would like to continue to use the existing components. He would like a simple method that makes the MX components locale-aware.

_ This use case is beyond the scope of this specification. Many of the MX components already provide methods to override the default formatting and sorting, therefore examples and documentation on how to use these new classes to override the default behavior will be provided. _

Detailed Description


Requirements

Must haves:

1. Spark formatters classes should supply locale specific behavior "out of the box" using the functionality from the flash.globalization package.

2. Allow a locale set at the application level to be used for all locale-specific operations.

3. Allow the locale to be overridden for specific class instances.

4. Allow the locale to be set at runtime, and have all classes that use the inherited locale update themselves.

5. Use the locale style consistently throughout all classes.

6. Provide an MXML syntax for using the functionality provided by the flash.globalization classes.

7. Provide fallback behavior if the flash.globalization classes are unsupported on a specific device.

Locale Style

The functionality provided by the flash.globalization classes is driven by the specification of a locale. Once set, the locale governs the formatting, sorting and case conversion provided by these classes. In order to satisfy the requirements of an inheritable setting for this locale, that can be set either at the global level or on a per instance basis, the existing locale style – added in Flex 4.0 to support the Flash Text Engine and the Text Layout Framework – will be used as the source of this value. Inheritance will be provided by the mechanism used for all style properties.

Note that the locale style is also used to determine the language for the TLF-based text fields. In most cases there should not be a conflict between these overlapping uses of the styles. However in some cases the locale may need to be supplied on a specific instance to avoid conflicts from a locale style that is set at the global application level or ancestor level of a component.

Non-Visual Style Clients

Using CSS styles for a non-visual component is a new concept for the Flex SDK. There are three main issues that need to be solved. The first is to handle all the ways in which a style can be set. The second is that when a style changes, the wrapper classes must be notified of the style change. The third issue is that, to access the style declaration, the wrapper class needs access to a module factory that provides the relevant StyleManager instance. These mechanisms need to work when the wrapper class is used in ActionScript and in an MXMLdeclaration.

Currently style notifications are propagated through the DisplayObject tree and thus an additional mechanism is needed to propagate style changes to non-visual objects.

Fully supporting a style includes support for specifying the style by id, class or type in a CSS declaration. There is also the ability of setting the styles of all components used in a container (e.g., all Buttons in a Panel).

Since the formatters are most likely to be used in formatting strings that are displayed to the end user, it makes sense for a UIComponent to be the "owner" of the formatter. Creating this owner relationship then solves the problem of notification. The owner UIComponent can notify any formatters that it "owns". This can be implemented by creating a vector of non-visual style clients in the UIComponent class with APIs to add and remove objects from the vector.

In ActionScript, once a non-visual style client is created, the developer will need to call an API to add the non-visual style client to the UIComponent. When the instance of a non-visual style client is deleted, the developer will need to call the API to remove it from the vector in the UIComponent. If this is not done the instance will not be garbage collected until the UIComponent is also deleted.

For MXML, the wrapper classes will implement the IMXMLObject interface and in the initialize() method will call the API to add the instance of the non-visual style client to the UIComponent. The document object passed into the initialize() method will be used as the UIComponent that owns the instance of the non-visual style client. Compiler changes to call an IMMXMLObject.uninitialize() method were considered, but at this time do not appear to be necessary.

Since each non-visual style client will have a UIComponent that owns it, the non-visual style client should be able to access the styleManager from the UIComponent. The non-visual style client will therefore need to have a reference to the UIComponent that owns it. The method that adds the non-visual style client to the UIComponent will update an owner property on the non-visual style client. If the property is non-null, then the non-visual style client will first be removed from the current owner, before adding it to the new UIComponent and updating the owner property. This ensures that a non-visual style client has only one owner.

For efficiency, the access to styles are handled by building up the protochain for the styles. The UIComponent uses the StyleProtoChain class for this purpose.

The implementation of non-visual styleClients is accomplished by the following:

  • Addition of an addStyleClient() method and a removeStyleClient() method to UIComponent.
  • Addition of a styleParent setter in the IAdvancedStyleClient interface.
  • An implementation of an AdvancedStyleClient base class that implements the IAdvancedStyleClient interface.
  • A minor modification to the StyleProtoChain class to handle style inheritance for objects that implement the IAdvancedStyleClient interface that are not DisplayObjects.

Wrapper classes for flash.globalization classes

Wrapper classes around the flash.globalization classes will be provided to allow this functionality to be used with MXML syntax and also to provide the foundation for using this functionality in other Flex components. The following applies to all the wrapper classes listed below.

  • Create wrapper classes that make use of the flash.globalization classes and can be used by the MXML syntax.
  • The wrapper classes will not have any constructor parameters. The requestedLocaleIDName that each of the flash.globalization classes require, will be derived from the locale style property. The other constructor parameters that are used by the flash.globalization classes will have defaults and be settable as property values. As a style, the locale ID Name will be set by the setStyle() method or by inheritance when the object is added to a UIComponent with the UIComponent's addStyleClient() method.
  • Each class extend a base class that will have a locale style property which can be set by assigning the style a value in an MXML declaration, via the setStyle() method in ActionScript, by CSS style sheets or style declarations, or by style inheritance from a UIComponent. Style inheritance from a UIComponent is accomplished by calling the UIComponent's addStyleClient() method with the wrapper class object as the parameter. An instance of the wrapper class can only have one UIComponent that owns it. This will be enforced by the addStyleClient() method and an owner property of the wrapper class. If the style is set on the object itself, it overrides any style inheritance provided by the UIComponent.
  • Each class extend a base class that will implement the IMXMLObject interface. The initialize() method required by this interface will call the addStyleClient() method to add the instance of the wrapper class to the document object that contains the MXML declaration.
  • When the locale style is changed either by setting the inherited style or the style directly on the class instance, the flash.globalization class object that is used by the wrapper class will be replaced by a new one that is created with the new locale. Any previous settings that were explicitly set by the application will then be applied to this new object.
  • The format methods, or methods that return property values, will be Bindable, based on a change event. A locale style change, or a call to a method or property setter that changes the return results, will generate the change event.
  • The wrapper classes will have a read-only property for actualLocaleIDName that is set based on the actualLocaleIDName property of the underlying flash.globalization class.
  • The wrapper classes will report errors and warnings using a lastOperationStatus property similar to the lastOperationStatus property of the flash.globalization classes.
  • All the methods and property getters will set the lastOperationStatus property to spark.globalization.LastOperationStatus.LOCALE_UNDEFINED_ERROR if called prior to setting the locale style either through inheritance or one of the other methods of setting the locale style.
  • Setting of some of the properties on the flash.globalization classes are not supported on certain operating systems e.g. groupingSeparator in the CurrencyFormatter on the Mac; groupingPattern, negativeCurrencyFormat, positiveCurrencyFormat, leadingZero, and trailingZeros on the NumberFormatter and CurrencyFormatter classes on Linux. In these cases if the application sets the properties, the lastOperationStatus property will be set to indicate that the property or method is unsupported.
  • If the flash.globalization classes themselves are unsupported (e.g. on certain mobile devices), then a fall back will be provided. In the case where the functionality requires locale data, the locale data will be based on en-US locale values. For example, the month names will be January, February, etc. For string comparison the generic comparison method will be used that just compares strings based on the Unicode character value. For the string case conversions, the toUpperCase() and toLowerCase() methods will be used which only handle the character values that are in the ASCII code range and some accented characters in Latin character code ranges. Not all functionality will be provided by these fallback methods. For example, arbitrary dateTimePatterns will not be supported, just the predefined patterns: long, medium, short, and none are supported.
  • The Flex SDK 4.5 will have a dependency on Flash Player 10.1 or later, therefore a compile time dependency on the flash.globalization classes is acceptable.

Following are the wrapper classes that will be implemented:

  • spark.formatter.NumberFormatter
  • spark.formatter.CurrencyFormatter
  • spark.formatter.DateTimeFormatter
  • spark.globalization.SortingCollator
  • spark.globalization.MatchingCollator
  • spark.globalization.StringTools

MX formatters vs. Spark formatters

The following section provides a comparison between the existing MX formatters and the Spark formatters.

A very significant difference between these two sets of formatters is that the Spark formatters make use of the flash.globalization package for the functionality. The flash.globalization classes in turn use the functionality and locale data provided by the operating system. In contrast the MX formatters use the Flex's ResourceManager to access locale-specific data from properties files that are included in the Flex SDK.

As a consequence, Spark formatters provide behavior that is consistent with the operating system and has access to all the locales that are supported by the operating system, but this behavior may vary across different platforms. The MX formatters, on the other hand, provide the same behavior across operating systems but are limited to the locales provided by the Flex SDK or the developer.

The following table lists the properties, methods, styles, and events that are used by both classes. Properties and methods with similar functionality are shown on the same line.

MX Spark Comments
mx.formatters.CurrencyFormatter spark.formatters.CurrencyFormatter  
Properties    
alignSymbol negativeCurrencyFormat, positiveCurrencyFormat  
currencySymbol currencySymbol  
decimalSeparatorFrom decimalSeparator  
decimalSeparatorTo decimalSeparator  
error    
precision fractionalDigits  
rounding not supported  
thousandsSeparatorFrom groupingSeparator  
thousandsSeparatorTo groupingSeparator  
useNegativeSign negativeCurrencyFormat  
useThousandsSeparator useGrouping  
  currencyISOCode  
  digitTypes  
  groupingPattern  
  leadingZero  
  negativeSymbol  
  trailingZeros  
  errorText  
  actualLocaleIDName  
  lastOperationStatus  
Styles    
  locale  
Events    
  Change  
Methods    
format format  
  formattingWithCurrencySymbolIsSafe  
  getAvailableLocaleIDNames  
  parse  
     
mx.formatters.NumberFormatter spark.formatters.NumberFormatter  
decimalSeparatorFrom decimalSeparator  
decimalSeparatorTo decimalSeparator  
error    
precision fractionalDigits  
rounding not supported  
thousandsSeparatorFrom groupingSeparator  
thousandsSeparatorTo groupingSeparator  
useNegativeSign negativeNumberFormat  
useThousandsSeparator useGrouping  
  digitTypes  
  groupingPattern  
  leadingZero  
  negativeSymbol  
  trailingZeros  
  errorText  
  actualLocaleIDName  
  lastOperationStatus  
Events    
  Change  
Methods    
format format  
  parse  
  parseNumber  
     
mx.formatters.DateFormatter spark.formatters.DateTimeFormatter  
Properties    
error    
formatString dateTimePattern uses different mask pattern syntax
  dateStyle predefined locale specific pattern
  timeStyle predefined locale specific pattern
  actualLocaleIDName  
  errorText  
  lastOperationStatus  
Styles    
  locale  
Events    
  Change  
Methods    
format format  
parseDateString    
  getAvailableLocaleIDNames  
  getFirstWeekday  
  getMonthNames  
  getWeekdayNames  

Spark formatters and DataGrid components

For compatibility with DataGrid components, an IFormatter interface will be used. This interface will include a format method that takes an Object as an input parameter and returns a string formatted according to the formatter class and property settings. If the input parameter is not of the appropriate type it will be converted to the correct type as follows. The DateTimeFormatter will use the Date constructor to convert the input parameter to a Date object. Likewise for the NumberFormatter and CurrencyFormatter, the Number cast method will be used to convert the object to a Number. If the conversion is not possible an error will be indicated by setting the lastOperationStatus to indicate an illegal argument error.

The formatter property of the mx AdvancedDataGridColumn class will be modified to use the new IFormatter interface and the mx Formatter class will also be modified to implement the IFormatter interface.

API Description


Additions to MXML Language and ActionScript Object Model

UIComponent

Two methods have been added: addStyleClient() and removeStyleClient().

    /**
*  Adds a non-visual style client to this component instance. Once
*  this method has been called, the style client will inherit style
*  changes from this component instance. Style clients that are
*  DisplayObjects must use the <code>addChild</code> or
*  <code>addChildAt</code> methods to be added to a
*  <code>UIComponent</code>.
*
*  As a side effect, this method will set the <code>styleParent</code>
*  property of the <code>styleClient</code> parameter to reference
*  this instance of the <code>UIComponent</code>.
*
*  If the <code>styleClient</code> parameter already has a
*  <code>styleParent</code>, this method will call
*  <code>removeStyleClient</code> from this previous
*  <code>styleParent</code>.
*
*
*  @param styleClient The <code>IAdvancedStyleClient</code> to
*  add to this component's list of non-visual style clients.
*
*  @throws ArgumentError if the <code>styleClient</code> parameter
*  is a <code>DisplayObject</code>.
*
*  @see removeStyleClient
*  @see mx.styles.IAdvancedStyleClient
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
    public function addStyleClient(styleClient:IAdvancedStyleClient):void
    /**
*  Removes a non-visual style client from this component instance.
*  Once this method has been called, the non-visual style client will
*  no longer inherit style changes from this component instance.
*
*  As a side effect, this method will set the
*  <code>styleParent</code> property of the <code>styleClient</code>
*  parameter to <code>null</code>.
*
*  If the <code>styleClient</code> has not been added to this
*  component instance, no action will be taken.
*
*
*  @param styleClient The <code>IAdvancedStyleClient</code> to remove
*  from this component's list of non-visual style clients.
*
*  @return The non-visual style client that was passed in as the
*  <code>styleClient</code> parameter.
*
*  @see addStyleClient
*  @see mx.styles.IAdvancedStyleClient
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
    public function removeStyleClient(styleClient:IAdvancedStyleClient):IAdvancedStyleClient
 

There is no need to have a return value for the removeStyleClient() method.

[AdvancedStyleClient]

A setter for the styleParent property has been added.

    //----------------------------------
    //  styleParent
    //----------------------------------

/**
*  The parent of this <code>IAdvancedStyleClient</code>..
*
*  Typically, you do not assign this property directly.
*  It is set by the <code>addChild, addChildAt, removeChild, and
*  removeChildAt</code> methods of the
*  <code>flash.display.DisplayObjectContainer</code> and  the
*  <code>mx.core.UIComponent.addStyleClient()</code>  and
*  the <code>mx.core.UIComponent.removeStyleClient()</code> methods.
*
*  If it is assigned a value directly, without calling one of the
*  above mentioned methods the instance of the class that implements this
*  interface will not inherit styles from the UIComponent or DisplayObject.
*  Also if assigned a value directly without, first removing the
*  object from the current parent with the remove methods listed above,
*  a memory leak could occur.
*
*  @langversion 3.0
*  @playerversion Flash 10
*  @playerversion AIR 1.5
*  @productversion Flex 4
*/
function get styleParent():IAdvancedStyleClient;
function set styleParent(parent:IAdvancedStyleClient):void;

mx.styles.[AdvancedStyleClient]

This is a base class that any non-visual style client can extend to make use of the style mechanism.

package mx.styles

{

/**
* The <code>AdvancedStyleClient</code> is a base class that can be used
* when implementing an object that uses the
* <code>IAdvancedStyleClient</code> interface.  The base class supplies
* implementations of the methods and properties required for an object
* to participate in the style subsystem.
*
* <p>In addition to the <code>IAdvancedStyleClient</code> interface,
* this object also implements the <code>IFlexModule</code> and
* <code>IMXMLObject</code> interfaces. The <code>IMXMLObject</code>
* interface contains an <code>initialized</code> method that is called
* when the class is instantiated using an mxml declaration.
* The  implementation of the <code>initialized</code> method provided
* by this base class will add the class instance to the document object
* that contains the mxml declaration. For more details see the description
* of the <code>initialized</code> method.</p>
* @see mx.core.styles.IAdvancedStyleClient
* @see #initialized
*/
    public class AdvancedStyleClient extends EventDispatcher 
      implements IAdvancedStyleClient,IFlexModule,IMXMLObject
    {
/***
*  Constructor.
*
*  @langversion 3.0
*  @playerversion Flash 10
*  @playerversion AIR 1.1
*  @productversion Flex 4
*/
public function AdvancedStyleClient()

/***
*  @private
*  Keeps track of the setStyles() calls that have been deferred
*  until a moduleFactory is set.
*/

/***
*  The name of the component class.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function get className():String


/***
*  An object containing the inheritable styles for this non-visual
*  style client instance.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function get inheritingStyles():Object

/***
*  @private
*/
public function set inheritingStyles(value:Object):void


        [Inspectable(environment="none")]

/***
*  The beginning of this component's chain of non-inheriting styles.
*  The <code>getStyle()</code> method simply accesses
*  <code>nonInheritingStyles[styleName]</code> to search the entire
*  prototype-linked chain.
*  This object is set up by <code>initProtoChain()</code>.
*  Developers typically never need to access this property directly.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 3
*/
public function get nonInheritingStyles():Object

/***
*  @private
*/
public function set nonInheritingStyles(value:Object):void


/***
*  The style declaration that holds the inline styles declared by this
*  object.
*
*  @see mx.styles.CSSStyleDeclaration
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
private var _styleDeclarationVar:CSSStyleDeclaration;

        [Inspectable(environment="none")]
public function get styleDeclaration():CSSStyleDeclaration

/***
*  @private
*/
public function set styleDeclaration(value:CSSStyleDeclaration):void
        //--------------------------------------------------------------------------
        //
        //  Methods
        //
        //--------------------------------------------------------------------------

/***
*  Returns the StyleManager instance used by this component.
*
*  @langversion 3.0
*  @playerversion Flash 10
*  @playerversion AIR 1.5
*  @productversion Flex 4
*/
public function get styleManager():IStyleManager2

private function setDeferredStyles():void

        [Bindable(style="true")]
/***
*  Gets a style property that has been set anywhere in this
*  component's style lookup chain.
*
*  <p>This same method is used to get any kind of style property,
*  so the value returned may be a Boolean, String, Number, int,
*  uint (for an RGB color), Class (for a skin), or any kind of object.
*  Therefore the return type is specified as ~~.</p>
*
*  <p>If you are getting a particular style property, you will
*  know its type and will often want to store the result in a
*  variable of that type. You can use either the <code>as</code>
*  operator or coercion to do this. For example:</p>
*
*  <pre>
*  var backgroundColor:uint = getStyle("backgroundColor") as int;
*
*  or
*
*  var backgroundColor:uint = int(getStyle("backgroundColor"));
*  </pre>
*
*  <p>If the style property has not been set anywhere in the
*  style lookup chain, the value returned by the
*  <code>getStyle()</code> method is <code>undefined</code>.
*  Note that <code>undefined</code> is a special value that is
*  not the same as <code>false</code>, the empty String
* (<code>""</code>),<code>NaN</code>, 0, or <code>null</code>.
*  No valid style value is ever <code>undefined</code>.
*  You can use the static method
*  <code>StyleManager.isValidStyleValue()</code>
*  to test whether the value was set.</p>
*
*  @param styleProp Name of the style property.
*
*  @return Style value.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function getStyle(styleProp:String):*

/***
*  Sets a style property on this component instance.
*
*  <p>This can override a style that was set globally.</p>
*
*  <p>Calling the <code>setStyle()</code> method can result in decreased performance.
*  Use it only when necessary.</p>
*
*  @param styleProp Name of the style property.
*
*  @param newValue New value for the style.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function setStyle(styleProp:String, newValue:*):void
/***
*  Deletes a style property from this component instance.
*
*  <p>This does not necessarily cause the <code>getStyle()</code>
*  method to return <code>undefined</code>.</p>
*
*  @param styleProp Name of the style property.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function clearStyle(styleProp:String):void

/***
*  Returns an Array of CSSStyleDeclaration objects for the type
*  selector that applies to this component, or <code>null</code>
*  if none exist.
*
*  <p>For example, suppose that component MyButton extends Button.
*  This method first looks for a MyButton selector; then, it looks
*  for a Button type selector; finally, it looks for a UIComponent
*  type selector.</p>
*
*  @return Array of CSSStyleDeclaration objects.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function getClassStyleDeclarations():Array

/***
*  Propagates style changes to the children of this style client
*  instance.  A non-visual style client (i.e. a style client that is
*  not a DisplayObject) does not have children, therefore this method
*  does not do anything for non-visual style clients.
*
*  @param styleProp Name of the style property.
*
*  @param recursive Whether to propagate the style changes to the
*  children's children.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function notifyStyleChangeInChildren(styleProp:String, recursive:Boolean):void

/***
*  Sets up the internal style cache values so that the
*  <code>getStyle()</code>
*  method functions.
*
*  @param recursive Regenerate the proto chains of the children.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function regenerateStyleCache(recursive:Boolean):void


/***
*  Registers the EffectManager as one of the event listeners
*  for each effect event.
*
*  @param effects An Array of Strings of effect names.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function registerEffects(effects:Array /* of String */):void

/***
*  Detects changes to style properties. When any style property is set,
*  Flex calls the <code>styleChanged()</code> method,
*  passing to it the name of the style being set.
*
*  <p>This is an advanced method that you might override
*  when creating a subclass of <code>AdvancedStyleClient</code>.
*  When you create a custom class,
*  you can override the <code>styleChanged()</code> method
*  to check the style name passed to it, and handle the change
*  accordingly.
*  This lets you override the default behavior of an existing style,
*  or add your own custom style properties.</p>
*
*  @param styleProp The name of the style property, or null if all
*  styles for this
*  style client have changed.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 3
*/
public function styleChanged(styleProp:String):void


        [Inspectable(category="General")]
/***
*  The class style used by this component. This can be a String,
*  CSSStyleDeclaration or an IStyleClient.
*
*  <p>If this is a String, it is the name of one or more whitespace
*  delimited class declarations in an <code>&lt;fx:Style&gt;</code> tag
*  or CSS file. You do not include the period in the
*  <code>styleName</code>. For example, if you have a class style named
*  <code>".bigText"</code>, set the <code>styleName</code> property to
*  <code>"bigText"</code> (no period).</p>
*
*  <p>If this is an IStyleClient, all styles in the
*  <code>styleName</code> object are used by this instance.</p>
*
*  @default null
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function get styleName():Object /* String, CSSStyleDeclaration, or UIComponent */

/***
*  @private
*/
public function set styleName(value:Object /* String, CSSStyleDeclaration, or UIComponent */):void

/***
*  @private
*/
private var _styleParent:IAdvancedStyleClient;


/***
*  ID of the component. This value becomes the instance name of the
*  object and should not contain any white space or special characters.
*  Each component throughout an application should have a unique id.
*
*  <p>If your application is going to be tested by third party tools,
*  give each component a meaningful id. Testing tools use ids to
*  represent the control in their scripts and having a meaningful
*  name can make scripts more readable. For example, set the
*  value of a button to submit_button rather than b1 or button1.</p>
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function get id():String
        {
            return _id;
        }

/***
*  @private
*/
public function set id(value:String):void
        {
            _id = value;
        }

/***
*  A component's parent is used to evaluate descendant selectors.
*  A parent must also be an IAdvancedStyleClient to participate in
*  advanced style declarations.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function get styleParent():IAdvancedStyleClient

public function set styleParent(styleParent:IAdvancedStyleClient):void

/***
*  Flex calls the <code>stylesInitialized()</code> method when
*  the styles for a component are first initialized.
*
*  <p>This is an advanced method that you might override
*  when creating a subclass of UIComponent. Flex guarantees that
*  your component's styles are fully initialized before
*  the first time your component's <code>measure</code> and
*  <code>updateDisplayList</code> methods are called.  For most
*  components, that is sufficient. But if you need early access to
*  your style values, you can override the stylesInitialized() function
*  to access style properties as soon as they are initialized the first
*  time.</p>
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function stylesInitialized():void


/***
*  @inheritDoc
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function matchesCSSState(cssState:String):Boolean

/***
*  @inheritDoc
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/

public function matchesCSSType(cssType:String):Boolean

        //----------------------------------
        //  IFlexModule methods
        //----------------------------------

        [Inspectable(environment="none")]
/***
*  A module factory is used as context for
*  finding the style manager that controls the styles for this
*  non-visual style client instance.
*
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function get moduleFactory():IFlexModuleFactory


/***
*  @private
*/
public function set moduleFactory(factory:IFlexModuleFactory):void

/***
*  The initialized method is called when this class or a class that
*  extends this class is used in an MXML declaration.
*  It is called after the implementing object has been created and all
*  component properties specified on the MXML tag have
*  been initialized.
*  <p>
*  If the document that created this object is a UIComponent,
*  (e.g. Application, Module, etc.) then the UIComponent's
*  addStyleClient method will be called to add this object to the
*  UIComponent's list of non-visual style clients. This allows the
*  object to inherit styles from the document. </p>
*
*  @param document The MXML document that created this object.
*  @param id The identifier used by the document object to refer to
*  this object.
*  @langversion 3.0
*  @playerversion Flash 9
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function initialized(document:Object, id:String):void

    }
}

spark.formatter.CurrencyFormatter

package spark.formatters
{
/**
* The change event is generated whenever the locale style is changed
* or another property is set that would cause
* the format of a number to change or cause updates to the other
* values available through this class.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Event(name="change", type="flash.events.Event")]

/**
* @The locale identifier that specifies the language, region,
* script and optionally other related tags and keys.
* The syntax of this identifier must follow the syntax defined by the
* Unicode Technical Standard #35 (http//unicode.org/reports.tr35/)
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Style(name="locale", type="String", inherit="yes")]

/**
* The CurrencyFormatter class provides locale-sensitive formatting
* and parsing of currency values. It can format currency amounts stored in
* <code>Number</code> objects.
*
* <p>This class is a wrapper class around the
* <code>flash.globalitaion.CurrencyFormatter</code>. Therefore
* the locale specific formatting
* is provided by the <code>flash.globalitaion.CurrencyFormatter</code>.
* However this CurrencyFormatter class can be used in mxml declartions,
* uses the locale style for the requested Locale ID name, and has
* methods and properties that are Bindable.
* </p><p>
* The flash.globalization.CurrencyFormatter class uses the underlying
* operating system  for the formatting functionalilty and
* to supply the locale specific data. On some operating systems,
* the flash.globalization classes are unsupported, this wrapper
* class provides a fallback functionality in this case.
* </p>
*
* @see flash.globalization.CurrencyFormatter
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    public class CurrencyFormatter extends NumberFormatterBase implements IFormatter
    {
/***
*   Constructs a new CurrencyFormatter object to format numbers
* representing currency amounts according to
* the conventions of a given locale.
* <p>
* The locale for this class is supplied by the locale style. The
* locale style can be set in several ways:
* </p>
* <ul>
* <li>*
* Inheriting the style from a UIComponent by calling the
* UIComponent's addStyleClient method.
* </li>
* <li>
* By using the class in an mxml declaration and inheriting the
* locale from the document that contains the declaration.
* </li>
* <listing version="3.0" >
* &lt;fx:Declarations&gt;
*         &lt;s:StringTools id="st" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* <li>
* By using an mxml declaration and specifying the locale value
* in the list of assignments.
* </li>
* <listing version="3.0" >
* &lt;fx:Declarations&gt;
*      &lt;s:StringTools id="st_turkish" locale="tr-TR" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* <li>
* Calling the setStyle method,
* e.g. <code>st.setStyle("locale", "tr-TR")</code>
* </li>
* </ul>
* <p>
* If the locale style is not set by one of the above techniques,
* the methods of this class that depend on the locale
* will throw an error.
* </p>*
* <p>Certain properties such as the <code>currencySymbol</code>
* and <code>currencyISOCode</code> properties are set
* automatically based on the locale.</p>
*
* <p><strong>NOTE: When a fallback locale is used the currency
* properties are set to default values,
* and therefore the <code>currencySymbol</code> or
* <code>currencyISOCode</code> properties might be given unexpected
* values. It is a good idea to examine the
* <code>currencySymbol</code> and <code>currencyISOCode</code>
* property values before formatting a currency amount.
* </strong></p>
*
* @see actualLocaleIDName
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function CurrencyFormatter()
/***
* @private
*
* Creates actual working instance of a Numberformatter.
*
* The locale and initialMode must have valid values prior to
* this call. Undefined value is not allowed.
*/
        override protected function createWorkingInstance():void

        [Bindable("change")]
/***
* The name of the actual locale ID used by this CurrencyFormatter object.
*
* This is the locale that is used to access the formatting
* data and functionality from the operating system.
*
* If the locale that was set by the locale style is not available,
* then the value of the actualLocaleIDName will
* be different from the value of the locale style.  It will
* indicate the fallback locale that is being used.
* If the locale style was set to <code>LocaleID.DEFAULT</code>
* the name of the locale specified by the user's operating
* system will be used. For more details please see the
* description of the
* <code>flash.globalization.CurrencyFormatter.actualLocaleIDName</code>
* property.
*
* @see #locale
* @see flash.globalization.CurrencyFormatter.actualLocaleIDName
* @see #CurrencyFormatter()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get actualLocaleIDName():String

        [Bindable("change")]
/***
* Creates a string representing a currency amount formatted
* according to the current properties of this CurrencyFormatter object,
* including the locale, currency symbol, and currency ISO code,
* useCurrencySymbol
*
* <p>By default this method uses the <code>currencyISOCode</code>
* property to determine the currency symbol and other
* settings used when formatting.</p>
*
* <p>Many countries and regions use the same currency symbols for
* different currencies.
* For example the United States, Australia, New Zealand, Canada,
* and Mexico all use the same dollar sign symbol ($) for local
* currency values. When the formatting currency differs
* from the user's local currency it is best to use the ISO code as
* the currency string.
* You can use the <code>formattingWithCurrencySymbolIsSafe()</code>
* method to test whether the ISO code of the
* currency to be formatted matches the <code>currencyISOCode</code>
* property of the formatter.
* </p>
*
* <p>This method can format numbers of very large and very small
* magnitudes. However the number of significant digits is
* limited to the precision provided by the Number data type.
* </p>
*
* @param value The numeric value to be formatted into a currency string.
* @param withCurrencySymbol When set to false the
* <code>currencyISOCode</code> property determines which
* currency string or symbol to use in the output string. When
* set to true, the current value of the
* <code>currencySymbol</code> property is used in the output string.
*
*
* @example  In this example the requested locale is
* fr-CA French (Canada). The example assumes that this locale
* is supported in the user's operating system and therefore
* no fallback locale is used.
* For fr-CA the default currency is Canadian dollars with an
* ISO code of CAD. Therefore when formatting a currency
* with the default values, CAD is used as the currency symbol. When
* the <code>withCurrencySymbol</code> parameter is set to
* true the <code>currencySymbol</code>
* property is used to format the currency amount.
*
* <listing version="3.0" >
* var cf:CurrencyFormatter = new CurrencyFormatter("fr-CA");
*
* trace(cf.actualLocaleIDName);               // "fr-CA"
* trace(cf.currencyISOCode);                // "CAD"
* trace(cf.currencySymbol);                // "$"
*
* trace(cf.format(1254.56));                // "1 254,56 CAD"
* trace(cf.format(1254.56, true));            // "1 254,56 $"
* </listing>
*
* <p>The second example shows a method of formatting a currency
* amount in Canadian dollars using the default user's locale.
* The <code>formattingWithCurrencySymbolIsSafe()</code> method
* is used to test to see if the user's default currency is
* Canadian dollars and if so then the format method is used with
* the <code>withCurrencySymbol</code> parameter set to true.
* Otherwise the currency is set to Canadian dollars with
* a more descriptive currency symbol. The example shows how
* the currency would be formatted if the default locale was either
* French (Canada) or English (USA). </p>
*
* <listing version="3.0" >
* var cf:CurrencyFormatter = new CurrencyFormatter(LocaleID.DEFAULT);
*
* if (cf.formattingWithCurrencySymbolIsSafe("CAD")) {
*   trace(cf.actualLocaleIDName);     // "fr-CA French (Canada)"
*   trace(cf.format(1254.56, false)); // "1 254,56 $"
* }
* else {
*   trace(cf.actualLocaleIDName);     // "en-US English (USA)"
*   cf.setCurrency("CAD", "C$")
*   trace(cf.format(1254.56, true));  // "C$ 1,254.56"
* }
* </listing>
*
* @return A string containing the formatted currency value.
*
* @see #currencySymbol
* @see #currencyISOCode
* @see #formattingWithCurrencySymbolIsSafe()
* @see #lastOperationStatus
* @see LastOperationStatus
*
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function format(value:Object):String

        [Bindable("change")]
/***
* The three letter ISO 4217 currency code for the actual locale
* being used.
*
* <p>This code is used to determine the currency symbol or
* string when formatting currency amounts
* using the <code>format()</code> method with
* the <code>useCurrencySymbol</code> property set to
* <code>false</code>.</p>
*
* <p>This property is initialized by the constructor
* based on the actual locale that is used. When a fallback
* locale is used this property reflects the preferred, default
* currency code for the fallback locale.</p>
*
* @default dependent on the actual locale and operating system
*
* @see #format()
* @see #currencySymbol
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
*/
public function get currencyISOCode():String


        [Bindable("change")]
/***
* The currency symbol or string for the actual locale being used.
*
* <p>This property is used as the currency symbol when formatting
* currency amounts using the <code>format()</code> method with
* the <code>withCurrencySymbol</code> parameter set to
* <code>true</code>.</p>
*
* <p>This property is initialized by the constructor based on
* the actual locale that is used. When a fallback
* locale is used this property reflects the preferred, default
* currency symbol for the fallback locale.</p>
*
* @default dependent on the actual locale and operating system
*
* @see #format()
* @see #setCurrency()
* @see #formattingWithCurrencySymbolIsSafe
* @see #currencyISOCode
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
*/
public function get currencySymbol():String

        [Bindable("change")]
/***
* Determines whether the currently specified currency symbol can
* be used when formatting currency amounts.
*
* <p>Many regions and countries use the same currency symbols.
* This method can be used to
* safeguard against the use of an ambiguous currency symbol, or
* a currency symbol or ISO code that
* is different than expected due to the use of a fallback locale.</p>
*
* <p>A common use case for this method is to determine whether
* to show a local currency symbol (if the amount is formatted in
* the user's default currency), or a more specific ISO code
* string (if the amount is formatted in a currency
* different from the user's default).</p>
*
* <p>This method compares the <code>requestedISOCode</code>
* parameter against the current <code>currencyISOCode</code> property,
* returning <code>true</code> if the strings are
* equal and <code>false</code> if they are not.
* When the strings are equal, using the <code>format()</code>
* method with the
* <code>useCurrencySymbol</code> property set to <code>true</code>
* results in a formatted currency value string
* with a unique currency symbol for the locale.
* If this method returns false, then using the <code>format()</code>
* method with the <code>useCurrencySymbol</code>
* property set to true could result in the use of an ambiguous
* or incorrect currency symbol.
* </p>
*
* @param requestedISOCode A three letter ISO 4217 currency code
* (for example, USD for US dollars, EUR for Euros).
* Must contain three uppercase letters from A to Z.
*
* @throws TypeError if the <code>requestedISOCode</code> parameter
* is null.
*
* @return <code>true</code> if the <code>currencyISOCode</code>
* property matches the <code>requestedISOCode</code> parameter;
* otherwise <code>false</code>.
*
* @see #currencySymbol
* @see #currencyISOCode
* @see #useCurrencySymbol
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public  function formattingWithCurrencySymbolIsSafe(requestedISOCode:String):Boolean

        [Bindable("change")]
/***
* Enables the use of the currencySymbol when formatting
* currency amounts.
*
* <p>When the <code>withCurrencySymbol</code> property is
* set to <code>true</code>, the value of the
* <code>currencySymbol</code> property is used
* in the string returned by the format method.
* For example: <code>$ 123,456,789.22</code></p>
*
* <p>When the <code>withCurrencySymbol</code> property is set to
* <code>false</code>, the value of the <code>currencyISOCode</code>
* property is used in the string returned by the format method.
* For example: <code>USD 123456789.22</code></p>
*
* @default false
*
* @see #formattingWithCurrencySymbolIsSafe
* @see #format
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get useCurrencySymbol():Boolean
public function set useCurrencySymbol(value:Boolean):void

        [Bindable("change")]
/***
*   A numeric value that indicates a formatting pattern for negative
* currency amounts. This pattern defines the location of the
* currency symbol and the negative symbol or parentheses in
* relation to the numeric portion of the currency
* amount.
*
*   <p>The value of this property must be one of the constants
* defined in the table below.
* </p>
*
* <p> The table below summarizes the possible formatting patterns
* for negative currency amounts. When a currency amount is formatted
* with the <code>format()</code> method:</p>
*
* <ul>
*   <li>The '&#164;' symbol is replaced with the value of the
*       <code>currencyISOCode</code> or
*       the <code>currencySymbol</code> property, depending on
*       the value of the <code>withCurrencySymbol</code> parameter
*       passed to the <code>format()</code> method;</li>
*   <li>The '-' character is replaced with the value of the
*       <code>negativeNumberSymbol</code> property;</li>
*   <li>The 'n' character is replaced with the currency amount
*       value that is passed to the <code>format()</code> method.</li>
* </ul>
*
*    <table class="innertable" border="0">
*        <tr>
*            <td>Negative currency format type</td>
*            <td>Formatting pattern</td>
*        </tr>
*        <tr>
*            <td>0</td>
*            <td>(&#164;n)</td>
*        </tr>
*        <tr>
*            <td>1</td>
*            <td>-&#164;n</td>
*        </tr>
*        <tr>
*            <td>2</td>
*            <td>&#164;-n</td>
*        </tr>
*        <tr>
*            <td>3</td>
*            <td>&#164;n-</td>
*        </tr>
*        <tr>
*            <td>4</td>
*            <td>(n&#164;)</td>
*        </tr>
*        <tr>
*            <td>5</td>
*            <td>-n&#164;</td>
*        </tr>
*        <tr>
*            <td>6</td>
*            <td>n-&#164;</td>
*        </tr>
*        <tr>
*            <td>7</td>
*            <td>n&#164;-</td>
*        </tr>
*        <tr>
*            <td>8</td>
*            <td>-n &#164;</td>
*        </tr>
*        <tr>
*            <td>9</td>
*            <td>-&#164; n</td>
*        </tr>
*        <tr>
*            <td>10</td>
*            <td>n &#164;-</td>
*        </tr>
*        <tr>
*            <td>11</td>
*            <td>&#164; n-</td>
*        </tr>
*        <tr>
*            <td>12</td>
*            <td>&#164; -n</td>
*        </tr>
*        <tr>
*            <td>13</td>
*            <td>n- &#164;</td>
*        </tr>
*        <tr>
*            <td>14</td>
*            <td>(&#164; n)</td>
*        </tr>
*        <tr>
*            <td>15</td>
*            <td>(n &#164;)</td>
*        </tr>
*    </table>
*
*
* @default dependent on the actual locale and operating system
*
* @throws ArgumentError if the assigned value is not between 0 and 15.
*
* @see #format()
* @see #currencySymbol
* @see #negativeSymbol
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get negativeCurrencyFormat():int
public function set negativeCurrencyFormat(value:int):void

        [Bindable("change")]
/***
*    A numeric value that indicates a formatting pattern for positive
* currency amounts. This format defines the location of currency symbol
* relative to the numeric portion of the currency amount.
*
*   <p>The value of this property must be one of the constants
* defined in the table below.
* </p>
*
* <p> The table below summarizes the possible formatting patterns
* for positive currency amounts.
* When a currency amount is formatted with the <code>format()</code>
* method:</p>
*
* <ul>
*   <li>The '&#164;' symbol is replaced with the value of the
*       <code>currencyISOCode</code> or
*       the <code>currencySymbol</code> property, depending on the
*       value of the <code>withCurrencySymbol</code> parameter
*       passed to the <code>format()</code> method;</li>
*   <li>The 'n' character is replaced with the currency amount value
*       that is passed to the <code>format()</code> method.</li>
* </ul>
*
*    <table class="innertable" border="0">
*        <tr>
*            <td>Positive currency format type</td>
*            <td>Formatting pattern</td>
*        </tr>
*        <tr>
*            <td>0</td>
*            <td>&#164;n</td>
*        </tr>
*        <tr>
*            <td>1</td>
*            <td>n&#164;</td>
*        </tr>
*        <tr>
*            <td>2</td>
*            <td>&#164; n</td>
*        </tr>
*        <tr>
*            <td>3</td>
*            <td>n &#164;</td>
*        </tr>
*    </table>
*
* @throws ArgumentError if the assigned value is not between 0 and 3.
*
* @default dependent on the actual locale and operating system
*
* @see #currencySymbol
* @see #format()
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get positiveCurrencyFormat():int
public function set positiveCurrencyFormat(value:int):void


        [Bindable("change")]
/***
* Parses a string into a currency amount and a currency symbol.
*
* <p>The parsing algorithm uses the value of the
* <code>decimalSeparator</code> property to determine the
* integral and fractional portion of the number. It uses the
* values of the <code>negativeCurrencyFormat</code> and
* <code>positiveCurrencyFormat</code> properties to determine
* the location of the currency symbol or string relative to the
* currency amount.For negative amounts the value of the
* <code>negativeCurrencyFormat</code> property determines the
* location of the negative symbol and whether parentheses are used.</p>
*
* <p>If the order of the currency symbol, minus sign, and number in
* the input string does not match the pattern identified by the
* <code>negativeCurrencyFormat</code> and
* <code>positiveCurrencyFormat</code> properties, then:</p>
*
* <ol>
*   <li>The <code>value</code> property of the returned
*       CurrencyParseResult object is set to <code>NaN</code>.</li>
*   <li>The <code>currencyString</code> property of the returned
*       CurrencyParseResult object is set to <code>null</code>.</li>
*   <li>The <code>lastOperationStatus</code> property is set to
*       indicate that parsing failed.</li>
* </ol>
*
* <p>The input string may include space characters, which are
* ignored during the parsing.</p>
*
* <p>Parsing can succeed even if there is no currency symbol.
* No validation is done of the portion of the string
* corresponding to the currency symbol. If there is no currency
* symbol or string, the <code>currencyString</code> property
* in the returned CurrencyParseResult object is set to an
* empty string.</p>
*
*
* @param inputString The input string to parse.
*
* @return A CurrencyParseResult object containing the numeric
* value and the currency symbol or string.
*
* @throws TypeError if the <code>inputString</code> parameter is null.
*
* @see #decimalSeparator
* @see #negativeCurrencyFormat
* @see #positiveCurrencyFormat
* @see flash.globalization.CurrencyParseResult
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public  function parse(inputString:String):CurrencyParseResult


/***
* Lists all of the locale ID names supported by this class.
*
* @return A vector of strings containing all of the locale ID
* names supported by this class and operating system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
        static public function getAvailableLocaleIDNames():Vector.<String>
/***
* @private
*
*/
    }
}

spark.formatter.DateTimeFormatter

package spark.formatters
{


/**
* The change event is generated whenever the locale style is changed or
* another property is set that would cause the format of a date to change
* or cause updates to the other values available through this class.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
[Event(name="change", type="flash.events.Event")]

/**
* The locale identifier that specifies the language, region, script and
* optionally other related tags and keys.
*
* The syntax of this identifier must follow the syntax defined by the
* Unicode Technical Standard #35 (http//unicode.org/reports.tr35/)
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
[Style(name="locale", type="String", inherit="yes")]

/**
* The <code>DateTimeFormatter</code> class provides locale-sensitve
* formatting for a <code>Date</code> object.
*
* <p>This class is a wrapper class around the
* <code>flash.globalitaion.DateTimeFormatter</code>.
* Therefore the locale specific formatting functionality and the month
* names, day names and the first day of the week are provided by the
* <code>flash.globalitaion.DateTimeFormatter</code>.
* However this DateTimeFormatter class can be used in mxml declartions,
* uses the locale style for the requested Locale ID name, and has methods
* and properties that are Bindable.
* Additionally events are generated if there is an error or warning
* generated by the flash.globalization class.</p>
*
* <p>The <code>flash.globalization.DateTimeFormatter</code> class use the
* underlying operating system  for the formatting functionalilty and to
* supply the locale specific data.
* On some operating systems, the <code>flash.globalization</code> classes
* are unsupported, this wrapper class provides a fallback functionality in
* this case.</p>
*
* @see flash.globalization.DateTimeFormatter
*/
public class DateTimeFormatter extends GlobalizationBase implements IFormatter


/**
* Constructs a new <code>DateTimeFormatter</code> object to format
* dates and times according to the conventions of the specified locale
* and the provided date and time formatting styles.
*
* Date and time styles are used to set date and time formatting
* patterns to predefined, locale dependent patterns from the operating
* system.
*
* <p>This constructor will determine if the current operating system
* supports the requested locale ID name.
* If it is not supported then a fallback locale will be used instead.
* The name of the fallback locale ID can be determined from the
* <code>actualLocaleIDName</code> property.</p>
*
* <p>To format based on the user's current operating system
* preferences, pass the value <code>LocaleID.DEFAULT</code> in the
* <code>locale</code> parameter to the constructor.</p>
*
* <p>The constructor will dispatch a
* <code>GlobalizationStatusEvent.LAST_OPERATION_STATUS</code> event in
* cases where the <code>flash.globalization.DateTimeFormatter</code>
* class set the <code>LastOperationStatus</code> property to something
* other than <code>LastOperationStatus.NO_ERROR</code>.
* For example if the locale, dateStyle, or timeStyle result in the use
* of a fallback being used, the
* <code>GlobalizationStatusEvent.LAST_OPERATION_STATUS</code> event
* will be dispatched.</p>
*
* @param locale The preferred locale ID name to use when determining
*         date or time formats.
* @param dateStyle Specifies the style to use when formatting dates.
*         The value should correspond to one of the values enumerated
*         by the <code>DateTimeStyle</code> class:
*         <ul>
*             <li><code>DateTimeStyle.LONG</code> </li>
*             <li><code>DateTimeStyle.MEDIUM</code></li>
*             <li><code>DateTimeStyle.SHORT</code> </li>
*             <li><code>DateTimeStyle.NONE</code> </li>
*         </ul>
* @param timeStyle Specifies the style to use when formatting times.
*         The value should correspond to one of the values enumerated
*         by the <code>DateTimeStyle</code> class:
*         <ul>
*             <li><code>DateTimeStyle.LONG</code> </li>
*             <li><code>DateTimeStyle.MEDIUM</code></li>
*             <li><code>DateTimeStyle.SHORT</code> </li>
*             <li><code>DateTimeStyle.NONE</code> </li>
*         </ul>
*
* @throws ArgumentError if the <code>dateStyle</code> or
*          <code>timeStyle</code> parameter is not a valid
*          <code>DateTimeStyle</code> constant.
* @throws TypeError if the <code>locale</code>, <code>dateStyle</code>
*          or <code>timeStyle</code> parameter is null.
*
* @see #locale
* @see #actualLocaleIDName
* @see #dateStyle
* @see #timeStyle
* @see #dateTimePattern
* @see spark.events.GlobalizationStatusEvent.LAST_OPERATION_STATUS
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function DateTimeFormatter(dateStyle:String="long", timeStyle:String="long")
/**
* @private
*
* Creates actual working instance of BasicCollator.
*
* The locale and initialMode must have valid values prior to this call.
* Undefined value is not allowed.
*/
override protected function createWorkingInstance():void
/**
* @copy spark.utils.Collator@lastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.1
* @productversion Flex 4.5
*/
public function get lastOperationStatus():String

[Bindable("change")]
/**
* The time style for this instance of the DateTimeFormatter.
*
* The time style is used to retrieve a predefined time and locale
* specific formatting pattern from the operating system.
* When formatting a date, the <code>locale</code> style, the
* <code>timeStyle</code> and the <code>dateStyle</code> properties
* determine the format of the date.
*
* The time style value can be set in the following three ways:
* assigning a value to <code>timeStyle</code> property,
* <code>dateTimePattern</code> property, or the timeStyle parameter in
* the <code>DateTimeFormatter()</code> constructor.
*
* <p>Possible values for the timeStyle property are:</p>
*
* <ul>
* <li><code>DateTimeStyle.LONG</code></li>
* <li><code>DateTimeStyle.MEDIUM</code></li>
* <li><code>DateTimeStyle.SHORT</code></li>
* <li><code>DateTimeStyle.NONE</code></li>
* <li><code>DateTimeStyle.CUSTOM</code></li>
* </ul>
*
* @default <code>DateTimeStyle.LONG</code>
*
* @throws ArgumentError if the a not a valid <code>DateTimeStyle</code>
*          constant or is <code>DateTimeStyle.CUSTOM </code>.
*
* @throws TypeError if the <code>dateStyle</code> or
*          <code>timeStyle</code> parameter is null.
*
* @see #dateStyle
* @see #dateTimePattern
* @see flash.globalization.DateTimeStyle
* @see #DateTimeFormatter()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get timeStyle():String

[Inspectable(category="General", enumeration="long,medium,short,none", defaultValue="long")]
public function set timeStyle(value:String):void

[Bindable("change")]
/**
* The date style for this instance of the DateTimeFormatter.
*
* The date style is used to retrieve a predefined time and locale
* specific formatting pattern from the operating system.
* When formatting a date, the <code>locale</code> style, the
* <code>timeStyle</code> and the <code>dateStyle</code> properties
* determine the format of the date.
*
* The date style value can be set in the following three ways:
* assigning a value to <code>dateStyle</code> property,
* <code>dateTimePattern</code> property, or the dateStyle parameter in
* the <code>DateTimeFormatter()</code> constructor.
*
* <p>Possible values for the timeStyle property are:</p>
*
* <ul>
* <li><code>DateTimeStyle.LONG</code> </li>
* <li><code>DateTimeStyle.MEDIUM</code> </li>
* <li><code>DateTimeStyle.SHORT </code></li>
* <li><code>DateTimeStyle.NONE </code></li>
* <li><code>DateTimeStyle.CUSTOM </code></li>
* </ul>
*
* @default <code>DateTimeStyle.LONG</code>
*
* @throws ArgumentError if the assigned value is not a valid
*          <code>DateTimeStyle</code> constant or is
*          <code>DateTimeStyle.CUSTOM </code>.
* @throws TypeError if the <code>dateStyle</code> or
*          <code>timeStyle</code> parameter is null.
*
* @see #dateStyle
* @see #dateTimePattern
* @see #lastOperationStatus
* @see flash.globalization.DateTimeStyle
* @see #DateTimeFormatter()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get dateStyle():String

[Inspectable(category="General", enumeration="long,medium,short,none",defaultValue="long")]
public function set dateStyle(value:String):void



[Bindable("change")]
/**
* The name of the actual locale ID used by this
* <code>DateTimeFormatter</code> object.
*
* This is the locale that is used to access the formatting data and
* functionality from the operating system.
*
* If the locale that was set by the locale style is not available, then
* value of the <code>actualLocaleIDName</code> will be different from
* the value of the locale style.
* It will indicate the fallback locale that is being used.
* If the locale style was set to <code>LocaleID.DEFAULT</code> the name
* of the locale specified by the user's operating system will be used.
* For more details please see the description of the
* <code>flash.globalization.DateTimeFormatter.actualLocaleIDName</code>
* property.
*
* @see #locale
* @see flash.globalization.DateTimeFormatter.actualLocaleIDName
* @see #DateTimeFormatter()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get actualLocaleIDName():String

[Bindable("change")]
/**
* A boolean flag to control whethor the local or the UTC date and time
* values are used when the formatting a date.
*
* If <code>useUTC</code> is set to true then the UTC values are used.
* If the value is false, then the date time values of the operating
* system's current time zone is used.
*
* @see #format
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get useUTC():Boolean
public function set useUTC(value:Boolean):void

[Bindable("change")]
/**
* Formats a display string for a Date object in either the user's local
* time or UTC time.
*
* A <code>Date</code> object has two sets of date and time values,
* those in the user's local time (date, day, fullYear, hours, minutes,
* month, and seconds) and those in UTC time (dateUTC, dayUTC,
* fullYearUTC, hoursUTC, minutesUTC, monthUTC, and secondsUTC).
* The boolean property <code>useUTC</code> controls which set of
* date and time components are used when formatting the date.
* The formatting will be done using the conventions of the locale as
* set by the <code>locale</code> style property and the
* <code>dateStyle</code> and <code>timeStyle</code> properties, or the
* <code>dateTimePattern</code>, specified for this
* <code>DateTimeFormatter</code> instance.
*
*
* @param value A <code>Date</code> value to be formatted.
* @return A formatted string representing the date or time value.
*
* @see #dateStyle
* @see #timeStyle
* @see #dateTimePattern
* @see DateTimeFormatter
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function format(value:Object):String
/**
* Lists all of the locale ID names supported by this class.
*
* @return A vector of strings containing all of the locale ID names
*          supported by this class and operating system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function getAvailableLocaleIDNames():Vector.<String>

[Bindable("change")]
/**
* Retrieves a list of localized strings containing the month names for
* the current calendar system.
*
* The first element in the list is the name for the first month of the
* year.
*
*
* @param nameStyle Indicates the style of name string to be used.
*          Valid values are:
*          <ul>
*              <li><code>DateTimeNameStyle.FULL</code></li>
*              <li><code>DateTimeNameStyle.LONG_ABBREVIATION</code>
*                  </li>
*              <li><code>DateTimeNameStyle.SHORT_ABBREVIATION</code>
*                  </li>
*          </ul>
* @param context A code indicating the context in which the formatted
*          string will be used.
*          This context will only make a difference for certain
*          locales.
*          Valid values are:
*          <ul>
*              <li><code>DateTimeNameContext.FORMAT</code></li>
*              <li><code>DateTimeNameContext.STANDALONE</code></li>
*          </ul>
*
* @return A vector of localized strings containing the month names for
*          the specified locale, name style and context.
*          The first element in the vector, at index 0, is the name for
*          the first month of the year; the next element is the name
*          for the second month of the year; and so forth.
* @throws TypeError if the <code>nameStyle</code> or
*          <code>context</code> parameter is null.
*
* @see flash.globalization.DateTimeNameContext
* @see flash.globalization.DateTimeNameStyle
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function getMonthNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>

[Bindable("change")]
/**
* Retrieves a list of localized strings containing the names of
* weekdays for the current calendar system.
*
* The first element in the list represents the name for Sunday.
*
* @param nameStyle Indicates the style of name string to be used.
*          Valid values are:
*          <ul>
*              <li><code>DateTimeNameStyle.FULL</code></li>
*              <li><code>DateTimeNameStyle.LONG_ABBREVIATION</code>
*                  </li>
*              <li><code>DateTimeNameStyle.SHORT_ABBREVIATION</code>
*                  </li>
*          </ul>
* @param context A code indicating the context in which the formatted
*          string will be used.
*          This context only applies for certain locales where the name
*          of a month changes depending on the context.
*          For example, in Greek the month names are different if they
*          are displayed alone versus displayed along with a day.
*          Valid values are:
*          <ul>
*              <li><code>DateTimeNameContext.FORMAT</code></li>
*              <li><code>DateTimeNameContext.STANDALONE</code></li>
*          </ul>
*
* @return A vector of localized strings containing the month names for
*          the specified locale, name style and context.
*          The first element in the vector, at index 0, is the name for
*          Sunday; the next element is the name for Monday; and so
*          forth.
* @throws TypeError if the <code>nameStyle</code> or
*          <code>context</code> parameter is null.
*
* @see flash.globalization.DateTimeNameContext
* @see flash.globalization.DateTimeNameStyle
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function getWeekdayNames(nameStyle:String = "full", context:String = "standalone"):Vector.<String>

[Bindable("change")]
/**
* Returns an integer corresponding to the first day of the week for
* this locale and calendar system.
*
* A value of 0 corresponds to Sunday, 1 corresponds to Monday and so
* on, with 6 corresponding to Saturday.
*
* @return An integer corresponding to the first day of the week for
* this locale and calendar system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function getFirstWeekday():int

[Bindable("change")]
/**
* The pattern string used by the DateTimeFormatter object to format
* dates and times.
*
* <p>This pattern can be set in one of three ways:</p>
*
* <ol>
*     <li>By the <code>dateStyle</code> and <code>timeStyle</code>
*     parameters used in the constructor</li>
*     <li>By the <code>dateSytl()</code> and <code>timeStyle</code>
*     properties </li>
*     <li>By the <code>dateTimePattern()</code> property.</li>
* </ol>
*
* <p>If this property is assigned a value directly, as a side effect,
* the current time and date styles will be overriden and
* set to the value <code>DateTimeStyle.CUSTOM</code>.</p>
*
* <p>For a description of the pattern syntax please see the
* <a href="flash.globalization.DateTimeFormatter.setDateTimePattern()">
* <code>flash.globalization.DateTimeFormatter.setDateTimePattern()
* </code></a> method.</p>
*
* @return A string containing the pattern used by this
* DateTimeFormatter object to format dates and times.
*
* @see DateTimeFormatter
* @see #dateStyle()
* @see #timeStyle()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get dateTimePattern():String

public function set dateTimePattern(value:String):void


	}
}


spark.formatter.NumberFormatter

package spark.formatters
{
/**
* The change event is generated whenever the locale style is changed or
* another property is set that would cause
* the format of a number to change or cause updates to the other
* values available through this class.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Event(name="change", type="flash.events.Event")]

/**
* @The locale identifier that specifies the language, region, script
* and optionally other related tags and keys.
* The syntax of this identifier must follow the syntax defined
* by the Unicode Technical Standard #35 (http//unicode.org/reports.tr35/)
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Style(name="locale", type="String", inherit="yes")]

/**
* The NumberFormatter class provides locale-sensitive formatting and
* parsing of numeric values. It can format <code>int</code>,
* <code>uint</code>, and <code>Number</code> objects.
*
* <p>This class is a wrapper class around the <code>flash.globalitaion.
* NumberFormatter</code>. Therefore the locale specific formatting
* is provided by the <code>flash.globalitaion.NumberFormatter</code>.
* However this NumberFormatter class can be used in mxml declartions,
* uses the locale style for the requested Locale ID name, and has
* methods and properties that are Bindable.  Additionally events are
* generated if there is an error or warning generated by the
* flash.globalization class.
*  </p><p>
* The flash.globalization.NumberFormatter class use the underlying
* operating system  for the formatting functionalilty and
* to supply the locale specific data. On some operating systems, the
* flash.globalization classes are unsupported, this wrapper
*  class provides a fallback functionality in this case.
*  </p>
*
* @see flash.globalization.NumberFormatter
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    public class NumberFormatter extends NumberFormatterBase implements IFormatter
    {


/***
*Constructs a new NumberFormatter object to format numbers according
* to the conventions of a given locale.
* <p>
* The locale for this class is supplied by the locale style.
* The locale style can be set in several ways:
* </p>
* <ul>
* <li>*
* Inheriting the style from a UIComponent by calling the UIComponent's
* addStyleClient method.
* </li>
* <li>
* By using the class in an mxml declaration and inheriting the
* locale from the document that contains the declaration.
* <listing version="3.0" >
* &lt;fx:Declarations&gt;
*         &lt;s:NumberFormatter id="nf" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
* <li>
* By using an mxml declaration and specifying the locale value in
* the list of assignments.
* <listing version="3.0" >
* &lt;fx:Declarations&gt;
*      &lt;s:NumberFormatter id="nf_French_France" locale="fr_FR" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
* <li>
* Calling the setStyle method, e.g.
* <code>nf.setStyle("locale", "fr-FR")</code>
* </li>
* </ul>
* <p>
* If the locale style is not set by one of the above techniques,
* the methods of this class that depend on the locale
* will throw an error.
* </p>*
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function NumberFormatter()

/***
* @private
*
* Creates actual working instance of a Numberformatter.
*
* The locale and initialMode must have valid values prior to
* this call. Undefined value is not allowed.
*/
        override protected function createWorkingInstance():void

        [Bindable("change")]
/***
* The name of the actual locale ID used by this NumberFormatter object.
*
* This is the locale that is used to access the formatting
* data and functionality from the operating system.
*
* If the locale that was set by the locale style is not available,
* then the value of the actualLocaleIDName will
* be different from the value of the locale style.  It will indicate
* the fallback locale that is being used.
* If the locale style was set to <code>LocaleID.DEFAULT</code> the
* name of the locale specified by the user's operating
* system will be used. For more details please see the description
* of the
* <code>flash.globalization.NumberFormatter.actualLocaleIDName</code>
* property.
* @see #locale
* @see flash.globalization.NumberFormatter.actualLocaleIDName
* @see #NumberFormatter()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get actualLocaleIDName():String
        [Bindable("change")]
/***
* Formats a number.
* <p>This function formats the number based on the property values
* of the formatter. If the properties are
* not modified after the the locale style is set, the numbers
* are formatted according to the locale specific conventions
* provided by the operating system for the locale identified
* by actualLocaleIDName.  To customize the format, the properties
* can be altered to control specific aspects of formatting a number.
* </p>
*
* <p> Very large numbers and very small magnitude numbers can be
* formatted with this function. However, the
* number of significant digits is limited to the precision provided
* by the Number object. Scientific notation is not supported.
* </p>
*
*    @param    value    A Number value to format.
*    @return            A formatted number string.
*
* @see NumberFormatter
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function format(value:Object):String

        [Bindable("change")]
/***
* A numeric value that indicates a formatting pattern for negative
* numbers.
* This pattern defines the location of the negative symbol
* or parentheses in relation to the numeric portion of the
* formatted number.
*
* <p> The following table summarizes the possible formats for
* negative numbers. When a negative number is formatted,
* the minus sign in the format is replaced with the value of
* the <code>negativeSymbol</code> property and the 'n' character is
* replaced with the formatted numeric value.</p>
*
*    <table class="innertable" border="0">
*        <tr>
*            <td>Negative number format type</td>
*            <td>Format</td>
*        </tr>
*        <tr>
*            <td>0</td>
*            <td>(n)</td>
*        </tr>
*        <tr>
*            <td>1</td>
*            <td>-n</td>
*        </tr>
*        <tr>
*            <td>2</td>
*            <td>- n</td>
*        </tr>
*        <tr>
*            <td>3</td>
*            <td>n-</td>
*        </tr>
*        <tr>
*            <td>4</td>
*            <td>n -</td>
*        </tr>
*    </table>
*
*
* @default dependent on the locale and operating system.
*
* @throws ArgumentError if the assigned value is not a number
* between 0 and 4.
*
* @see #negativeSymbol
* @see #format()
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get negativeNumberFormat():uint
public function set negativeNumberFormat(value:uint):void

        [Bindable("change")]
/***
* Parses a string and returns a NumberParseResult object containing
* the parsed elements.
*
* <p>The NumberParseResult object contains
* the value of the first number found in the input string, the
* starting index for the number within the string, and the index
* of the first character after the number in the string.</p>
*
* <p> If the string does not contain a number, the value property of
* the NumberParseResult is set to <code>NaN</code> and the
* <code>startIndex</code> and <code>endIndex</code> properties are
* set to the hexadecimal value <code>0x7fffffff</code>.
* </p>
*
* <p>This function uses the value of the <code>decimalSeparator</code>
* property to determine the portion of the number
* that contains fractional
* digits, and the <code>groupingSeparator</code> property to determine
* which characters are allowed within the digits of a number,
* and the <code>negativeNumberFormat</code> property to control
* how negative values are represented. </p>
*
* <p>The following table identifies the result of strings parsed
* for the various NegativeNumberFormat values:</p>
*    <table class="innertable" border="0">
*        <tr>
*            <td>NegativeNumberFormat</td>
*            <td>Input String</td>
*            <td>Result</td>
*         </tr>
*        <tr>
*            <td>(n)</td>
*            <td>"(123)" or "( 123 )"</td>
*            <td>"-123"</td>
*        </tr>
*        <tr>
*            <td>-n</td>
*            <td>"-123" or "- 123"</td>
*            <td>"-123"</td>
*        </tr>
*        <tr>
*            <td>- n</td>
*            <td>"-123" or "- 123"</td>
*            <td>"-123"</td>
*        </tr>
*        <tr>
*            <td>n-</td>
*            <td>"123-" or "123 -"</td>
*            <td>"-123"</td>
*        </tr>
*        <tr>
*            <td>n -</td>
*            <td>"123-" or "123 -"</td>
*            <td>"-123"</td>
*        </tr>
*    </table>
*
* <p>A single white space is allowed between the number and the
* minus sign or parenthesis.</p>
*
* <p>Other properties are ignored when determining a valid number.
* Specifically the value of the
* <code>digitsType</code> property is ignored and the digits can be
* from any of
* the digit sets that are enumerated in the NationalDigitsType class.
* The values of the <code>groupingPattern</code>
* and <code>useGrouping</code> properties do not influence the
* parsing of the number.
* </p>
*
* <p> If numbers are preceded or followed in the string by a
* plus sign '+', the plus sign is treated as
* a character that is not part of the number.
* </p>
*
* <p> This function does not parse strings containing numbers
* in scientific notation (e.g. 1.23e40).</p>
*
*
* @example The following code parses a number from a string and
* retrieves the prefix and suffix:
* <listing version="3.0" >
* var nf:NumberFormatter = new NumberFormatter("fr-FR");
* var str:String = "1,56 m&#232;tre"
* var result:NumberParseResult = nf.parse(str);
* trace(result.value) // 1.56
* trace(str.substr(0,result.startIndex));                // ""
* trace(str.substr(result.startIndex, result.endIndex)); // "1,56"
* trace(str.substr(result.endIndex));                 // " m&#232;tre"
* </listing>
*
* @param inputString The input string to parse.
*
* @return A NumberParseResult object containing the numeric value
* and the indices for the start and end of the portion of the string
* that contains the number.
*
* @throws TypeError if the <code>inputString</code> parameter is null.

 * * @see flash.globalization.NumberParseResult
* @see #parseNumber()
* @see flash.globalization.NationalDigitsType
*
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function parse(inputString:String):NumberParseResult

        [Bindable("change")]
/***
* Parses a string that contains only digits and optional whitespace
* characters and returns a Number. If the string does not begin
* with a number or contains characters other than whitespace that
* are not part of the number, then this method returns
* <code>NaN</code>. White space before or after
* the numeric digits is ignored. A white space
* character is a character that has a Space Separator (Zs) property
* in the Unicode Character Database (see http://www.unicode.org/ucd/).
*
* <p> If the numeric digit is preceded or followed by a
* plus sign '+' it is treated as a non-whitespace character.
* The return value is <code>NaN</code>.
* </p>
*
* <p> See the description of the parse function for more information
* about number parsing and what constitutes a valid number.
* </p>
*
*
* @throws TypeError if the parseString is <code>null</code>
*
* @see #parse()
* @see flash.globalization.NationalDigitsType
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function parseNumber(parseString:String):Number

/***
* Lists all of the locale ID names supported by this class.
*
* @return A vector of strings containing all of the locale
* ID names supported by this class and operating system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
        static public function getAvailableLocaleIDNames():Vector.<String>

}
}

spark.formatters.[NumberFormatterBase]

package spark.formatters
{
    public class NumberFormatterBase extends GlobalizationBase

/***
* @ private
*/
protected var g11nWorkingInstance:Object = null;
protected var properties:Object = null;

public function NumberFormatterBase()


        [Bindable("change")]
/***
*    The maximum number of digits that can appear after the decimal
* separator.
*
*    <p>Numbers are rounded to the number of digits specified by this
* property. <strong>The rounding scheme
* varies depending on the user's operating system.</strong></p>
*
* <p>When the <code>trailingZeros</code> property is set to
* <code>true</code>, the fractional portion of the
* number (after the decimal point) is padded with trailing zeros
* until its length matches the value of this
* <code>fractionalDigits</code> property.</p>
*
* @default dependent on the locale and operating system.
*
* @see #trailingZeros
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get fractionalDigits():int
public function set fractionalDigits(value:int):void

        [Bindable("change")]
/***
*    Enables the use of the grouping separator when formatting numbers.
*
*    <p>When the <code>useGrouping</code> property is set to
* <code>true</code>, digits are grouped and
* delimited by the grouping separator character.
* For example: <code>123,456,789.22</code></p>
*
*    <p>When the <code>useGrouping</code> property is set to
* <code>false</code>, digits are not grouped or separated.
* For example: <code>123456789.22</code></p>

*    <p>The symbol to be used as a grouping separator is defined
* by the <code>groupingSeparator</code> property. The number of digits
* between grouping separators is defined by the
* <code>groupingPattern</code> property.</p>
*
* @see #groupingPattern
* @see #groupingSeparator
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get useGrouping():Boolean
public function set useGrouping(value:Boolean):void

        [Bindable("change")]
/***
*    Describes the placement of grouping separators within the
* formatted number string.
*
* <p>When the <code>useGrouping</code> property is set to true,
* the <code>groupingPattern</code> property is used
* to define the placement and pattern used for the grouping
* separator.</p>
*
* <p>The grouping pattern is defined as a string containing
* numbers separated by semicolons and optionally may end
* with an asterisk. For example: <code>"3;2;&#42;"</code>.
* Each number in the string represents the number of digits
* in a group. The grouping separator is placed before each
* group of digits. An asterisk at the end of the string
* indicates that groups with that number of digits should be
* repeated for the rest of the formatted string.
* If there is no asterisk then there are no additional groups
* or separators for the rest of the formatted string. </p>
*
* <p>The first number in the string corresponds to the first
* group of digits to the left of the decimal separator.
* Subsequent numbers define the number of digits in subsequent
* groups to the left. Thus the string "3;2;&#42;"
* indicates that a grouping separator is placed after the first
* group of 3 digits, followed by groups of 2 digits.
* For example: <code>98,76,54,321</code></p>
*
* <p>The following table shows examples of formatting the
* number 123456789.12 with various grouping patterns.
* The grouping separator is a comma and the decimal separator
* is a period.
* </p>
*     <table class="innertable" border="0">
*           <tr>
*                 <td>Grouping Pattern</td>
*                 <td>Sample Format</td>
*           </tr>
*           <tr>
*                 <td><code>3;&#42;</code></td>
*                 <td>123,456,789.12</td>
*           </tr>
*           <tr>
*                 <td><code>3;2;&#42;</code></td>
*                 <td>12,34,56,789.12</td>
*           </tr>
*           <tr>
*                 <td><code>3</code></td>
*                 <td>123456,789.12</td>
*           </tr>
*     </table>
*
* <p>Only a limited number of grouping sizes can be defined.
* On some operating systems, grouping patterns can only contain
* two numbers plus an asterisk. Other operating systems can
* support up to four numbers and an asterisk.
* For patterns without an asterisk, some operating systems
* only support one number while others support up to three numbers.
* If the maximum number of grouping pattern elements is exceeded,
* then additional elements
* are ignored and the <code>lastOperationStatus</code> property
* is set to indicate that a fall back value is
* being used.
* </p>
*
*
* @throws TypeError if this property is assigned a null value.
*
* @default dependent on the locale and operating system.
*
* @see #groupingSeparator
* @see #useGrouping
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get groupingPattern():String
public function set groupingPattern(value:String):void

       [Bindable("change")]
/***
* Defines the set of digit characters to be used when
* formatting numbers.
*
* <p>Different languages and regions use different sets of
* characters to represent the
* digits 0 through 9.  This property defines the set of digits
* to be used.</p>
*
* <p>The value of this property represents the Unicode value for
* the zero digit of a decimal digit set.
* The valid values for this property are defined in the
* NationalDigitsType class.</p>
*
* @default dependent on the locale and operating system.
*
* @see flash.globalization.NationalDigitsType
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get digitsType():uint
public function set digitsType(value:uint):void
        [Bindable("change")]
/***
*    The decimal separator character used for formatting or parsing
* numbers that have a decimal part.
*
*    <p>This property is initially set based on the locale that
* is selected when the formatter object
* is constructed.</p>
*
*
* @throws TypeError if this property is assigned a null value.
*
* @default dependent on the locale and operating system.
*
* @see #format()
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get decimalSeparator():String
public function set decimalSeparator(value:String):void

        [Bindable("change")]
/***
*    The character or string used for the grouping separator.
*
*    <p>The value of this property is used as the grouping
* separator when formatting numbers with the
* <code>useGrouping</code> property set to <code>true</code>. This
* property is initially set based on the locale that is selected
* when the formatter object is constructed.</p>
*
* @throws TypeError if this property is assigned a null value.
*
* @default dependent on the locale and operating system.
*
* @see #format()
* @see #useGrouping
* @see #groupingPattern
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get groupingSeparator():String
public function set groupingSeparator(value:String):void

        [Bindable("change")]
/***
*    The negative symbol to be used when formatting negative values.
*
*    <p>This symbol is used with the negative number
* format when formatting a number that is less than zero.
* It is not used in negative number formats that do not include
* a negative sign (e.g. when negative numbers are enclosed in
* parentheses). </p>
*
* <p> This property is set to a default value for the actual
* locale selected when this formatter is constructed.
* It can be set with a value to override the default setting.</p>
*
*
* @see #negativeNumberFormat
* @see #format()
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get negativeSymbol():String
public function set negativeSymbol(value:String):void

        [Bindable("change")]
/***
*    Specifies whether a leading zero is included in a formatted
* number when there are no integer digits to the left of the decimal
* separator.
*
* <p>When this property is set to <code>true</code> a leading
* zero is included to the left of the decimal separator
* when formatting numeric values between -1.0 and 1.0.
* When this property is set to <code>false</code> a leading zero
* is not included.</p>
*
*    <p>For example if the number is 0.321 and this property is
* set <code>true</code>, then the leading
* zero is included in the formatted string. If the property is
* set to <code>false</code>, the leading zero
* is not included. In that case the string would just include the
* decimal separator followed by the decimal digits,
* like <code>.321</code>. </p>
*
* <p>The following table shows examples of how numbers are formatted
* based on the values of this property and
* the related <code>fractionalDigits</code> and
* <code>trailingZeros</code> properties.
* </p>
*
*    <table class="innertable" border="0">
*        <tr>
*            <td>trailingZeros</td>
*            <td><strong>leadingZero</strong></td>
*            <td>fractionalDigits</td>
*            <td>0.12</td>
*            <td>0</td>
*         </tr>
*        <tr>
*            <td>true</td>
*            <td>true</td>
*            <td>3</td>
*            <td>0.120</td>
*            <td>0.000</td>
*        </tr>
*        <tr>
*            <td>false</td>
*            <td>true</td>
*            <td>3</td>
*            <td>0.12</td>
*            <td>0</td>
*        </tr>
*        <tr>
*            <td>true</td>
*            <td>false</td>
*            <td>3</td>
*            <td>.120</td>
*            <td>.000</td>
*        </tr>
*        <tr>
*            <td>false</td>
*            <td>false</td>
*            <td>3</td>
*            <td>.12</td>
*            <td>0</td>
*        </tr>
* </table>
*
*
* @throws TypeError if this property is assigned a null value.
*
* @default dependent on the locale and operating system.
*
* @see #format()
*
* @see #trailingZeros
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get leadingZero():Boolean
public function set leadingZero(value:Boolean):void


        [Bindable("change")]
/***
*    Specifies whether trailing zeros are included in a formatted number.
*
* <p>When this property is set to <code>true</code>, trailing
* zeros are included in the fractional part
* of the formatted number up to the limit specified by the
* <code>fractionalDigits</code> property.
* When this property is set to <code>false</code> then no
* trailing zeros are shown.</p>
*
*    <p>For example if the numeric value is 123.4, and this property
* is set true, and the <code>fractionalDigits</code> property
* is set to 3, the formatted string would show trailing zeros,
* like <code>123.400</code> .
* If this property is <code>false</code>, trailing zeros are not
* included, and the string shows just the decimal
* separator followed by the non-zero decimal digits, like
* <code>123.4</code> .</p>
*
* <p>The following table shows examples of how numeric values are
* formatted based on the values of this property and
* the related <code>fractionalDigits</code> and
* <code>leadingZero</code> properties.
* </p>
*
*    <table class="innertable" border="0">
*        <tr>
*            <td><strong>trailingZeros</strong></td>
*            <td>leadingZero</td>
*            <td>fractionalDigits</td>
*            <td>0.12</td>
*            <td>0</td>
*         </tr>
*        <tr>
*            <td>true</td>
*            <td>true</td>
*            <td>3</td>
*            <td>0.120</td>
*            <td>0.000</td>
*        </tr>
*        <tr>
*            <td>false</td>
*            <td>true</td>
*            <td>3</td>
*            <td>0.12</td>
*            <td>0</td>
*        </tr>
*        <tr>
*            <td>true</td>
*            <td>false</td>
*            <td>3</td>
*            <td>.120</td>
*            <td>.000</td>
*        </tr>
*        <tr>
*            <td>false</td>
*            <td>false</td>
*            <td>3</td>
*            <td>.12</td>
*            <td>0</td>
*        </tr>
* </table>
*
*
* @throws TypeError if this property is assigned a null value.
*
* @default dependent on the locale and operating system.
*
* @see #leadingZero
*
* @playerversion Flash 10.1
* @playerversion AIR 2
* @langversion 3.0
* @productversion Flex 4.5
*/
public function get trailingZeros():Boolean
public function set trailingZeros(value:Boolean):void
    }
}

spark.utils.Collator

////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2010 Adobe Systems Incorporated
//  All Rights Reserved.

package spark.utils
{
/**
* The change event is generated whenever the locale style is changed or
* another property is set that would cause the format of a number to
* change or cause updates to the other values available through this
* class.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Event(name="change", type="flash.events.Event")]

/**
* @The locale identifier that specifies the language, region, script and
* optionally other related tags and keys.
*
* The syntax of this identifier must follow the syntax defined by the
* Unicode Technical Standard #35 (http//unicode.org/reports.tr35/)
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Style(name="locale", type="String", inherit="yes")]

/**
* The <code>Collator</code> class provides locale-sensitve string
* comparison capabilities.
*
* <p>This class is a wrapper class around the
* <code>flash.globalitaion.Collator</code>.
* Therefore the locale specific string comparison is provided by the
* <code>flash.globalitaion.Collator</code>.
* However this Collator class can be used in mxml declartions, uses the
* locale style for the requested Locale ID name, and has methods and
* properties that are Bindable.
* Additionally events are generated if there is an error or warning
* generated by the flash.globalization class.</p>
*
* <p>The flash.globalization.Collator class use the underlying operating
* system  for the formatting functionalilty and to supply the locale
* specific data.
* On some operating systems, the flash.globalization classes are
* unsupported, this wrapper class provides a fallback functionality in
* this case.</p>
*
* @see flash.globalization.Collator
*/
    public class Collator extends GlobalizationBase

/***
* Constructs a new Collator object to provide string comparisons
* according to the conventions of a specified locale.
*
* <p>The <code>initialMode</code> parameter sets various collation
* options for general uses.
* It can be set to one of the following values:</p>
*
* <ul>
*   <li><code>CollatorMode.SORTING</code>: sets collation options for
*       general linguistic sorting usages such as sorting a list of
*       text strings that are displayed to an end user.
*       In this mode, differences in uppercase and lowercase letters,
*       accented characters, and other differences specific to the
*       locale are considered when doing string comparisons.</li>
*   <li><code>CollatorMode.MATCHING</code>: sets collation options for
*       general usages such as determining if two strings are
*       equivalent.
*       In this mode, differences in uppercase and lower case letters,
*       accented characters, and so on are ignored when doing string
*       comparisons.</li>
* </ul>
*
* <p>For more details and examples when using these two modes, please
* see the documentation for the
* <code>flash.globalization.Collator</code> class</p>
*
* <p>The locale for this class is supplied by the locale style.
* The locale style can be set in several ways:</p>
*
* <ul>
*      <li>Inheriting the style from a UIComponent by calling the
*          UIComponent's addStyleClient method.</li>
*      <li>By using the class in an mxml declaration and inheriting the
*          locale from the document that contains the declaration.
* <listing version="3.0">
* &lt;fx:Declarations&gt;
*         &lt;s:StringTools id="st" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
*      <li>By using an mxml declaration and specifying the locale value
*              in the list of assignments.
* <listing version="3.0">
* &lt;fx:Declarations&gt;
*      &lt;s:StringTools id="st_turkish" locale="tr-TR" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
*      <li>Calling the setStyle method, e.g.
*              <code>st.setStyle("locale", "tr-TR")</code></li>
* </ul>
*
* <p>If the locale style is not set by one of the above techniques, the
* methods of this class that depend on the locale will throw an
* error.</p>
*
* @see flash.globalization.Collator
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function Collator(initialMode:String="sorting")

/**
* @private
*
* Creates actual working instance of BasicCollator.
*
* The locale and initialMode must have valid values prior to this call.
* Undefined value is not allowed.
*/
        override protected function createWorkingInstance():void

/***
* When this property is set to true, identical strings and strings that
* differ only in the case of the letters are evaluated as equal.
*
* @default <code>true</code> when the <code>Collator()</code>
* constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
* constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see flash.globalization.Collator.ignoreCase
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get ignoreCase():Boolean
public function set ignoreCase(value:Boolean):void

/***
* When this property is true, full-width and half-width forms of some
* Chinese and Japanese characters are evaluated as equal.
*
* <p>For compatibility with existing standards for Chinese and Japanese
* character sets, Unicode provides character codes for both full-width
* and half width-forms of some characters.
* For example, when the <code>ignoreCharacterWidth</code> property is
* set to <code>true</code>,
* <code>compare("&#65313;&#65393;", "A&#12450;")</code>
* returns <code>true</code>.</p>
*
* <p>If the <code>ignoreCharacterWidth</code> property is set to
* <code>false</code>, then full-width and half-width forms are not
* equal to one another.</p>
*
* @default <code>true</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see #compare()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get ignoreCharacterWidth():Boolean
public function set ignoreCharacterWidth(value:Boolean):void

/***
* When this property is set to true, strings that use the same base
* characters but different accents or other diacritic marks are
* evaluated as equal.
*
* For example <code>compare("cot&#233;", "c&#244;te")</code> returns
* <code>true</code> when the <code>ignoreDiacritics</code> property is
* set to <code>true</code>.
*
* <p>When the <code>ignoreDiacritics</code> is set to
* <code>false</code> then base characters with diacritic marks or
* accents are not considered equal to one another.</p>
*
*
* @default <code>true</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see #compare()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get ignoreDiacritics():Boolean
public function set ignoreDiacritics(value:Boolean):void

/***
* When this property is set to true, strings that differ only by the
* type of kana character being used are treated as equal.
*
* For example,
* <code>compare("&#12459;&#12490;", "&#12363;&#12394;")</code>
* returns <code>true</code> when the <code>ignoreKanaType</code>
* property is set to <code>true</code>.
*
* <p>If the <code>ignoreKanaType</code> is set to <code>false</code>
* then hiragana and katakana characters that refer to the same syllable
* are not equal to one another.</p>
*
* @default <code>true</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see #compare()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get ignoreKanaType():Boolean
public function set ignoreKanaType(value:Boolean):void

/***
* When this property is set to is true, symbol characters such as
* spaces, currency symbols, math symbols, and other types of symbols
* are ignored when sorting or matching.
*
* For example the strings "OBrian", "O'Brian", and "O Brian" would all
* be treated as equal when the <code>ignoreSymbols</code> property is
* set to <code>true</code>.
*
* @default <code>true</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see #compare()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get ignoreSymbols():Boolean
public function set ignoreSymbols(value:Boolean):void

/***
* Controls how numeric values embedded in strings are handled during
* string comparison.
*
* <p>When the <code>numericComparison</code> property is set to
* <code>true</code>, the compare method converts numbers that appear in
* strings to numerical values for comparison.</p>
*
* <p>When this property is set to <code>false</code>, the comparison
* treats numbers as character codes and sort them according to the
* rules for sorting characters in the specified locale.</p>
*
* <p>For example, when this property is true for the locale ID "en-US",
* then the strings "version1", "version10", and "version2" are sorted
* into the following order: version1 &#60; version2 &#60; version10.</p>
*
* <p>When this property is false for "en-US", those same strings
* are sorted into the following order: version1 &#60; version10 &#60;
* version2.</p>
*
* @default <code>true</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.MATCHING</code>.
*          <code>false</code> when the <code>Collator()</code>
*          constructor's <code>initialMode</code> parameter is set to
*          <code>Collator.SORTING</code>.
*
* @see #compare()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get numericComparison():Boolean

public function set numericComparison(value:Boolean):void

/***
* initialMode.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function get initialMode():String

public function set initialMode(value:String):void

        [Bindable("change")]
/***
* The status of the most recent operation that this Collator object
* performed.
*
* The status of the most recent operation that this Collator object
* performed.
* The lastOperationStatus is set whenever the constructor or a method
* of this class is called, or when a property is set.
* For the possible values see the description under each method.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.1
* @productversion Flex 4.5
*/
public function get lastOperationStatus():String

        [Bindable("change")]
/***
* @private
*
* Flag to indicate if a fallback class (true) or flash.globalization
* class (false) is used.
*/
        mx_internal function get useFallback():Boolean

        [Bindable("change")]
/***
* Compares two strings and returns an integer value indicating whether
* the first string is less than, equal to, or greater than the second
* string.
*
* The comparison uses the sort order rules for the locale sytle that is
* in effect when the compare method is called.
*
* @param string1 First comparison string.
* @param string2 Second comparison string.
* @return An integer value indicating whether the first string is less
*         than, equal to, or greater than the second string.2
*         <ul>
*             <li>If the return value is negative, <code>string1</code>
*                  is less than <code>string2</code>.</li>
*             <li>If the return value is zero, <code>string1</code> is
*                  equal to <code>string2</code>.</li>
*             <li>If the return value is positive, <code>string1</code>
*                  is larger than <code>string2</code>.</li>
*         </ul>
*
* @see #Collator()
* @see #equals()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function compare(string1:String, string2:String):int

        [Bindable("change")]
/***
* Compares two strings and returns a Boolean value indicating whether
* the strings are equal.
*
* The comparison uses the sort order rules for the locale ID that was
* specified in the <code>Collator()</code> constructor.
*
* @param string1 First comparison string.
* @param string2 Second comparison string.
* @return A Boolean value indicating whether the strings are equal
*         (<code>true</code>) or unequal (<code>false</code>).
*
* @see #Collator()
* @see #compare
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function equals(string1:String, string2:String):Boolean

        [Bindable("change")]
/***
* The name of the actual locale ID used by this Collator object.
*
* This is the locale that is used to access the formatting data and
* functionality from the operating system.
*
* If the locale that was set by the locale style is not available,
* then value of the actualLocaleIDName will be different from the
* value of the locale style.
* It will indicate the fallback locale that is being used.
* If the locale style was set to <code>LocaleID.DEFAULT</code> the
* name of the locale specified by the user's operating system will be
* used.
* For more details please see the description of the
* <code>flash.globalization.Collator.actualLocaleIDName</code>
* property.
*
* @see #locale
* @see flash.globalization.Collator.actualLocaleIDName
* @see #Collator()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get actualLocaleIDName():String

/***
* Lists all of the locale ID names supported by this class.
*
* @return A vector of strings containing all of the locale ID names
*         supported by this class and operating system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public static function getAvailableLocaleIDNames():Vector.<String>
    }
}

spark.utils.StringTools

package spark.utils
{

/**
* The change event is generated whenever the locale style is changed or
* another property is set that would cause the format of a number to change
* or cause updates to the other values available through this class.
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Event(name="change", type="flash.events.Event")]

/**
* The locale identifier that specifies the language, region, script and
* optionally other related tags and keys.
*
* The syntax of this identifier must follow the syntax defined by the
* Unicode Technical Standard #35 (http//unicode.org/reports.tr35/)
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
* @productversion Flex 4.5
*/
    [Style(name="locale", type="String", inherit="yes")]

/**
* The <code>StringTools</code> class provides locale-sensitve case
* conversion methods.
*
* <p>This class is a wrapper class around the
* <code>flash.globalitaion.StringTools</code>.
* Therefore the case conversion functionality is provided by the
* <code>flash.globalitaion.StringTools</code> class.
* However this <code>StringTools</code> class can be used in mxml
* declartions, uses the locale style for the requested Locale ID name, and
* has methods and properties that are Bindable.
* Additionally events are generated if there is an error or warning
* generated by the flash.globalization class.</p>
*
* <p>The <code>flash.globalization.StringTools</code> class use the
* underlying operating system for the case conversion functionalilty and
* On some operating systems, the <code>flash.globalization</code> classes
* are unsupported, this wrapper class provides fallback that makes use of
* the case conversion provided by the <code>String</code> class.</p>
*
* @see flash.globalization.StringTools
*/
    public class StringTools extends GlobalizationBase

/***
* Constructs a new StringTools object that provides case conversion and
* other utilities according to the conventions of a given locale.
*
* The locale for this class is supplied by the locale style.
* The locale style can be set in several ways:
*
* <ul>
* <li>Inheriting the style from a UIComponent by calling the
* UIComponent's addStyleClient method.</li>
*
* <li>By using the class in an mxml declaration and inheriting the
* locale from the document that contains the declaration.
* <listing version="3.0">
* &lt;fx:Declarations&gt;
*         &lt;s:StringTools id="st" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
*
* <li>By using an mxml declaration and specifying the locale value in
* the list of assignments.
* <listing version="3.0">
* &lt;fx:Declarations&gt;
*      &lt;s:StringTools id="st_turkish" locale="tr-TR" /&gt;
* &lt;/fx:Declarations&gt;
* </listing>
* </li>
*
* <li>Calling the setStyle method, e.g.
* <code>st.setStyle("locale", "tr-TR")</code></li>
* </ul>
*
* <p>If the locale style is not set by one of the above techniques, the
* methods of this class that depend on the locale will throw an
* error.</p>
*
* @see flash.globalization.StringTools
* @see mx.core.UIComponent.addStyleClient
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function StringTools()

/***
* Creates actual working instance of StringTools.
*/
        override protected function createWorkingInstance():void

        [Bindable("change")]
/***
* @copy spark.utils.Collator@lastOperationStatus
*
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.1
* @productversion Flex 4.5
*/
public function get lastOperationStatus():String

        [Bindable("change")]
/***
* @private
*
* Flag to indicate if a fallback class (true) or flash.globalization
* class (false) is used.
*/
        mx_internal function get useFallback():Boolean

        [Bindable("change")]
/***
* Converts a string to lowercase according to language conventions.
*
* Depending on the locale, the output strin length can differ from the
* input string length.
*
* @param s <code>String</code> to convert to lowercase.
* @return The converted lowercase string.
*
* @see StringTools
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function toLowerCase(s:String):String

        [Bindable("change")]
/***
* Converts a string to uppercase according to language conventions.
*
* Depending on the locale, the output strin length can differ from the
* input string length.
*
* @param s <code>String</code> to convert to uppercase.
* @return The converted uppercase string.
*
* @see StringTools
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flex 4.5
* @productversion Flash CS5
*/
public function toUpperCase(s:String):String

        [Bindable("change")]
/***
* The name of the actual locale ID used by this StringTools object.
*
* This is the locale that is used to access the case conversion
* functionality provided by this class.
*
* If the locale that was set by the locale style is not available, then
* value of the actualLocaleIDName will be different from the value of
* the locale style.
* It will indicate the fallback locale that is being used.
* If the locale style was set to <code>LocaleID.DEFAULT</code> the
* name of the locale specified by the user's operating system will be
* used.
* For more details please see the description of the
* <code>flash.globalization.StringTools.actualLocaleIDName</code>
* property.
*
* @see #locale
* @see flash.globalization.StringTools.actualLocaleIDName
* @see #StringTools()
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public function get actualLocaleIDName():String

/***
* Lists all of the locale ID names supported by this class.
*
* @return A vector of strings containing all of the locale ID names
*         supported by this class and operating system.
*
* @playerversion Flash 10.1
* @langversion 3.0
* @productversion Flash CS5
* @productversion Flex 4.5
*/
public static function getAvailableLocaleIDNames():Vector.<String>
    }
}

spark.utils.[GlobalizationBase]

package spark.utils
{
    public class GlobalizationBase extends AdvancedStyleClient
    {

/***
*  Constructor.
*
*  @langversion 3.0
*  @playerversion Flash 10
*  @playerversion AIR 1.1
*  @productversion Flex 4.5
*/
public function GlobalizationBase()

/***
* Create an instance of the flash.globalization class used for
* the subclasses of this base class.
* Classes that extend this base class MUST override this function
*/protected function createWorkingInstance():void

 /**
* Helper class to propagate properties from the current instance
* of the class to a newly created instance.  For example when the
* locale changes, a new flash.globalization class is created with the
* new locale. This copies any properties that have been individually
* set to the new instance.
*
* @param target  The new instance to copy the properties too.
*/
protected function propagateBasicProperties(target:Object):void
/***
* Helper class to get simple property values for all classes that
* extend this class.
*
* @param obj The object to get the property from.
* @param propertyName the name of the property.
*/
protected function getBasicProperty(obj:Object, propertyName:String):*

/***
* Helper class to set simple property values for all classes that
* extend this class.
*
* @param obj The object to get the property from.
* @param propertyName the name of the property.
* @param value the property value to set.
*/
 protected function setBasicProperty(obj:Object, propertyName:String, value:*):void

protected function throwErrorIfLocaleNotDefined():void

/***
* @private
*
* Enforces to use the fallback class internally even when
* flash.globalization class is available.
*/
        mx_internal function get enforceFallback():Boolean

/***
* @private
*/
        mx_internal function set enforceFallback(value:Boolean):void

/***
*  @private
*/
protected function update() : void

/***
* @private
*
* This method is called if a style is changed on the instances of
* this formatter.
*
* This method determines if the locale style has changed and if
* so it updates the formatter to reflect this change.
* If the locale has been updated the <code>change</code> event
* will be dispatched and uses of the
* bindable methods or properties will be updated.
*/
private function localeChanged():void

/***
* @private
*
* Detects changes to style properties. When any style property is set,
* Flex calls the <code>styleChanged()</code> method,
* passing to it the name of the style being set.
*
* For the Collator class this method determines whether or not the
* locale style has changed and if needed updates the instance of
* the class to reflect this change. If the locale has been
* updated the <code>change</code> event will be dispatched and
* uses of the bindable methods or properties will be updated.
*
* @param styleProp The name of the style property, or null if
* all styles for this component have changed.
*
*/
        override public function styleChanged(styleProp:String):void

/***
* @private
*
* Intercept style change for "locale".
*
* In the case that there is no associated UI component or the
* module factory of the UIComponent has not yet been intialized
* style changes are only recorded but the styleChanged method
* is not called.  Overriding the setStyle method allows
* the class to be updated immediately when the locale style is
* set directly on this class instance.
*/
        override public function setStyle(styleProp:String, newValue:*):void
    }
}

B Features


None

Examples and Usage


The wrapper classes can be used as follows. In this example the locale style is set to French (France) at the application level, and a NumberFormatter and DateTimeFormatter are used to format a number and a date.

<?xml version="1.0"?>
<s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
>

    <fx:Style>

        s|Application {
            locale: "fr-FR"
        }
    </fx:Style>

    <fx:Declarations>
        <s:NumberFormatter id="nf" fractionalDigits="0" useGrouping="false"/>
        <s:DateTimeFormatter id="df" dateStyle="medium" timeStyle="medium"/>
    </fx:Declaraions>

    <fx:Script><![CDATA[

        var today:Date = new Date();

        }
    ]]></fx:Script>
    <s:Panel title="Global Locale Example"
    width="75%" height="75%"
    horizontalCenter="0" verticalCenter="0">

        <s:Group left="10" right="10" top="10" bottom="10">
             <s:Label text="{nf.format('12345.67')}"/>
             <s:Label text="{df.format(today)}"
        </s:Group>
    </s:Panel>

</s:Application>


The locale style can be set on an individual wrapper class or UI component to select a specific locale as in the following example that sets the locale to Spanish (Mexico) for the DateTimeFormatter:

    <s:DateTimeFormatter id="df" locale="es-MX"
        dateStyle="DateTimeFormatterStyle.MEDIUM" timeStyle="DateTimeFormatterStyle.MEDIUM"/>

The locale can also be set globally using the the StyleManager or a css style sheet. Below is an example using the StyleManager in an application init function. The global locale style is set to LocaleID.DEFAULT which causes the user's default systems settings to be used.

<?xml version="1.0" encoding="utf-8"?>
<s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    creationComplete="initApp(event)">

    <fx:Script><![CDATA[
        import mx.styles.StyleManager;
        import flash.globalization.LocaleID;

        [Bindable]
        private var today:Date = new Date();

        public function initApp(e:Event):void {
            var myStyleManager: IStyleManager2 = StyleManager.getStyleManager(this.moduleFactory);

            myStyleManager.getStyleDeclaration("global").setStyle("locale",LocaleID.DEFAULT);


        }
    ]]></fx:Script>

    <fx:Declarations>
        <s:DateTimeFormatter id="df" dateStyle="short" timeStyle="none"/>

    </fx:Declarations >

    <s:Panel title="Global Locale Example"
             width="75%" height="75%"
             horizontalCenter="0" verticalCenter="0">
        <s:Group left="10" right="10" top="10" bottom="10">
            <s:Label text="{df.format(today)}" />
        </s:Group>
    </s:Panel>
</s:Application>

The following example illustrates the use of the SortingCollator class to sort a list of strings that are displayed to the end user. The application uses two DataGrid components. One uses the default string comparison, the other one uses the compare method from the spark SortingCollator class.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
			   minWidth="955" minHeight="600">
<fx:Declarations>
    <s:SortingCollator id="sparkCollator"/>

</fx:Declarations>
<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    global {
        fontSize: 16
    }
</fx:Style>
<fx:Script>
    <![CDATA[
        import flash.globalization.*;

        import mx.collections.ArrayCollection;
        import mx.events.ListEvent;
        import mx.formatters.NumberFormatter;

        [Bindable]
        private var localeList:ArrayCollection = new ArrayCollection(
        [ {label:"English (en)", data:"en"},
        {label:"French (fr)", data:"fr"},
        {label:"German (de)", data:"de"},
        {label:"Latvian (lt)", data:"lt"},
        {label:"Sweedish (sv)", data:"sv"},
        {label:"Chinese (zh)", data:"zh"} ]);


        private static const testDataDefault:ArrayCollection =
			new ArrayCollection
            ([
            "B", "b", "a", "A" , // English
            "y (lt)", "i (lt)", "k (lt)", // Latvian
            "n (sv)", "ö (sv)", "o (sv)", "z (sv)", // sw
            "vu (sv)", "wo (sv)", // sw
            "däd (de)", "daed (de)", // de
            "öf (de)", "of (de)", // de_dictionary
            "côte (fr)", "coté (fr)", // fr
            "手 (zh)", "中 (zh)", "土 (zh)", "岀 (zh)"// zh
            ]);
        private static const testDataSpark:ArrayCollection =
			new ArrayCollection
            ([
                "B", "b", "a", "A" , // English
                "y (lt)", "i (lt)", "k (lt)", // Latvian
                "n (sv)", "ö (sv)", "o (sv)", "z (sv)", // sw
                "vu (sv)", "wo (sv)", // sw
                "däd (de)", "daed (de)", // de
                "öf (de)", "of (de)", // de_dictionary
                "côte (fr)", "coté (fr)", // fr
                "手", "中", "土", "岀"// zh
            ]);
        protected function localeSelector_changeHandler(event:ListEvent):void
        {
            var locale:String = ComboBox(event.target).selectedItem.data;
            var myStyleManager: IStyleManager2 =
							StyleManager.getStyleManager(this.moduleFactory);

            myStyleManager.getStyleDeclaration("global").setStyle("locale",locale);

            testDataSpark.refresh();
        }
        [Bindable ("change")]
        private function compareFunction(obj1: Object, obj2: Object) : int
        {
            var str1:String = String(obj1);
            var str2:String = String(obj2);

            return sparkCollator.compare(str1, str2);
        }

    ]]>
</fx:Script>
<s:VGroup width="75%" height="95%">

<s:HGroup>
    <s:Label text="Select Language">
    </s:Label>
    <mx:ComboBox id="localeSelector"
				 change="localeSelector_changeHandler(event)"
                 dataProvider="{localeList}"/>

</s:HGroup>

<mx:TabNavigator width="100%" height="100%">
    <mx:VBox label="DataGrid Sort Comparison"
             height="100%" width="100%"
             paddingTop="10" paddingBottom="10"
			 paddingLeft="10" paddingRight="10">
        <mx:HBox height="100%" width="100%" >
            <mx:DataGrid  width="100%"
                          dataProvider="{testDataDefault}"
                          rowCount="{testDataSpark.length}">
                <mx:columns>
                    <mx:DataGridColumn
						headerText="default sort (click here to sort)"  />
                </mx:columns>
            </mx:DataGrid>
            <mx:DataGrid id="sparkGrid"  width="100%"
                            dataProvider="{testDataSpark}"
                            rowCount="{testDataSpark.length}">
                <mx:columns>
                    <mx:DataGridColumn id="sparkColumn"
                            headerText="spark Collator (click here to sort)"
                            sortCompareFunction="{compareFunction}"/>
                </mx:columns>
            </mx:DataGrid>

        </mx:HBox>

    </mx:VBox>
</mx:TabNavigator>
</s:VGroup>
</s:Application>

Additional Implementation Details


Prototype Work


None

Compiler Work


None

Web Tier Compiler Impact


none

Flex Feature Dependencies


None

Backwards Compatibility


Syntax changes

None

Behavior

There has not been any behavior changes to existing UIComponents.

Warnings/Deprecation

The mx versions of the CurrencyFormatter, DateFormatter, NumberFormatter, CurrencyValidator, NumberValidator, and DateValidator will not be modified as part of this feature and will therefore continue to behave as previously implemented. However the documentation for these classes should be updated to direct developers to the new classes that are implemented as part of this feature.

Accessibility


TBD

Performance


There should not be any significant performance impacts from this feature.

Globalization


This feature is intended to provide the ability of developers to easily support locales that are available on an end users device. Thus it is a key feature for the development of world ready applications using the Flex SDK.

Localization


Compiler Features

not applicable

Framework Features

Localized date strings, time strings and locale specific formatting will be provided by the flash.globalization classes.

Cross-Platform Considerations


The flash globalization classes provide different results depending on the platform. Therefore this feature will require testing on different platforms, to ensure that these platform differences are handled properly. If there is a platform that does not support the flash.globalization classes, then testing should also include that platform. The testing should also include setting locales that are not supported on the specific device. This will ensure that the fall back behavior is working correctly.

Note that the testing does not need to extensively test the results from the flash.globalization classes, this testing is already part of the Flash Player test suites.

Issues and Recommendations


  • If the developer wishes to use the locale settings from the user's system, then he/she might set the global locale style to LocaleID.DEFAULT. Since both the flash.globalization classes and the FTE text classes use this style, there may be a need for the locale to be set differently on the text components.

You must be logged in to comment.