Rationale

A GroupDownload represents a collection of downloads that will be performed as an atomic operation, that means, if a single download fails the group fails and for the group to succeed all downloads most be downloaded correctly.

Interface

The following defines the public interface exposed by the DownloadManager.

Methods

totalSize(OUT UInt64 size)

progress(OUT UInt64 count, OUT UInt64 started, OUT UInt64 paused, OUT UInt64 finished )

metadata(OUT Dict<String, Variant> metadata)

setThrottle(IN UInt64 value)

throttle(OUT UInt64 value)

allowGSMDownload(IN Bool isAllowed)

isGSMDownloadAllowed(OUT Bool isAllowed)

start()

pause()

resume()

cancel()

Signals

started(OUT Bool started)

paused(OUT Bool paused)

resumed(OUT Bool resumed)

canceled(OUT Bool canceled)

hashing(OUT String localPath)

processing(OUT String localPath)

finished(OUT Array<String> localPaths)

error(OUT String errorMsg)

progress(OUT UInt64 received, OUT UInt64 total)

DBus API XML Definition

The following is an XML definition of the DBus interface that can be used to generate adapters in different languages:

   1 <node>
   2   <interface name="com.canonical.applications.GroupDownload">
   3 
   4     <method name="totalSize">
   5         <arg name="total" type="t" direction="out"/>
   6     </method>
   7 
   8     <method name="progress">
   9         <arg name="count" type="t" direction="out"/>
  10         <arg name="started" type="t" direction="out"/>
  11         <arg name="paused" type="t" direction="out"/>
  12         <arg name="finished" type="t" direction="out"/>
  13     </method>
  14 
  15     <method name="metadata">
  16         <arg name="data" type="a{sv}" direction="out" />
  17     </method>
  18 
  19     <method name="setThrottle">
  20         <arg name="speed" type="t" direction="in"/>
  21     </method>
  22 
  23     <method name="throttle">
  24         <arg name="speed" type="t" direction="out"/>
  25     </method>
  26 
  27     <method name="allowGSMDownload">
  28         <arg name="allowed" type="b" direction="in"/>
  29     </method>
  30 
  31     <method name="isGSMDownloadAllowed">
  32         <arg name="allowed" type="b" direction="out"/>
  33     </method>
  34 
  35     <method name="start" />
  36     <method name="pause" />
  37     <method name="resume" />
  38     <method name="cancel" />
  39 
  40     <signal name="started">
  41         <arg name="success" type="b" direction="out"/>
  42     </signal>
  43 
  44     <signal name="paused">
  45         <arg name="success" type="b" direction="out"/>
  46     </signal>
  47 
  48     <signal name="resumed">
  49         <arg name="success" type="b" direction="out"/>
  50     </signal>
  51 
  52     <signal name="canceled">
  53         <arg name="success" type="b" direction="out"/>
  54     </signal>
  55 
  56     <signal name="hashing">
  57         <arg name="path" type="s" direction="out"/>
  58     </signal>
  59 
  60     <signal name="processing">
  61         <arg name="path" type="s" direction="out"/>
  62     </signal>
  63 
  64     <signal name="finished">
  65         <arg name="path" type="as" direction="out"/>
  66     </signal>
  67 
  68     <signal name="error">
  69         <arg name="error" type="s" direction="out"/>
  70     </signal>
  71 
  72     <signal name="progress">
  73         <arg name="received" type="t" direction="out"/>
  74         <arg name="total" type="t" direction="out"/>
  75     </signal>
  76 
  77  </interface>
  78 </node>

Code Examples

DownloadService/GroupDownload (last edited 2013-11-07 14:59:20 by mail)