Package | com.adobe.csxs.core |
Class | public final class CSXSInterface |
Implements | flash.events.IEventDispatcher |
CSXSInterface.getInstance()
or CSXSInterface.instance
.
Use this object to:
Property | Defined by | ||
---|---|---|---|
currentStateInfo : StateInfo
[read-only]
Provides current state information.
| CSXSInterface | ||
instance : CSXSInterface
[static][read-only] Stores the singleton instance of the
CSXSInterface class. | CSXSInterface | ||
jobManager : JobManager
[read-only]
Returns the
JobManager for this extension. | CSXSInterface | ||
rootDisplayObject : DisplayObject [static][write-only]
Setter for the root
DisplayObject . | CSXSInterface |
Method | Defined by | ||
---|---|---|---|
CSXSInterface(caller:Function)
Constructor.
| CSXSInterface | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an interest in a
CSXSEvent of a particular type, and assigns the event handler. | CSXSInterface | ||
deletePreference(key:String):SyncRequestResult
Deletes a preference key-value pair.
| CSXSInterface | ||
deleteSharedPreference(key:String):SyncRequestResult
Deletes a shared preference key-value pair.
| CSXSInterface | ||
dispatchEvent(event:Event):Boolean
Triggers an event programmatically.
| CSXSInterface | ||
evalScript(functionName:String, ... stringArguments):SyncRequestResult
Evaluates a function defined in a script that is associated with the extension.
| CSXSInterface | ||
execute(id:String, ... stringArguments):SyncRequestResult
Executes a native process that has been defined in the extension data section
of the extension manifest.xml file.
| CSXSInterface | ||
getApplicationId():String
Retrieves the unique identifier of the current host application.
| CSXSInterface | ||
getExtensionId():String
Retrieves the unique identifier of the extension.
| CSXSInterface | ||
getExtensions(extensionIds:Array = null):SyncRequestResult
Retrieves the list of extensions currently loaded in the current host application.
| CSXSInterface | ||
Provides information about the application in which the extension is currently running.
| CSXSInterface | ||
[static] Retrieves the singleton instance of the
CSXSInterface class. | CSXSInterface | ||
Retrieves network-related preferences.
| CSXSInterface | ||
getSystemPath(pathType:String):SyncRequestResult
Retrieves a path for which a constant is defined in the system.
| CSXSInterface | ||
Retrieves the screen location and size of the extension window.
| CSXSInterface | ||
hasEventListener(type:String):Boolean
Reports whether this extension has registered an interest in an event of a given type.
| CSXSInterface | ||
Initializes the resource bundle for this extension with property values
for the current application and locale.
| CSXSInterface | ||
launchBrowser(url:String):SyncRequestResult
Launches the default browser to show the given page.
| CSXSInterface | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters this extension's interest in an event of a given type.
| CSXSInterface | ||
requestOpenExtension(extensionID:String, startupParams:String = null):SyncRequestResult
Loads and launches another extension.
| CSXSInterface | ||
Sets the state of the window in which the extension is running.
| CSXSInterface | ||
retrievePreference(key:String):SyncRequestResult
Retrieves an extension preference.
| CSXSInterface | ||
retrieveSharedPreference(key:String):SyncRequestResult
Retrieves a shared preference.
| CSXSInterface | ||
setPanelMenu(xmlMenu:XML):SyncRequestResult
Sets the menu for the extension window.
| CSXSInterface | ||
storePreference(key:String, value:String):SyncRequestResult
Stores a preference value associated with an identifying key.
| CSXSInterface | ||
storeSharedPreference(key:String, value:String):SyncRequestResult
Stores a shared preference value associated with an identifying key.
| CSXSInterface | ||
willTrigger(type:String):Boolean
Reports whether an event listener is registered with this event-dispatcher object
for any of its ancestors for the specified event type.
| CSXSInterface |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispached when the window skin information changes. | CSXSInterface | |||
Dispached when the user clicks a window flyout menu. | CSXSInterface | |||
Dispached by a host application when extensions should stop any network-related operations. | CSXSInterface | |||
Dispached by a host application when extensions can restart network-related operations. | CSXSInterface | |||
Dispached when the user clicks a main window menu. | CSXSInterface | |||
Dispached when an asynchronous event completes. | CSXSInterface | |||
Dispached when an asynchronous event fails. | CSXSInterface | |||
Dispached when the window is closed. | CSXSInterface | |||
Dispached when the window gains the input focus. | CSXSInterface | |||
Dispached when the window is hidden, after being visible. | CSXSInterface | |||
Dispached when the window loses the input focus. | CSXSInterface | |||
Dispached when the window is minimized/iconified. | CSXSInterface | |||
Dispached when the window moves. | CSXSInterface | |||
Dispached when the window is opened, after it is fully initialized and ready to respond to changes in the geometry. | CSXSInterface | |||
Dispached when the window size changes. | CSXSInterface | |||
Dispached when the window is restored after being minimized/iconified. | CSXSInterface | |||
Dispached when the window become visible, after being hidden. | CSXSInterface |
currentStateInfo | property |
currentStateInfo:StateInfo
[read-only]Provides current state information. This property is bindable and readonly.
This property can be used as the source for data binding.
Implementation public function get currentStateInfo():StateInfo
instance | property |
instance:CSXSInterface
[read-only] Stores the singleton instance of the CSXSInterface
class.
public static function get instance():CSXSInterface
jobManager | property |
jobManager:JobManager
[read-only]
Returns the JobManager
for this extension. This should be the sole instance
used.
public function get jobManager():JobManager
m_currentStateInfo | property |
csxs_internal var m_currentStateInfo:StateInfo
rootDisplayObject | property |
rootDisplayObject:DisplayObject
[write-only]
Setter for the root DisplayObject
.
If the CSXS SWC is used in a Flash extension, the root DisplayObject has to be provided to the SWC
by calling this method BEFORE making the first call to CSXSInterface.instance or CSXSInterface.getInstance().
public function set rootDisplayObject(value:DisplayObject):void
CSXSInterface | () | constructor |
public function CSXSInterface(caller:Function)
Constructor. The singleton instance is created internally; do not use this or the
new
operator to create multiple instances.
Instead, call the static method CSXSInterface.getInstance()
or use CSXSInterface.instance
to retrieve the existing instance.
caller:Function |
See also
addEventListener | () | method |
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an interest in a CSXSEvent
of a particular type, and assigns the event handler.
The event infrastructure notifies your extension when events of the given type occur,
passing the event object to the registered handler function.
Extends flash.events.IEventDispatcher
for CSXSEvent
handling.
type:String — The name of the event type of interest. See CSXSEvent for allowed values.
|
|
listener:Function — The handler function for the event.
|
|
useCapture:Boolean (default = false ) — Optional. When true, the listener processes the event only during the capture phase and
not in the target or bubbling phase. When false (the default), the listener processes the event only
during the target or bubbling phase.
|
|
priority:int (default = 0 ) — Optional. A higher priority value causes an event to be handled before simultaneous events with lower values.
|
|
useWeakReference:Boolean (default = false ) — Optional. When true, the listener can be garbage-collected. When false (the default), this is prevented.
|
See also
deletePreference | () | method |
public function deletePreference(key:String):SyncRequestResult
Deletes a preference key-value pair.
Parameterskey:String — The identifying key.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful.
|
See also
var testKey:string="a"; //or a.b.c var result:SyncRequestResult = deletePreference(testKey); if(SyncRequestResult.COMPLETE == result.status) { trace("Preference Deleted Successfully"); }
deleteSharedPreference | () | method |
public function deleteSharedPreference(key:String):SyncRequestResult
Deletes a shared preference key-value pair.
Parameterskey:String — The identifying key.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful.
|
See also
var testKey:string="a"; //or a.b.c var result:SyncRequestResult = deleteSharedPreference(testKey); if(SyncRequestResult.COMPLETE == result.status) { trace("Preference Deleted Successfully"); }
dispatchEvent | () | method |
public function dispatchEvent(event:Event):Boolean
Triggers an event programmatically. You can use it to dispatch a standard Flash event
or CSXSEvent
. Extends flash.events.IEventDispatcher
for CSXSEvent
handling.
event:Event — The event object.
|
Boolean — True on success.
|
See also
evalScript | () | method |
public function evalScript(functionName:String, ... stringArguments):SyncRequestResult
Evaluates a function defined in a script that is associated with the extension. All consecutive calls are executed in the same script engine.
ParametersfunctionName:String — The function to call, defined in a script provided with the extension.
|
|
... stringArguments — String arguments to pass to the function.
|
SyncRequestResult —
A result object whose data value is the result of evaluation,
or NULL on error.
|
See also
evalScript("FnMyScript", "param1", "param2");
to evaluate this function in the associated script:
FnMyScript('param1', 'param2');
If the call returns an object containing properties, the script result is an XML object with this format:
<object> <property id="strValue1"><string>Hello</string></property< <property id="numValue2"><number>10</number></property< <property id="boolValue3"><true/></property< </object>
var result:SyncRequestResult = evalScript("FnMyScript", "param1", "param2"); var oResult:Object; if((SyncRequestResult.COMPLETE == result.status) && result.data) { oResult = result.data as Object; //Make sure oResult has properties "strValue1", "numValue2" and "boolValue3" if(oResult.hasOwnProperty("strValue1") && oResult.hasOwnProperty("numValue2")&& oResult.hasOwnProperty("boolValue3")) { var strVal:String = oResult.strValue1; var numVal:Number = oResult.numValue2; var boolVal:Boolean = oResult.boolValue3; } }
If the call returns a string containing XML, use the CDATA
tag to enclose the XML.
For instance, suppose the result of evaluation is this string:
<![CDATA[ <someinfo> <tag1><prop>Prop1</prop><prop>Prop2</prop></tag1> <tag2><link>Prop3</link></tag2> </someinfo> ]]>
var result:SyncRequestResult = evalScript("FnMyScript", "param1", "param2"); var strResult:String; if((SyncRequestResult.COMPLETE == result.status) && result.data) { strResult = result.data as String; trace(strResult); }
execute | () | method |
public function execute(id:String, ... stringArguments):SyncRequestResult
Executes a native process that has been defined in the extension data section
of the extension manifest.xml file.
The ExtensionData
is nested in DispatchInfoList->Extension->DispatchInfo
.
Sample of a native process section in the extension manifest file:
<DispatchInfoList> ... <Extension> ... <DispatchInfo> ... <ExtensionData> <ExecutableList> <Executable Id="myId" Platform="win">c:/absPath/myProcess.exe</Executable> <Executable Id="myId" Platform="mac">/absPath/myProcess</Executable> </ExecutableList> </ExtensionData> ...
id:String — The unique identifier of the defined process, as specified in the extension manifest Executable tag.
|
|
... stringArguments — The arguments defined for the process. They are passed as command line arguments to the process.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful. The data value is NULL.
|
See also
getApplicationId | () | method |
public function getApplicationId():String
Retrieves the unique identifier of the current host application.
ReturnsString — The host application ID.
|
getExtensionId | () | method |
public function getExtensionId():String
Retrieves the unique identifier of the extension.
ReturnsString — The extension ID.
|
getExtensions | () | method |
public function getExtensions(extensionIds:Array = null):SyncRequestResult
Retrieves the list of extensions currently loaded in the current host application. The extension list is initialized once, and remains the same during the lifetime of the CSXS session.
ParametersextensionIds:Array (default = null ) — An array of unique identifiers for extensions of interest.
If omitted, retrieves data for all extensions.
|
SyncRequestResult —
A result object whose data value contains the list of extensions.
|
See also
getHostEnvironment | () | method |
public function getHostEnvironment():SyncRequestResult
Provides information about the application in which the extension is currently running.
ReturnsSyncRequestResult —
A result object whose data value is a HostEnvironment object,
or NULL on error.
|
See also
var result:SyncRequestResult = getHostEnvironment(); var hostEnv:HostEnvironment; if((SyncRequestResult.COMPLETE == result.status) && result.data) { hostEnv = result.data as HostEnvironment; }
getInstance | () | method |
public static function getInstance():CSXSInterface
Retrieves the singleton instance of the CSXSInterface
class.
CSXSInterface |
getNetworkPreferences | () | method |
public function getNetworkPreferences():SyncRequestResult
Retrieves network-related preferences.
ReturnsSyncRequestResult —
A result object whose data value is a NetworkPreferences object,
or NULL on error.
|
See also
var result:SyncRequestResult = getNetworkPreferences(); var netPref:NetworkPreferences; if((SyncRequestResult.COMPLETE == result.status) && result.data) { netPref = result.data as NetworkPreferences; }
getSystemPath | () | method |
public function getSystemPath(pathType:String):SyncRequestResult
Retrieves a path for which a constant is defined in the system.
ParameterspathType:String — A string containing a path-type constant defined in the SystemPath object,
such as SystemPath.USER_DATA .
|
SyncRequestResult —
A result object whose data value is a SystemPath object,
or NULL on error.
If the path-type string is not in the correct format, returns a status of
|
See also
var result:SyncRequestResult = getSystemPath(SystemPath.APPLICATION_DATA); var appData:String; if((SyncRequestResult.COMPLETE == result.status) && result.data) { appData = result.data; }
getWindowGeometry | () | method |
public function getWindowGeometry():SyncRequestResult
Retrieves the screen location and size of the extension window.
ReturnsSyncRequestResult —
A result object whose data value is a WindowGeometry object,
or NULL on error.
|
See also
var result:SyncRequestResult = getWindowGeometry(); var winGeom:WindowGeometry; if((SyncRequestResult.COMPLETE == result.status) && result.data) { winGeom = result.data as WindowGeometry; }
hasEventListener | () | method |
public function hasEventListener(type:String):Boolean
Reports whether this extension has registered an interest in an event of a given type.
Extends flash.events.IEventDispatcher
for CSXSEvent
handling.
type:String — The name of the event type of interest. See CSXSEvent for allowed values.
|
Boolean — True if the extension handles this type of event.
|
See also
initResourceBundle | () | method |
public function initResourceBundle():SyncRequestResult
Initializes the resource bundle for this extension with property values
for the current application and locale. After this call, you can query all properties
(in "extensionDirectory/locale/{locale}/messages.properties" or
"extensionDirectory/locale/messages.properties") using the IResourceManager
.
The bundle name is "messages".
SyncRequestResult —
A result object whose status value reports whether the request was sucessful.
|
See also
launchBrowser | () | method |
public function launchBrowser(url:String):SyncRequestResult
Launches the default browser to show the given page.
Parametersurl:String — A string containing a URI-format path for a local page,
or an HTTP/HTTPS request for a remote page.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful. The data value is NULL.
If the SWF is not trusted and the platform is not Windows, returns a status of
If the URL is not in the correct format, returns a status of
|
See also
var result:SyncRequestResult = launchBrowser("file:///C:/my.html"); //or http://mysite.com/myurl.html if(SyncRequestResult.COMPLETE == result.status) { trace("Success"); }
removeEventListener | () | method |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters this extension's interest in an event of a given type. The parameter
values must match those with which the interest was originally registered.
Extends flash.events.IEventDispatcher
for CSXSEvent
handling.
type:String — The name of the event type of interest. See CSXSEvent for allowed values.
|
|
listener:Function — The handler function for the event.
|
|
useCapture:Boolean (default = false ) — Optional. Specifies whether the listener was registered for the capture phase or
the target and bubbling phases. Default is false.
|
See also
requestOpenExtension | () | method |
public function requestOpenExtension(extensionID:String, startupParams:String = null):SyncRequestResult
Loads and launches another extension. If the target extension is already loaded, it is activated.
ParametersextensionID:String — The extension's unique identifier.
|
|
startupParams:String (default = null ) — Startup parameters to be passed to the loaded extension.
Specify key-value pairs as a GET URL parameter list; for example: "key1=value1&key2=value2".
|
SyncRequestResult |
requestOpenExtension("HLP")
requestStateChange | () | method |
public function requestStateChange(newState:String, windowGeometry:WindowGeometry):SyncRequestResult
Sets the state of the window in which the extension is running.
You can close the window, hide or show it, minimize or restore it,
move or resize it, and set or remove the input focus.
You cannot use this function to open a window; to do this, open the extension using
requestOpenExtension()
newState:String — A string containing one of:
StateChangeEvent.WINDOW_OPEN is an invalid value.
|
|
windowGeometry:WindowGeometry — A window-geometry object that provides the width and height values for a resize operation,
or the new location for a move operation. NULL for other operation requests.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful. The data value is NULL.
|
See also
var winGeom:WindowGeometry = new WindowGeometry(); winGeom.width = 100; winGeom.height = 200; requestStateChange(StateChangeEvent.WINDOW_RESIZE, winGeom);
requestStateChange(StateChangeEvent.WINDOW_HIDE, null);
retrievePreference | () | method |
public function retrievePreference(key:String):SyncRequestResult
Retrieves an extension preference.
Parameterskey:String — The identifying key of the preference.
|
SyncRequestResult —
A result object whose data value is
the value of the specified preference, if any.
|
See also
var testKey:string="a"; //or a.b.c var result:SyncRequestResult = retrievePreference(testKey); if(SyncRequestResult.COMPLETE == result.status && result.data) { var testValue:String = result.data as String; }
retrieveSharedPreference | () | method |
public function retrieveSharedPreference(key:String):SyncRequestResult
Retrieves a shared preference.
Parameterskey:String — The identifying key of the preference.
|
SyncRequestResult —
A result object whose data value is
the value of the specified preference, if any.
|
See also
var testKey:string="a"; //or a.b.c var result:SyncRequestResult = retrieveSharedPreference(testKey); if(SyncRequestResult.COMPLETE == result.status && result.data) { var testValue:String = result.data as String; }
setPanelMenu | () | method |
public function setPanelMenu(xmlMenu:XML):SyncRequestResult
Sets the menu for the extension window. If a menu already exists, replaces it with this new one.
Before setting the menu, use addEventHandler()
to register a handler function that provides the
menu's behavior in response to user clicks on the leaf items.
xmlMenu:XML — An XML structure containing menu item identifiers and localized menus strings,
or NULL to remove any existing menu.
Menu items are created in the specified order. Use a menu item value of "---" (three dashes) to insert a horizontal divider. A |
SyncRequestResult —
A result object whose status value reports whether the request was sucessful. The data value is NULL.
|
See also
//Sample Menu XML structure var xmlMyMenu:XML = <Menu> <MenuItem Id="menuItemId1" Label="myItem1"/> <MenuItem Label="myItem2"> <MenuItem Label="myItem2_1"> <MenuItem Label="myItem2_1_1"/> <MenuItem Label="myItem2_1_2"/> <MenuItem Label="---"/> <MenuItem Label="myItem2_1_3"/> </MenuItem> </MenuItem> <MenuItem Label="---"/> <MenuItem Label="myItem3"/> </Menu> setPanelMenu(xmlKulerMenu);
myItem1 myItem2 > myItem2_1 > myItem2_1_1 myItem2_1_2 ------------------------------ myItem2_1_3 ------------------------------ myItem3
storePreference | () | method |
public function storePreference(key:String, value:String):SyncRequestResult
Stores a preference value associated with an identifying key. A subsequent call with the same key overwrites the exsisting value.
Parameterskey:String — The identifying key.
|
|
value:String — The new preference value, a string. Any other types must be converted to
a string before storing as a preference.
|
SyncRequestResult —
A result
|
var testKey:string="a"; //or a.b.c var testValue:String = "Hello World"; var result:SyncRequestResult = storePreference(testKey, testValue); if(SyncRequestResult.COMPLETE == result.status) { trace("stored successfully"); }
storeSharedPreference | () | method |
public function storeSharedPreference(key:String, value:String):SyncRequestResult
Stores a shared preference value associated with an identifying key. A subsequent call for the same key overwrites the exsisting value.
Parameterskey:String — The identifying key.
|
|
value:String — The new preference value, a string.
Any other type must be converted to a string before storage as a preference.
|
SyncRequestResult —
A result object whose status value reports whether the request was sucessful.
|
See also
var testKey:string="a"; //or a.b.c var testValue:String = "Hello World"; var result:SyncRequestResult = storePreference(testKey, testValue); if(SyncRequestResult.COMPLETE == result.status) { trace("stored successfully"); }
updateStateInfo | () | method |
csxs_internal function updateStateInfo(name:String, value:*):void
Parameters
name:String |
|
value:* |
willTrigger | () | method |
public function willTrigger(type:String):Boolean
Reports whether an event listener is registered with this event-dispatcher object
for any of its ancestors for the specified event type. Returns true if an event listener
is triggered during any phase of the event flow when an event of the specified type is
dispatched to this event-dispatcher object or any of its descendants.
This function examines the entire event flow; this differs from #hasEventListener(),
which examines only the object to which it belongs.
Extends flash.events.IEventDispatcher
for CSXSEvent
handling.
type:String — name of the event type of interest. See CSXSEvent for allowed values.
|
Boolean — True if a listener will be triggered.
|
See also
applicationReskin | event |
com.adobe.csxs.events.AppReskinEvent
Dispached when the window skin information changes.
flyoutMenuClick | event |
com.adobe.csxs.events.MenuClickEvent
Dispached when the user clicks a window flyout menu.
goOffline | event |
mx.events.Event
Dispached by a host application when extensions should stop any network-related operations.
goOnline | event |
mx.events.Event
Dispached by a host application when extensions can restart network-related operations.
mainMenuClick | event |
com.adobe.csxs.events.MenuClickEvent
Dispached when the user clicks a main window menu.
requestComplete | event |
com.adobe.csxs.events.AsyncRequestEvent
Dispached when an asynchronous event completes.
requestFailed | event |
com.adobe.csxs.events.AsyncRequestEvent
Dispached when an asynchronous event fails.
windowClose | event |
windowGetFocus | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window gains the input focus.
windowHide | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window is hidden, after being visible.
windowLoseFocus | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window loses the input focus.
windowMinimize | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window is minimized/iconified.
windowMove | event |
windowOpen | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window is opened, after it is fully initialized and ready to respond to changes in the geometry.
windowResize | event |
windowRestore | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window is restored after being minimized/iconified.
windowShow | event |
com.adobe.csxs.events.StateChangeEvent
Dispached when the window become visible, after being hidden.