michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIUTF8StringEnumerator; michael@0: interface nsIURI; michael@0: michael@0: /* nsIGnomeVFSMimeApp holds information about an application that is looked up michael@0: with nsIGnomeVFSService::GetAppForMimeType. */ michael@0: michael@0: [scriptable, uuid(66009894-9877-405b-9321-bf30420e34e6)] michael@0: interface nsIGnomeVFSMimeApp : nsISupports michael@0: { michael@0: const long EXPECTS_URIS = 0; michael@0: const long EXPECTS_PATHS = 1; michael@0: const long EXPECTS_URIS_FOR_NON_FILES = 2; michael@0: michael@0: readonly attribute AUTF8String id; michael@0: readonly attribute AUTF8String name; michael@0: readonly attribute AUTF8String command; michael@0: readonly attribute boolean canOpenMultipleFiles; michael@0: readonly attribute long expectsURIs; // see constants above michael@0: readonly attribute nsIUTF8StringEnumerator supportedURISchemes; michael@0: readonly attribute boolean requiresTerminal; michael@0: michael@0: void launch(in AUTF8String uri); michael@0: }; michael@0: michael@0: /* michael@0: * The VFS service makes use of a registry for information. michael@0: * michael@0: * The MIME registry holds information about MIME types, such as which michael@0: * extensions map to a given MIME type. The MIME registry also stores the michael@0: * id of the application selected to handle each MIME type. michael@0: */ michael@0: michael@0: [scriptable, uuid(d1ac73a6-2ceb-4164-8142-215afe7fe8a6)] michael@0: interface nsIGnomeVFSService : nsISupports michael@0: { michael@0: /*** MIME registry methods ***/ michael@0: michael@0: /* Obtain the MIME type registered for an extension. The extension michael@0: should not include a leading dot. */ michael@0: AUTF8String getMimeTypeFromExtension(in AUTF8String extension); michael@0: michael@0: /* Obtain the preferred application for opening a given MIME type */ michael@0: nsIGnomeVFSMimeApp getAppForMimeType(in AUTF8String mimeType); michael@0: michael@0: /* Obtain a description for the given MIME type */ michael@0: AUTF8String getDescriptionForMimeType(in AUTF8String mimeType); michael@0: michael@0: /*** Misc. methods ***/ michael@0: michael@0: /* Open the given URI in the default application */ michael@0: void showURI(in nsIURI uri); michael@0: [noscript] void showURIForInput(in ACString uri); michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_GNOMEVFSSERVICE_CONTRACTID "@mozilla.org/gnome-vfs-service;1" michael@0: %}