1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is the Mozilla GNOME integration code.
17 * The Initial Developer of the Original Code is
19 * Portions created by the Initial Developer are Copyright (C) 2004
20 * the Initial Developer. All Rights Reserved.
23 * Brian Ryner <bryner@brianryner.com>
24 * Jan Horak <jhorak@redhat.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
42 interface nsIUTF8StringEnumerator
;
45 /* nsIGIOMimeApp holds information about an application that is looked up
46 with nsIGIOService::GetAppForMimeType. */
47 // 66009894-9877-405b-9321-bf30420e34e6 prev uuid
49 [scriptable
, uuid(e77021b4
-4012-407d
-b686
-7a1f18050109
)]
50 interface nsIGIOMimeApp
: nsISupports
52 const long EXPECTS_URIS
= 0;
53 const long EXPECTS_PATHS
= 1;
54 const long EXPECTS_URIS_FOR_NON_FILES
= 2;
56 readonly attribute AUTF8String
id;
57 readonly attribute AUTF8String name
;
58 readonly attribute AUTF8String command
;
59 readonly attribute
long expectsURIs
; // see constants above
60 readonly attribute nsIUTF8StringEnumerator supportedURISchemes
;
62 void launch
(in AUTF8String uri
);
63 void setAsDefaultForMimeType
(in AUTF8String mimeType
);
64 void setAsDefaultForFileExtensions
(in AUTF8String extensions
);
68 * The VFS service makes use of two distinct registries.
70 * The application registry holds information about applications (uniquely
71 * identified by id), such as which MIME types and URI schemes they are
72 * capable of handling, whether they run in a terminal, etc.
74 * The MIME registry holds information about MIME types, such as which
75 * extensions map to a given MIME type. The MIME registry also stores the
76 * id of the application selected to handle each MIME type.
79 // prev id dea20bf0-4e4d-48c5-b932-dc3e116dc64b
80 [scriptable
, uuid(47e372c2
-78bb
-4899-8114-56aa7d9cdac5
)]
81 interface nsIGIOService
: nsISupports
84 /*** MIME registry methods ***/
86 /* Obtain the MIME type registered for an extension. The extension
87 should not include a leading dot. */
88 AUTF8String getMimeTypeFromExtension
(in AUTF8String extension
);
90 /* Obtain the preferred application for opening a given MIME type */
91 nsIGIOMimeApp getAppForMimeType
(in AUTF8String mimeType
);
93 /* Obtain the preferred application for opening a given MIME type */
94 nsIGIOMimeApp createAppFromCommand
(in AUTF8String cmd
,
95 in AUTF8String appName
);
97 /* Obtain a description for the given MIME type */
98 AUTF8String getDescriptionForMimeType
(in AUTF8String mimeType
);
100 /*** Misc. methods ***/
102 /* Open the given URI in the default application */
103 void showURI
(in nsIURI uri
);
104 [noscript
] void showURIForInput
(in ACString uri
);
108 #define NS_GIOSERVICE_CONTRACTID
"@mozilla.org/gio-service;1"