michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsISupportsArray.idl" michael@0: michael@0: michael@0: [scriptable, uuid(948A0023-E3A7-11d2-96CF-0060B0FB9956)] michael@0: interface nsIFormatConverter : nsISupports michael@0: { michael@0: /** michael@0: * Get the list of the "input" data flavors (mime types as nsISupportsCString), michael@0: * in otherwords, the flavors that this converter can convert "from" (the michael@0: * incoming data to the converter). michael@0: */ michael@0: nsISupportsArray getInputDataFlavors ( ) ; michael@0: michael@0: /** michael@0: * Get the list of the "output" data flavors (mime types as nsISupportsCString), michael@0: * in otherwords, the flavors that this converter can convert "to" (the michael@0: * outgoing data to the converter). michael@0: * michael@0: * @param aDataFlavorList fills list with supported flavors michael@0: */ michael@0: nsISupportsArray getOutputDataFlavors ( ) ; michael@0: michael@0: /** michael@0: * Determines whether a conversion from one flavor to another is supported michael@0: * michael@0: * @param aFromFormatConverter flavor to convert from michael@0: * @param aFromFormatConverter flavor to convert to michael@0: */ michael@0: boolean canConvert ( in string aFromDataFlavor, in string aToDataFlavor ) ; michael@0: michael@0: /** michael@0: * Converts from one flavor to another. michael@0: * michael@0: * @param aFromFormatConverter flavor to convert from michael@0: * @param aFromFormatConverter flavor to convert to (destination own the memory) michael@0: * @returns returns NS_OK if it was converted michael@0: */ michael@0: void convert ( in string aFromDataFlavor, in nsISupports aFromData, in unsigned long aDataLen, michael@0: in string aToDataFlavor, out nsISupports aToData, out unsigned long aDataToLen ) ; michael@0: michael@0: }; michael@0: michael@0: michael@0: %{ C++ michael@0: michael@0: %}