1999-07-03 00:08:27 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
1999-07-03 00:08:27 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* 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.
|
1999-07-03 00:08:27 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-07-03 00:08:27 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
2000-01-24 18:41:03 +03:00
|
|
|
* Contributor(s): Judson Valeski
|
1999-07-03 00:08:27 +04:00
|
|
|
*/
|
|
|
|
|
2000-01-24 18:41:03 +03:00
|
|
|
/* An nsIMIMEInfo gives a user access to mime information.
|
|
|
|
* there is a one-to-many relationship between MIME types
|
|
|
|
* and file extensions. This means that a MIMEInfo object
|
|
|
|
* may have multiple file extensions associated with it.
|
|
|
|
* However, the reverse is not true.
|
1999-07-03 00:08:27 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2001-07-16 06:40:48 +04:00
|
|
|
interface nsIURI;
|
2000-06-21 10:34:43 +04:00
|
|
|
interface nsIFile;
|
|
|
|
|
|
|
|
typedef long nsMIMEInfoHandleAction;
|
2000-04-05 07:03:50 +04:00
|
|
|
|
1999-07-03 00:08:27 +04:00
|
|
|
[scriptable, uuid(6A57EAE0-2FE8-11d3-A164-0050041CAF44)]
|
|
|
|
interface nsIMIMEInfo : nsISupports {
|
2000-01-24 18:41:03 +03:00
|
|
|
/* Gives you an array of file types associated with this type.
|
|
|
|
*
|
|
|
|
* @return Number of elements in the array.
|
|
|
|
* @return Array of extensions.
|
|
|
|
*/
|
2000-04-28 14:51:52 +04:00
|
|
|
void GetFileExtensions(out PRUint32 elementCount,
|
2000-01-24 18:41:03 +03:00
|
|
|
[array, size_is(elementCount)] out string extensions);
|
1999-07-03 00:08:27 +04:00
|
|
|
|
2000-04-19 08:45:30 +04:00
|
|
|
/* Set File Extensions. Input is a comma deliminated list of extensions
|
|
|
|
*/
|
|
|
|
void SetFileExtensions( in string aExtensions );
|
|
|
|
|
2000-01-24 18:41:03 +03:00
|
|
|
/* Returns whether or not the given extension is
|
|
|
|
* associated with this MIME info.
|
|
|
|
*
|
|
|
|
* @return TRUE if the assocaition exists.
|
|
|
|
*/
|
1999-07-03 00:08:27 +04:00
|
|
|
|
2000-01-24 18:41:03 +03:00
|
|
|
boolean ExtensionExists(in string aExtension);
|
1999-07-03 00:08:27 +04:00
|
|
|
|
2000-01-24 18:41:03 +03:00
|
|
|
/* Returns the first extension association in
|
|
|
|
* the internal set of extensions.
|
|
|
|
*
|
|
|
|
* @return The first extension.
|
|
|
|
*/
|
|
|
|
string FirstExtension();
|
2000-04-05 07:03:50 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Append a given extension to the set of extensions
|
|
|
|
*/
|
|
|
|
void AppendExtension(in string aExtension);
|
2000-01-24 18:41:03 +03:00
|
|
|
|
|
|
|
/* The MIME type of this MIMEInfo.
|
|
|
|
*
|
|
|
|
* @return String representing the MIME type.
|
|
|
|
*/
|
2000-04-05 07:03:50 +04:00
|
|
|
attribute string MIMEType;
|
2000-01-24 18:41:03 +03:00
|
|
|
|
|
|
|
/* A human readable description of the MIME info
|
|
|
|
*
|
|
|
|
* @return The description
|
|
|
|
*/
|
2000-04-05 07:03:50 +04:00
|
|
|
attribute wstring Description;
|
2000-01-24 18:41:03 +03:00
|
|
|
|
|
|
|
/* Gives you arbitrary data about the MIMEInfo. An example
|
|
|
|
* of this is a generic image graphically representing
|
|
|
|
* this MIME info. This image can be used to generically
|
|
|
|
* and graphically represent the type.
|
|
|
|
*
|
|
|
|
* @return A URI representing the data location.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI DataURI;
|
2000-04-05 07:03:50 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Mac Type and creator types
|
|
|
|
*/
|
|
|
|
attribute PRUint32 MacType;
|
|
|
|
attribute PRUint32 MacCreator;
|
|
|
|
|
2000-01-24 18:41:03 +03:00
|
|
|
/* Returns whether or not these two MIME infos are logically
|
|
|
|
* equivelent maintaining the one-to-many relationship between
|
|
|
|
* MIME types and file extensions.
|
|
|
|
*
|
|
|
|
* @returns TRUE if the two are considered equal
|
|
|
|
*/
|
1999-07-03 00:08:27 +04:00
|
|
|
boolean Equals(in nsIMIMEInfo aMIMEInfo);
|
2000-06-21 10:34:43 +04:00
|
|
|
|
|
|
|
/* Returns a nsIFile that points to the application the user has said
|
|
|
|
* they want associated with this content type. This is not always guarunteed
|
|
|
|
* to be set!!
|
|
|
|
*/
|
|
|
|
attribute nsIFile preferredApplicationHandler;
|
|
|
|
|
|
|
|
/* a pretty name description of the associated application */
|
|
|
|
attribute wstring applicationDescription;
|
|
|
|
|
|
|
|
const long saveToDisk = 0;
|
|
|
|
const long alwaysAsk = 1;
|
|
|
|
const long useHelperApp = 2;
|
|
|
|
const long handleInternally = 3;
|
2000-07-12 03:11:59 +04:00
|
|
|
const long useSystemDefault = 4;
|
2000-06-21 10:34:43 +04:00
|
|
|
|
|
|
|
/* preferredAction is how the user specified they would like to handle
|
2000-07-12 03:11:59 +04:00
|
|
|
* this content type: save to disk, use specified helper app, use OS
|
|
|
|
* default handler or handle using navigator.
|
2000-06-21 10:34:43 +04:00
|
|
|
*/
|
|
|
|
attribute nsMIMEInfoHandleAction preferredAction;
|
2000-07-12 03:11:59 +04:00
|
|
|
|
|
|
|
/* alwaysAskBeforeHandling: if true, we should always give the user a dialog
|
|
|
|
* asking how to dispose of this content.
|
|
|
|
*/
|
|
|
|
attribute boolean alwaysAskBeforeHandling;
|
2000-04-28 14:51:52 +04:00
|
|
|
};
|
2000-06-21 10:34:43 +04:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define NS_MIMEINFO_CID \
|
|
|
|
{ /* {95df6583-0001-11d4-a12b-a66ef662f0bc} */ \
|
|
|
|
0x95df6583, \
|
|
|
|
0x0001, \
|
|
|
|
0x11d4, \
|
|
|
|
{ 0xa1, 0x2b, 0xa6, 0x6e, 0xf6, 0x62, 0xf0, 0xbc } \
|
|
|
|
}
|
|
|
|
|
2000-09-14 03:57:52 +04:00
|
|
|
#define NS_MIMEINFO_CONTRACTID "@mozilla.org/mime-info;1"
|
2000-06-21 10:34:43 +04:00
|
|
|
%}
|