michael@0: /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 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: michael@0: #include "nsILocalFile.idl" michael@0: michael@0: [scriptable, builtinclass, uuid(c7b3fd13-30f2-46e5-a0d9-7a79a9b73c5b)] michael@0: interface nsILocalFileWin : nsILocalFile michael@0: { michael@0: /** michael@0: * getVersionInfoValue michael@0: * michael@0: * Retrieve a metadata field from the file's VERSIONINFO block. michael@0: * Throws NS_ERROR_FAILURE if no value is found, or the value is empty. michael@0: * michael@0: * @param aField The field to look up. michael@0: * michael@0: */ michael@0: AString getVersionInfoField(in string aField); michael@0: michael@0: /** michael@0: * The canonical path of the file, which avoids short/long michael@0: * pathname inconsistencies. The nsIFile persistent michael@0: * descriptor is not guaranteed to be canonicalized (it may michael@0: * persist either the long or the short path name). The format of michael@0: * the canonical path will vary with the underlying file system: michael@0: * it will typically be the short pathname on filesystems that michael@0: * support both short and long path forms. michael@0: */ michael@0: readonly attribute AString canonicalPath; michael@0: [noscript] readonly attribute ACString nativeCanonicalPath; michael@0: michael@0: /** michael@0: * Windows specific file attributes. michael@0: */ michael@0: michael@0: /* michael@0: * WFA_SEARCH_INDEXED: Generally the default on files in Windows except michael@0: * those created in temp locations. Valid on XP and up. When set the michael@0: * file or directory is marked to be indexed by desktop search services. michael@0: */ michael@0: const unsigned long WFA_SEARCH_INDEXED = 1; michael@0: michael@0: /* michael@0: * WFA_READONLY: Whether the file is readonly or not. michael@0: */ michael@0: const unsigned long WFA_READONLY = 2; michael@0: michael@0: /* michael@0: * WFA_READWRITE: Used to clear the readonly attribute. michael@0: */ michael@0: const unsigned long WFA_READWRITE = 4; michael@0: michael@0: /** michael@0: * fileAttributesWin michael@0: * michael@0: * Set or get windows specific file attributes. michael@0: * michael@0: * Throws NS_ERROR_FILE_INVALID_PATH for an invalid file. michael@0: * Throws NS_ERROR_FAILURE if the set or get fails. michael@0: */ michael@0: attribute unsigned long fileAttributesWin; michael@0: michael@0: /** michael@0: * setShortcut michael@0: * michael@0: * Creates the specified shortcut, or updates it if it already exists. michael@0: * michael@0: * If the shortcut is being updated (i.e. the shortcut already exists), michael@0: * any excluded parameters will remain unchanged in the shortcut file. michael@0: * For example, if you want to change the description of a specific michael@0: * shortcut but keep the target, working dir, args, and icon the same, michael@0: * pass null for those parameters and only pass in a value for the michael@0: * description. michael@0: * michael@0: * If the shortcut does not already exist and targetFile is not specified, michael@0: * setShortcut will throw NS_ERROR_FILE_TARGET_DOES_NOT_EXIST. michael@0: * michael@0: * @param targetFile the path that the shortcut should target michael@0: * @param workingDir the working dir that should be set for the shortcut michael@0: * @param args the args string that should be set for the shortcut michael@0: * @param description the description that should be set for the shortcut michael@0: * @param iconFile the file containing an icon to be used for this michael@0: shortcut michael@0: * @param iconIndex this value selects a specific icon from within michael@0: iconFile. If iconFile contains only one icon, this michael@0: value should be 0. michael@0: */ michael@0: void setShortcut([optional] in nsIFile targetFile, michael@0: [optional] in nsIFile workingDir, michael@0: [optional] in wstring args, michael@0: [optional] in wstring description, michael@0: [optional] in nsIFile iconFile, michael@0: [optional] in long iconIndex); michael@0: }; michael@0: