1999-08-31 01:54:23 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-08-25 12:34:46 +04:00
|
|
|
*
|
1999-08-31 01:54:23 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape Communications
|
|
|
|
* Corp. Portions created by Netscape are Copyright (C) 1999 Netscape
|
|
|
|
* Communications Corp. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Mike Pinkerton
|
1999-08-25 12:34:46 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsISupportsArray.idl"
|
|
|
|
#include "nsIFormatConverter.idl"
|
|
|
|
|
|
|
|
|
|
|
|
%{ C++
|
|
|
|
|
|
|
|
// these probably shouldn't live here, but in some central repository shared
|
|
|
|
// by the entire app.
|
|
|
|
#define kTextMime "text/plain"
|
|
|
|
#define kUnicodeMime "text/unicode"
|
|
|
|
#define kHTMLMime "text/html"
|
|
|
|
#define kAOLMailMime "AOLMAIL"
|
|
|
|
#define kPNGImageMime "image/png"
|
|
|
|
#define kJPEGImageMime "image/jpg"
|
|
|
|
#define kGIFImageMime "image/gif"
|
2000-05-03 02:37:52 +04:00
|
|
|
#define kFileMime "application/x-moz-file"
|
|
|
|
#define kURLMime "text/x-moz-url"
|
2002-04-23 18:24:48 +04:00
|
|
|
#define kNativeImageMime "application/x-moz-nativeimage"
|
2002-05-07 23:45:58 +04:00
|
|
|
#define kNativeHTMLMime "application/x-moz-nativehtml"
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
[scriptable, uuid(8B5314BC-DB01-11d2-96CE-0060B0FB9956)]
|
|
|
|
interface nsITransferable : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2002-08-06 04:53:19 +04:00
|
|
|
* Computes a list of flavors (mime types as nsISupportsCString) that the transferable
|
1999-08-25 12:34:46 +04:00
|
|
|
* can export, either through intrinsic knowledge or output data converters.
|
|
|
|
*
|
|
|
|
* @param aDataFlavorList fills list with supported flavors. This is a copy of
|
|
|
|
* the internal list, so it may be edited w/out affecting the transferable.
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
nsISupportsArray flavorsTransferableCanExport ( ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Given a flavor retrieve the data.
|
|
|
|
*
|
|
|
|
* @param aFlavor (in parameter) the flavor of data to retrieve
|
|
|
|
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
|
|
|
|
* @param aDataLen the length of the data
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void getTransferData ( in string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the best flavor in the transferable, given those that have
|
|
|
|
* been added to it with |AddFlavor()|
|
|
|
|
*
|
|
|
|
* @param aFlavor (out parameter) the flavor of data that was retrieved
|
|
|
|
* @param aData the data. Some variant of class in nsISupportsPrimitives.idl
|
|
|
|
* @param aDataLen the length of the data
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void getAnyTransferData ( out string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the data is large.
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
boolean isLargeDataSet ( ) ;
|
2000-05-03 02:37:52 +04:00
|
|
|
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
// Setter part of interface
|
|
|
|
///////////////////////////////
|
|
|
|
|
|
|
|
/**
|
2002-08-06 04:53:19 +04:00
|
|
|
* Computes a list of flavors (mime types as nsISupportsCString) that the transferable can
|
1999-08-25 12:34:46 +04:00
|
|
|
* accept into it, either through intrinsic knowledge or input data converters.
|
|
|
|
*
|
|
|
|
* @param outFlavorList fills list with supported flavors. This is a copy of
|
|
|
|
* the internal list, so it may be edited w/out affecting the transferable.
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
nsISupportsArray flavorsTransferableCanImport ( ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the data in the transferable with the specified flavor. The transferable
|
|
|
|
* will maintain its own copy the data, so it is not necessary to do that beforehand.
|
|
|
|
*
|
|
|
|
* @param aFlavor the flavor of data that is being set
|
|
|
|
* @param aData the data, some variant of class in nsISupportsPrimitives.idl
|
|
|
|
* @param aDataLen the length of the data
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void setTransferData ( in string aFlavor, in nsISupports aData, in unsigned long aDataLen ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add the data flavor, indicating that this transferable
|
|
|
|
* can receive this type of flavor
|
|
|
|
*
|
|
|
|
* @param aDataFlavor a new data flavor to handle
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void addDataFlavor ( in string aDataFlavor ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the data flavor matching the given one (string compare) and the data
|
|
|
|
* that goes along with it.
|
|
|
|
*
|
|
|
|
* @param aDataFlavor a data flavor to remove
|
|
|
|
*/
|
1999-08-31 01:54:23 +04:00
|
|
|
void removeDataFlavor ( in string aDataFlavor ) ;
|
1999-08-25 12:34:46 +04:00
|
|
|
|
|
|
|
attribute nsIFormatConverter converter;
|
|
|
|
|
|
|
|
};
|
|
|
|
|