xpcom/io/nsILocalFileWin.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     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/.
     5  */
     7 #include "nsILocalFile.idl"
     9 [scriptable, builtinclass, uuid(c7b3fd13-30f2-46e5-a0d9-7a79a9b73c5b)]
    10 interface nsILocalFileWin : nsILocalFile
    11 {
    12    /**
    13     * getVersionInfoValue
    14     *
    15     * Retrieve a metadata field from the file's VERSIONINFO block.
    16     * Throws NS_ERROR_FAILURE if no value is found, or the value is empty.
    17     *
    18     * @param   aField         The field to look up.
    19     *
    20     */
    21     AString getVersionInfoField(in string aField);
    23     /**
    24      * The canonical path of the file, which avoids short/long
    25      * pathname inconsistencies. The nsIFile persistent
    26      * descriptor is not guaranteed to be canonicalized (it may
    27      * persist either the long or the short path name). The format of
    28      * the canonical path will vary with the underlying file system:
    29      * it will typically be the short pathname on filesystems that
    30      * support both short and long path forms.
    31      */
    32     readonly attribute AString canonicalPath;
    33     [noscript] readonly attribute ACString nativeCanonicalPath;
    35     /**
    36      * Windows specific file attributes.
    37      */
    39     /*
    40      * WFA_SEARCH_INDEXED: Generally the default on files in Windows except
    41      * those created in temp locations. Valid on XP and up. When set the
    42      * file or directory is marked to be indexed by desktop search services.
    43      */
    44     const unsigned long WFA_SEARCH_INDEXED = 1;
    46     /*
    47      * WFA_READONLY: Whether the file is readonly or not.
    48      */
    49     const unsigned long WFA_READONLY = 2;
    51     /*
    52      * WFA_READWRITE: Used to clear the readonly attribute.
    53      */
    54     const unsigned long WFA_READWRITE = 4;
    56     /**
    57      * fileAttributesWin
    58      *
    59      * Set or get windows specific file attributes.
    60      * 
    61      * Throws NS_ERROR_FILE_INVALID_PATH for an invalid file.
    62      * Throws NS_ERROR_FAILURE if the set or get fails.
    63      */
    64     attribute unsigned long fileAttributesWin;
    66     /**
    67      * setShortcut
    68      *
    69      * Creates the specified shortcut, or updates it if it already exists.
    70      *
    71      * If the shortcut is being updated (i.e. the shortcut already exists),
    72      * any excluded parameters will remain unchanged in the shortcut file.
    73      * For example, if you want to change the description of a specific
    74      * shortcut but keep the target, working dir, args, and icon the same,
    75      * pass null for those parameters and only pass in a value for the
    76      * description.
    77      *
    78      * If the shortcut does not already exist and targetFile is not specified,
    79      * setShortcut will throw NS_ERROR_FILE_TARGET_DOES_NOT_EXIST.
    80      *
    81      * @param targetFile      the path that the shortcut should target
    82      * @param workingDir      the working dir that should be set for the shortcut
    83      * @param args            the args string that should be set for the shortcut
    84      * @param description     the description that should be set for the shortcut
    85      * @param iconFile        the file containing an icon to be used for this
    86                               shortcut
    87      * @param iconIndex       this value selects a specific icon from within
    88                               iconFile.  If iconFile contains only one icon, this
    89                               value should be 0.
    90      */
    91      void setShortcut([optional] in nsIFile targetFile,
    92                       [optional] in nsIFile workingDir,
    93                       [optional] in wstring args,
    94                       [optional] in wstring description,
    95                       [optional] in nsIFile iconFile,
    96                       [optional] in long iconIndex);
    97 };

mercurial