/usr/share/idl/firefox/nsIFileProtocolHandler.idl is in firefox-dev 11.0+build1-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Darin Fisher <darin@netscape.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIProtocolHandler.idl"
interface nsIFile;
[scriptable, uuid(1fb25bd5-4354-4dcd-8d97-621b7b3ed2e4)]
interface nsIFileProtocolHandler : nsIProtocolHandler
{
/**
* This method constructs a new file URI
*
* @param aFile nsIFile
* @return reference to a new nsIURI object
*/
nsIURI newFileURI(in nsIFile aFile);
/**
* Converts the nsIFile to the corresponding URL string. NOTE: under
* some platforms this is a lossy conversion (e.g., Mac Carbon build).
* If the nsIFile is a local file, then the result will be a file://
* URL string.
*
* The resulting string may contain URL-escaped characters.
* NOTE: Callers should use getURLSpecFromActualFile or
* getURLSpecFromDirFile if possible, for performance reasons.
*/
AUTF8String getURLSpecFromFile(in nsIFile file);
/**
* Converts the nsIFile to the corresponding URL string. Should
* only be called on files which are not directories. Otherwise
* identical to getURLSpecFromFile, but is usually more efficient.
* WARNING: This restriction may not be enforced at runtime!
*/
AUTF8String getURLSpecFromActualFile(in nsIFile file);
/**
* Converts the nsIFile to the corresponding URL string. Should
* only be called on files which are directories. Otherwise
* identical to getURLSpecFromFile, but is usually more efficient.
* WARNING: This restriction may not be enforced at runtime!
*/
AUTF8String getURLSpecFromDir(in nsIFile file);
/**
* Converts the URL string into the corresponding nsIFile if possible.
* A local file will be created if the URL string begins with file://.
*/
nsIFile getFileFromURLSpec(in AUTF8String url);
/**
* Takes a local file and tries to interpret it as an internet shortcut
* (e.g. .url files on windows).
* @param file The local file to read
* @return The URI the file refers to
*
* @throw NS_ERROR_NOT_AVAILABLE if the OS does not support such files.
* @throw NS_ERROR_NOT_AVAILABLE if this file is not an internet shortcut.
*/
nsIURI readURLFile(in nsIFile file);
};
|