Class: FileFromStringDownloader

Source Location: /class/fileHandling.php.inc

Class Overview

Node
   |
   --FileFromStringDownloader

Background file-from-memory downloader

This class constructs a node that downloads from server memory to a file on the client in the background. Construct it with the remote (client) destination path as the first argument and the data string as the second, then call startDownload(). This control fires a 'started' event when the download starts, a 'cycle' event periodically with progress information, a 'finished' event when the download is finished and a 'cancelled' event when the download is cancelled.



see:  XULFilePicker


Author(s):

Variables

Methods

Inherited Variables

Class: Node

Node::$behavior
Node::$eventHandler
Node::$eventType
Node::$eventYielder
Node::$handlerFor
Node::$id
Node::$isChild
Node::$isRegistered
Node::$observerTopics
Node::$parent
Node::$rootApplication
Node::$rootWindow
Node::$yielderFor

Inherited Methods

Class: Node

Node::__construct()
Dynamic Constructor
Node::accessKey()
Set the accessKey attribute for this element
Node::addBehavior()
Add a behavior class
Node::addObserver()
Add an observer to this Node
Node::align()
Set the align attribute for this element
Node::attach()
[INTERNAL FUNCTION] Default attach method
Node::attributeMethod()
Convenient attribute setter
Node::backgroundColor()
Set the background color for the element
Node::backgroundImage()
Set the background of a node using CSS background-image property
Node::BehaviorCreateClass()
Constructs a Behavior class from a string classname and a settings array.
Node::BehaviorSetClassSettings()
Automatically initializes Behavior object
Node::blur()
Make this node loose focus
Node::callMethod()
Call a JavaScript method on the client-side node
Node::callMethodDelayed()
Call a JavaScript method on the client-side node in a delayed fashion
Node::className()
Set the CSS classname for the element
Node::commandHandler()
[INTERNAL FUNCTION] Handles an incoming event for this node
Node::context()
Set a contextmenu to show when clicking the context (right) mouse or keyboard button on this element
Node::createClientEvent()
Creates a new event on the client side
Node::createRemoteObject()
[INTERNAL FUNCTION] Calls the remote constructor of this class
Node::crop()
Set the crop attribute for this element
Node::detach()
[INTERNAL FUNCTION] Default detach method
Node::disableBehavior()
Disable behavior
Node::disabled()
Set the disabled attribute for this element
Node::enableBehavior()
Enable behavior
Node::equalsize()
Set the equalsize attribute for this element
Node::extractNode()
Extracts this node and its childnodes
Node::findAncestor()
Return the first ancestor of a certain class of this node
Node::fireClientEvent()
Fires a remote (client) event
Node::fireLocalEvent()
Fires a local (server) event
Node::flex()
Set the flex attribute for this element
Node::focus()
Give this node focus
Node::getBehavior()
Get a behavior class.
Node::height()
Set the height of the element
Node::hidden()
Set the hidden attribute for this element
Node::initNodeLayout()
[INTERNAL FUNCTION] Initializes the attributes of a node when it is registered
Node::insertElement()
[INTERNAL FUNCTION] Inserts the newly constructed node's element into the DOM tree on the client side
Node::label()
Set the label attribute for this element
Node::margin()
Set the margin of the element
Node::marginBottom()
Set the bottom margin of the element
Node::marginLeft()
Set the left margin of the element
Node::marginRight()
Set the right margin of the element
Node::marginTop()
Set the top margin of the element
Node::mousethrough()
Indicate whether mouse events should pass through this node onto its parent
Node::orient()
Set the orient attribute for this element
Node::pack()
Set the pack attribute for this element
Node::padding()
Set the padding of the element
Node::paddingBottom()
Set the bottom padding of the element
Node::paddingLeft()
Set the left padding of the element
Node::paddingRight()
Set the right padding of the element
Node::paddingTop()
Set the top padding of the element
Node::popup()
Set a popup menu to show when clicking on this element
Node::removeAttribute()
Remove an attribute on the client-side XUL node
Node::removeBehavior()
Delete behavior
Node::removeElement()
[INTERNAL FUNCTION] Removes the node's element from the client DOM tree
Node::removeEventHandler()
Removes an event handler
Node::removeEventReflex()
Removes a previously set reflex for a certain event
Node::removeEventYielder()
Removed a node this is yielded when an event on this node fires
Node::removeNode()
Removes and unregisters this node and its childnodes
Node::removeObserver()
Remove an observer from this Node
Node::removeObservers()
Remove all observers from this Node
Node::setAttribute()
Set an attribute on the client-side XUL node
Node::setDraggable()
Set this element as draggable
Node::setDroppable()
Set this element as a dropzone
Node::setEvent()
Shorthand version for setEventType, setEventHandler and setEventYielder
Node::setEventBlocking()
Sets whether the event should block (be synchronous)
Node::setEventHandler()
Sets an event handler
Node::setEventReflex()
Sets a reflex for a certain event
Node::setEventType()
Sets the event type for a certain event
Node::setEventYielder()
Sets a node to yield when an event on this node fires
Node::setMethod()
Set a JavaScript method on the client-side node
Node::setProperty()
Set a JavaScript property on the client-side node
Node::setStyle()
Set a CSS style property on the client-side XUL node
Node::size()
Set the size of the element
Node::textColor()
Set the text color for the element
Node::textSize()
Set the text size for the element
Node::textStyle()
Set the text style for the element
Node::tooltip()
Set a tooltip to show when hovering over this element
Node::tooltiptext()
Set the tooltiptext attribute for this element
Node::unbind()
[INTERNAL FUNCTION] Removes links to child and parent nodes
Node::unlink()
[INTERNAL FUNCTION] Removes event handler and yielder links to other nodes
Node::unRegister()
[INTERNAL FUNCTION] Removes this node from the client registry
Node::value()
Set the value attribute for this element
Node::width()
Set the width of the element
Node::yield()
Manually yield this node
Node::_dropHandler()
Node::__call()
PHP Magic function: Behavior pattern handler.

