xpcom/io/nsILocalFileWin.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/io/nsILocalFileWin.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     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 +
    1.10 +#include "nsILocalFile.idl"
    1.11 +
    1.12 +[scriptable, builtinclass, uuid(c7b3fd13-30f2-46e5-a0d9-7a79a9b73c5b)]
    1.13 +interface nsILocalFileWin : nsILocalFile
    1.14 +{
    1.15 +   /**
    1.16 +    * getVersionInfoValue
    1.17 +    *
    1.18 +    * Retrieve a metadata field from the file's VERSIONINFO block.
    1.19 +    * Throws NS_ERROR_FAILURE if no value is found, or the value is empty.
    1.20 +    *
    1.21 +    * @param   aField         The field to look up.
    1.22 +    *
    1.23 +    */
    1.24 +    AString getVersionInfoField(in string aField);
    1.25 +
    1.26 +    /**
    1.27 +     * The canonical path of the file, which avoids short/long
    1.28 +     * pathname inconsistencies. The nsIFile persistent
    1.29 +     * descriptor is not guaranteed to be canonicalized (it may
    1.30 +     * persist either the long or the short path name). The format of
    1.31 +     * the canonical path will vary with the underlying file system:
    1.32 +     * it will typically be the short pathname on filesystems that
    1.33 +     * support both short and long path forms.
    1.34 +     */
    1.35 +    readonly attribute AString canonicalPath;
    1.36 +    [noscript] readonly attribute ACString nativeCanonicalPath;
    1.37 +
    1.38 +    /**
    1.39 +     * Windows specific file attributes.
    1.40 +     */
    1.41 +
    1.42 +    /*
    1.43 +     * WFA_SEARCH_INDEXED: Generally the default on files in Windows except
    1.44 +     * those created in temp locations. Valid on XP and up. When set the
    1.45 +     * file or directory is marked to be indexed by desktop search services.
    1.46 +     */
    1.47 +    const unsigned long WFA_SEARCH_INDEXED = 1;
    1.48 +
    1.49 +    /*
    1.50 +     * WFA_READONLY: Whether the file is readonly or not.
    1.51 +     */
    1.52 +    const unsigned long WFA_READONLY = 2;
    1.53 +
    1.54 +    /*
    1.55 +     * WFA_READWRITE: Used to clear the readonly attribute.
    1.56 +     */
    1.57 +    const unsigned long WFA_READWRITE = 4;
    1.58 +
    1.59 +    /**
    1.60 +     * fileAttributesWin
    1.61 +     *
    1.62 +     * Set or get windows specific file attributes.
    1.63 +     * 
    1.64 +     * Throws NS_ERROR_FILE_INVALID_PATH for an invalid file.
    1.65 +     * Throws NS_ERROR_FAILURE if the set or get fails.
    1.66 +     */
    1.67 +    attribute unsigned long fileAttributesWin;
    1.68 +
    1.69 +    /**
    1.70 +     * setShortcut
    1.71 +     *
    1.72 +     * Creates the specified shortcut, or updates it if it already exists.
    1.73 +     *
    1.74 +     * If the shortcut is being updated (i.e. the shortcut already exists),
    1.75 +     * any excluded parameters will remain unchanged in the shortcut file.
    1.76 +     * For example, if you want to change the description of a specific
    1.77 +     * shortcut but keep the target, working dir, args, and icon the same,
    1.78 +     * pass null for those parameters and only pass in a value for the
    1.79 +     * description.
    1.80 +     *
    1.81 +     * If the shortcut does not already exist and targetFile is not specified,
    1.82 +     * setShortcut will throw NS_ERROR_FILE_TARGET_DOES_NOT_EXIST.
    1.83 +     *
    1.84 +     * @param targetFile      the path that the shortcut should target
    1.85 +     * @param workingDir      the working dir that should be set for the shortcut
    1.86 +     * @param args            the args string that should be set for the shortcut
    1.87 +     * @param description     the description that should be set for the shortcut
    1.88 +     * @param iconFile        the file containing an icon to be used for this
    1.89 +                              shortcut
    1.90 +     * @param iconIndex       this value selects a specific icon from within
    1.91 +                              iconFile.  If iconFile contains only one icon, this
    1.92 +                              value should be 0.
    1.93 +     */
    1.94 +     void setShortcut([optional] in nsIFile targetFile,
    1.95 +                      [optional] in nsIFile workingDir,
    1.96 +                      [optional] in wstring args,
    1.97 +                      [optional] in wstring description,
    1.98 +                      [optional] in nsIFile iconFile,
    1.99 +                      [optional] in long iconIndex);
   1.100 +};
   1.101 +

mercurial