1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/system/nsIGnomeVFSService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIUTF8StringEnumerator; 1.12 +interface nsIURI; 1.13 + 1.14 +/* nsIGnomeVFSMimeApp holds information about an application that is looked up 1.15 + with nsIGnomeVFSService::GetAppForMimeType. */ 1.16 + 1.17 +[scriptable, uuid(66009894-9877-405b-9321-bf30420e34e6)] 1.18 +interface nsIGnomeVFSMimeApp : nsISupports 1.19 +{ 1.20 + const long EXPECTS_URIS = 0; 1.21 + const long EXPECTS_PATHS = 1; 1.22 + const long EXPECTS_URIS_FOR_NON_FILES = 2; 1.23 + 1.24 + readonly attribute AUTF8String id; 1.25 + readonly attribute AUTF8String name; 1.26 + readonly attribute AUTF8String command; 1.27 + readonly attribute boolean canOpenMultipleFiles; 1.28 + readonly attribute long expectsURIs; // see constants above 1.29 + readonly attribute nsIUTF8StringEnumerator supportedURISchemes; 1.30 + readonly attribute boolean requiresTerminal; 1.31 + 1.32 + void launch(in AUTF8String uri); 1.33 +}; 1.34 + 1.35 +/* 1.36 + * The VFS service makes use of a registry for information. 1.37 + * 1.38 + * The MIME registry holds information about MIME types, such as which 1.39 + * extensions map to a given MIME type. The MIME registry also stores the 1.40 + * id of the application selected to handle each MIME type. 1.41 + */ 1.42 + 1.43 +[scriptable, uuid(d1ac73a6-2ceb-4164-8142-215afe7fe8a6)] 1.44 +interface nsIGnomeVFSService : nsISupports 1.45 +{ 1.46 + /*** MIME registry methods ***/ 1.47 + 1.48 + /* Obtain the MIME type registered for an extension. The extension 1.49 + should not include a leading dot. */ 1.50 + AUTF8String getMimeTypeFromExtension(in AUTF8String extension); 1.51 + 1.52 + /* Obtain the preferred application for opening a given MIME type */ 1.53 + nsIGnomeVFSMimeApp getAppForMimeType(in AUTF8String mimeType); 1.54 + 1.55 + /* Obtain a description for the given MIME type */ 1.56 + AUTF8String getDescriptionForMimeType(in AUTF8String mimeType); 1.57 + 1.58 + /*** Misc. methods ***/ 1.59 + 1.60 + /* Open the given URI in the default application */ 1.61 + void showURI(in nsIURI uri); 1.62 + [noscript] void showURIForInput(in ACString uri); 1.63 +}; 1.64 + 1.65 +%{C++ 1.66 +#define NS_GNOMEVFSSERVICE_CONTRACTID "@mozilla.org/gnome-vfs-service;1" 1.67 +%}