xpcom/system/nsIGIOService.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial