Bumping manifests a=b2g-bump
[gecko.git] / xpcom / system / nsIGIOService.idl
blobcbbdabe7e251b846c086d9bb354ed5a872d286f1
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIUTF8StringEnumerator;
9 interface nsIURI;
11 /* nsIGIOMimeApp holds information about an application that is looked up
12 with nsIGIOService::GetAppForMimeType. */
13 // 66009894-9877-405b-9321-bf30420e34e6 prev uuid
15 [scriptable, uuid(ca6bad0c-8a48-48ac-82c7-27bb8f510fbe)]
16 interface nsIGIOMimeApp : nsISupports
18 const long EXPECTS_URIS = 0;
19 const long EXPECTS_PATHS = 1;
20 const long EXPECTS_URIS_FOR_NON_FILES = 2;
22 readonly attribute AUTF8String id;
23 readonly attribute AUTF8String name;
24 readonly attribute AUTF8String command;
25 readonly attribute long expectsURIs; // see constants above
26 readonly attribute nsIUTF8StringEnumerator supportedURISchemes;
28 void launch(in AUTF8String uri);
29 void setAsDefaultForMimeType(in AUTF8String mimeType);
30 void setAsDefaultForFileExtensions(in AUTF8String extensions);
31 void setAsDefaultForURIScheme(in AUTF8String uriScheme);
35 * The VFS service makes use of two distinct registries.
37 * The application registry holds information about applications (uniquely
38 * identified by id), such as which MIME types and URI schemes they are
39 * capable of handling, whether they run in a terminal, etc.
41 * The MIME registry holds information about MIME types, such as which
42 * extensions map to a given MIME type. The MIME registry also stores the
43 * id of the application selected to handle each MIME type.
46 // prev id dea20bf0-4e4d-48c5-b932-dc3e116dc64b
47 [scriptable, uuid(eda22a30-84e1-4e16-9ca0-cd1553c2b34a)]
48 interface nsIGIOService : nsISupports
51 /*** MIME registry methods ***/
53 /* Obtain the MIME type registered for an extension. The extension
54 should not include a leading dot. */
55 AUTF8String getMimeTypeFromExtension(in AUTF8String extension);
57 /* Obtain the preferred application for opening a given URI scheme */
58 nsIGIOMimeApp getAppForURIScheme(in AUTF8String aURIScheme);
60 /* Obtain the preferred application for opening a given MIME type */
61 nsIGIOMimeApp getAppForMimeType(in AUTF8String mimeType);
63 /* Obtain the preferred application for opening a given MIME type */
64 nsIGIOMimeApp createAppFromCommand(in AUTF8String cmd,
65 in AUTF8String appName);
67 /* Obtain a description for the given MIME type */
68 AUTF8String getDescriptionForMimeType(in AUTF8String mimeType);
70 /*** Misc. methods ***/
72 /* Open the given URI in the default application */
73 void showURI(in nsIURI uri);
74 [noscript] void showURIForInput(in ACString uri);
76 /* Open path in file manager using org.freedesktop.FileManager1 interface */
77 [noscript] void orgFreedesktopFileManager1ShowItems(in ACString path);
80 %{C++
81 #define NS_GIOSERVICE_CONTRACTID "@mozilla.org/gio-service;1"