widget/nsIFormatConverter.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIFormatConverter.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +#include "nsISupportsArray.idl"
    1.11 +
    1.12 +
    1.13 +[scriptable, uuid(948A0023-E3A7-11d2-96CF-0060B0FB9956)]
    1.14 +interface nsIFormatConverter : nsISupports
    1.15 +{  
    1.16 +  /**
    1.17 +    * Get the list of the "input" data flavors (mime types as nsISupportsCString),
    1.18 +    * in otherwords, the flavors that this converter can convert "from" (the 
    1.19 +    * incoming data to the converter).
    1.20 +    */
    1.21 +  nsISupportsArray getInputDataFlavors ( ) ;
    1.22 +
    1.23 +  /**
    1.24 +    * Get the list of the "output" data flavors (mime types as nsISupportsCString),
    1.25 +    * in otherwords, the flavors that this converter can convert "to" (the 
    1.26 +    * outgoing data to the converter).
    1.27 +    *
    1.28 +    * @param  aDataFlavorList fills list with supported flavors
    1.29 +    */
    1.30 +  nsISupportsArray getOutputDataFlavors ( ) ;
    1.31 +
    1.32 +  /**
    1.33 +    * Determines whether a conversion from one flavor to another is supported
    1.34 +    *
    1.35 +    * @param  aFromFormatConverter flavor to convert from
    1.36 +    * @param  aFromFormatConverter flavor to convert to
    1.37 +    */
    1.38 +  boolean canConvert ( in string aFromDataFlavor, in string aToDataFlavor ) ;
    1.39 +
    1.40 +  /**
    1.41 +    * Converts from one flavor to another.
    1.42 +    *
    1.43 +    * @param  aFromFormatConverter flavor to convert from
    1.44 +    * @param  aFromFormatConverter flavor to convert to (destination own the memory)
    1.45 +    * @returns returns NS_OK if it was converted
    1.46 +    */
    1.47 +  void convert ( in string aFromDataFlavor, in nsISupports aFromData, in unsigned long aDataLen,
    1.48 +                   in string aToDataFlavor, out nsISupports aToData, out unsigned long aDataToLen ) ; 
    1.49 +
    1.50 +};
    1.51 +
    1.52 +
    1.53 +%{ C++
    1.54 +
    1.55 +%}

mercurial