leave nsIFileWidget, add nsIFilePicker as the one true file picker. add this to the build. r=travis
This commit is contained in:
Родитель
7624ca355d
Коммит
297a5d2789
|
@ -69,6 +69,7 @@ EXPORTS = \
|
|||
|
||||
XPIDLSRCS = \
|
||||
nsIAppShell.idl \
|
||||
nsIFilePicker.idl \
|
||||
nsIFileSpecWithUI.idl \
|
||||
nsIToolkit.idl \
|
||||
nsISound.idl \
|
||||
|
|
|
@ -28,6 +28,7 @@ XPIDL_MODULE=widget
|
|||
|
||||
XPIDLSRCS = \
|
||||
.\nsIAppShell.idl \
|
||||
.\nsIFilePicker.idl \
|
||||
.\nsIFileSpecWithUI.idl \
|
||||
.\nsISound.idl \
|
||||
.\nsIToolkit.idl \
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Parmenter <pavlov@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIFileSpec.idl"
|
||||
|
||||
interface nsIDOMWindow;
|
||||
|
||||
[scriptable, uuid(c47de916-1dd1-11b2-8141-82507fa02b21)]
|
||||
interface nsIFilePicker : nsISupports
|
||||
{
|
||||
const short modeLoad = 0; // Load a file or directory
|
||||
const short modeSave = 1; // Save a file or directory
|
||||
const short modeGetFolder = 2; // Select a fodler/directory
|
||||
|
||||
const short returnOK = 0; // User hit cancel, ignore selection
|
||||
const short returnCancel = 1; // User hit Ok, process selection
|
||||
const short returnReplace = 2; // User acknowledged file already exists so ok to replace, process selection
|
||||
|
||||
/**
|
||||
* Create the file widget.
|
||||
*
|
||||
* @param parent nsIDOMWindow parent. This dialog should be dependant on this parent.
|
||||
* @param title The title for the file widget
|
||||
* @param mode load, save, or get folder
|
||||
*
|
||||
*/
|
||||
void create(in nsIDOMWindow parent, in wstring title, in short mode);
|
||||
|
||||
/**
|
||||
* Set the list of file filters
|
||||
*
|
||||
* @param titles array of filter titles
|
||||
* @param filters array of filters to associate with titles
|
||||
* @param numberOfFilters number of filters.
|
||||
*
|
||||
*/
|
||||
void setFilterList(in long numberOfFilters,
|
||||
[array, size_is(numberOfFilters)] in wstring titles,
|
||||
[array, size_is(numberOfFilters)] in wstring filters);
|
||||
|
||||
/**
|
||||
* Get the index into the filter list for the type of file the user wants to save
|
||||
*
|
||||
* @param selectedFilter the index of the selected item in the filter list
|
||||
*
|
||||
*/
|
||||
readonly attribute long selectedFilter;
|
||||
|
||||
/* what is this? */
|
||||
attribute wstring defaultString;
|
||||
|
||||
/**
|
||||
* Set the directory that the file open/save dialog initially displays
|
||||
*
|
||||
* @param displayDirectory the name of the directory
|
||||
*
|
||||
*/
|
||||
attribute nsIFileSpec displayDirectory;
|
||||
|
||||
|
||||
/**
|
||||
* Get the nsFileSpec for the file or directory.
|
||||
*
|
||||
* @return Returns the file currently selected
|
||||
*/
|
||||
readonly attribute nsIFileSpec file;
|
||||
|
||||
/**
|
||||
* Show File Dialog. The dialog is displayed modally.
|
||||
*
|
||||
* @return PR_TRUE if user selects OK, PR_FALSE if user selects CANCEL
|
||||
*
|
||||
*/
|
||||
boolean show();
|
||||
};
|
Загрузка…
Ссылка в новой задаче