toolkit/components/jsdownloads/public/mozIDownloadPlatform.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/jsdownloads/public/mozIDownloadPlatform.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +
    1.10 +interface nsIURI;
    1.11 +interface nsIFile;
    1.12 +
    1.13 +[scriptable, uuid(9f556e4a-d9b3-46c3-9f8f-d0db1ac6c8c1)]
    1.14 +interface mozIDownloadPlatform : nsISupports
    1.15 +{
    1.16 +  /**
    1.17 +   * Perform platform specific operations when a download is done.
    1.18 +   *
    1.19 +   *   Windows:
    1.20 +   *     Add the download to the recent documents list
    1.21 +   *     Set the file to be indexed for searching
    1.22 +   *   Mac:
    1.23 +   *     Bounce the downloads dock icon
    1.24 +   *   GTK:
    1.25 +   *     Add the download to the recent documents list
    1.26 +   *     Save the source uri in the downloaded file's metadata
    1.27 +   *   Android:
    1.28 +   *     Scan media
    1.29 +   *
    1.30 +   * @param aSource
    1.31 +   *        Source URI of the download
    1.32 +   * @param aTarget
    1.33 +   *        Downloaded file
    1.34 +   * @param aContentType
    1.35 +   *        The source's content type
    1.36 +   * @param aIsPrivate
    1.37 +   *        True for private downloads
    1.38 +   * @return none
    1.39 +   */
    1.40 +  void downloadDone(in nsIURI aSource, in nsIFile aTarget,
    1.41 +                    in ACString aContentType, in boolean aIsPrivate);
    1.42 +
    1.43 +  /**
    1.44 +   * Security Zone constants. Used by mapUrlToZone().
    1.45 +   */
    1.46 +  const unsigned long ZONE_MY_COMPUTER = 0;
    1.47 +  const unsigned long ZONE_INTRANET = 1;
    1.48 +  const unsigned long ZONE_TRUSTED = 2;
    1.49 +  const unsigned long ZONE_INTERNET = 3;
    1.50 +  const unsigned long ZONE_RESTRICTED = 4;
    1.51 +
    1.52 +  /**
    1.53 +   * Proxy for IInternetSecurityManager::MapUrlToZone().
    1.54 +   *
    1.55 +   *   Windows only.
    1.56 +   *
    1.57 +   * @param aURL
    1.58 +   *        URI of the download
    1.59 +   * @return Security Zone corresponding to aURL.
    1.60 +   */
    1.61 +  unsigned long mapUrlToZone(in AString aURL);
    1.62 +};

mercurial