Development/Tutorials/Plasma4/JavaScript/API-IOJobs: Difference between revisions

From KDE TechBase
(Created page with '= IOJob = This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connect...')
 
 
(No difference)

Latest revision as of 23:27, 11 September 2014

IOJob

This object is returned by input/output access for asynchronous file and data access (see the section on Extensions for documentation on getUrl). It is used by connecting Javascript functions in your code to the relevant signals.

Functions:

  • kill()
  • suspend()
  • resume()

Signals:

  • data(IOJob job, ByteArray data): emitted whenever data arrives. If data is empty (data.length == 0) then the transmission has completed.
  • dataReq(IOJob job, ByteArray data): when sending data, this signal is emitted when data is requested; add the data to be sent ot the data member, or leave it empty to signal that the process is complete and there is no more data to send
  • finished(IOJob job): emitted when the transmission has completed
  • suspended(IOJob job): emitted when the job has been suspeneded
  • resumed(IOJob job)
  • canceled(IOJob job)
  • connected(IOJob job)
  • redirection(IOJob job, Url to)
  • permanentRedirection(IOJob job, Url from, Url to)
  • mimetype(IOJob job, String mimetype)