Back to index

lightning-sunbird  0.9+nobinonly
nsITransferable.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corp.
00020  * Portions created by the Initial Developer are Copyright (C) 1999
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Mike Pinkerton
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsISupports.idl"
00041 #include "nsISupportsArray.idl"
00042 #include "nsIFormatConverter.idl"
00043 
00044 
00045 %{ C++
00046 
00047 // these probably shouldn't live here, but in some central repository shared
00048 // by the entire app.
00049 #define kTextMime                   "text/plain"
00050 #define kUnicodeMime                "text/unicode"
00051 #define kHTMLMime                   "text/html"
00052 #define kAOLMailMime                "AOLMAIL"
00053 #define kPNGImageMime               "image/png"
00054 #define kJPEGImageMime              "image/jpg"
00055 #define kGIFImageMime               "image/gif"
00056 #define kFileMime                   "application/x-moz-file"
00057 
00058 #define kURLMime                    "text/x-moz-url"        // data contains url\ntitle
00059 #define kURLDataMime                "text/x-moz-url-data"   // data contains url only
00060 #define kURLDescriptionMime         "text/x-moz-url-desc"   // data contains description
00061 #define kURLPrivateMime             "text/x-moz-url-priv"   // same as kURLDataMime but for private uses
00062 #define kNativeImageMime            "application/x-moz-nativeimage"
00063 #define kNativeHTMLMime             "application/x-moz-nativehtml"
00064 
00065 // the source URL for a file promise
00066 #define kFilePromiseURLMime         "application/x-moz-file-promise-url"
00067 // the destination filename for a file promise
00068 #define kFilePromiseDestFilename    "application/x-moz-file-promise-dest-filename"
00069 // a dataless flavor used to interact with the OS during file drags
00070 #define kFilePromiseMime            "application/x-moz-file-promise"
00071 // a synthetic flavor, put into the transferable once we know the destination directory of a file drag
00072 #define kFilePromiseDirectoryMime   "application/x-moz-file-promise-dir"
00073 
00074 %}
00075 
00076 
00089 interface nsITransferable;
00090 
00091 [scriptable, uuid(7E225E5F-711C-11D7-9FAE-000393636592)]
00092 interface nsIFlavorDataProvider : nsISupports
00093 {
00094 
00103   void getFlavorData(in nsITransferable aTransferable, in string aFlavor, out nsISupports aData, out unsigned long aDataLen);
00104 };
00105 
00106 
00107 [scriptable, uuid(8B5314BC-DB01-11d2-96CE-0060B0FB9956)]
00108 interface nsITransferable : nsISupports
00109 {
00110   const long kFlavorHasDataProvider = 0;
00111   
00119   nsISupportsArray flavorsTransferableCanExport ( ) ;
00120 
00128   void getTransferData ( in string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
00129 
00138   void getAnyTransferData ( out string aFlavor, out nsISupports aData, out unsigned long aDataLen ) ;
00139 
00143   boolean isLargeDataSet ( ) ;
00144   
00145 
00147     // Setter part of interface 
00149 
00157   nsISupportsArray flavorsTransferableCanImport ( ) ;
00158 
00168   void setTransferData ( in string aFlavor, in nsISupports aData, in unsigned long aDataLen ) ;
00169 
00176   void addDataFlavor ( in string aDataFlavor ) ;
00177 
00184   void removeDataFlavor ( in string aDataFlavor ) ;
00185 
00186   attribute nsIFormatConverter converter;
00187 
00188 };
00189