Class Variables

$data =  NULL

access:  public
Type:   mixed

$dataPos =  NULL

access:  public
Type:   mixed

$destPath =

access:  public
Type:   mixed

$remoteConstructor =  'FileDownloader'

access:  public
Type:   mixed



Class Methods


constructor __construct() [line 694]

FileFromStringDownloader __construct( [string $destPath = NULL], [string $data = NULL])

Constructor

access:  public

Overrides Node::__construct() (Dynamic Constructor)

Parameters:

string   $destPath   Destination file path on the client side
string   $data   Data to store in the file

[ Top ]

method attach() [line 701]

void attach( )

access:  public

Overrides Node::attach() ([INTERNAL FUNCTION] Default attach method)

[ Top ]

method cancelDownload() [line 741]

void cancelDownload( )

Cancel a running download

Cancels the downloader which fires the 'cancelled' event


access:  public

[ Top ]

method detach() [line 708]

void detach( )

access:  public

Overrides Node::detach() ([INTERNAL FUNCTION] Default detach method)

[ Top ]

method setData() [line 730]

void setData( string $data)

Set the data to store in the file

access:  public

Parameters:

string   $data   Data to store in the file

[ Top ]

method setDestinationPath() [line 719]

void setDestinationPath( string $destPath)

Set the destination path

access:  public

Parameters:

string   $destPath   Destination file path on the client side

[ Top ]

method startDownload() [line 752]

void startDownload( )

Start the download

Starts the downloader which fires the 'started' event beforehand


access:  public

[ Top ]

method transferEnd() [line 800]

void transferEnd( )

[INTERNAL FUNCTION] This function is called by the daemon when all data has been transferred.

It is used to close open filehandles and clean up.


access:  public

[ Top ]

method transferGetData() [line 785]

void transferGetData( )

[INTERNAL FUNCTION] This function is called by the daemon to get (a piece of) data of a transfer.

It should output this data to the output buffer, which will be intercepted by the daemon.


access:  public

[ Top ]

method transferStart() [line 769]

array transferStart( )

[INTERNAL FUNCTION] This function is called by the daemon to start a transfer. It returns an array of two elements, first is a string with the MIME content-type of the data, and second is a integer number containing the size in bytes of the transfer.

return:  Transfer descriptives
access:  public

[ Top ]


Documentation generated on Mon, 07 Apr 2014 00:51:18 +0200 by phpDocumentor 1.4.3