1999-11-15 08:13:40 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-15 10:19:00 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public
|
1999-11-15 08:13:40 +00:00
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
1999-11-15 10:19:00 +00:00
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
1999-11-15 08:13:40 +00:00
|
|
|
* 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.
|
1999-11-15 10:19:00 +00:00
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla browser.
|
|
|
|
*
|
1999-11-15 08:13:40 +00:00
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-11-15 10:19:00 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1999 Netscape Communications Corporation. All
|
1999-11-15 08:13:40 +00:00
|
|
|
* Rights Reserved.
|
1999-11-15 10:19:00 +00:00
|
|
|
*
|
1999-11-15 08:13:40 +00:00
|
|
|
* Contributor(s):
|
1999-11-15 10:19:00 +00:00
|
|
|
* Stuart Parmenter <pavlov@netscape.com>
|
1999-11-15 08:13:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2000-04-04 23:50:41 +00:00
|
|
|
#include "nsIURL.idl"
|
2000-03-22 09:17:01 +00:00
|
|
|
#include "nsILocalFile.idl"
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
interface nsIDOMWindow;
|
|
|
|
|
|
|
|
[scriptable, uuid(c47de916-1dd1-11b2-8141-82507fa02b21)]
|
1999-11-15 09:32:51 +00:00
|
|
|
interface nsIFilePicker : nsISupports
|
1999-11-15 08:13:40 +00:00
|
|
|
{
|
2000-03-29 01:42:45 +00:00
|
|
|
const short modeOpen = 0; // Load a file or directory
|
1999-11-15 10:19:00 +00:00
|
|
|
const short modeSave = 1; // Save a file or directory
|
|
|
|
const short modeGetFolder = 2; // Select a fodler/directory
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2000-03-23 07:41:09 +00:00
|
|
|
const long filterAll = 0x01; // *.*
|
|
|
|
const long filterHTML = 0x02; // *.html; *.htm
|
|
|
|
const long filterText = 0x04; // *.txt
|
|
|
|
const long filterImages = 0x08; // *.png; *.gif; *.jpg; *.jpeg
|
|
|
|
const long filterXML = 0x10; // *.xml
|
|
|
|
const long filterXUL = 0x20; // *.xul
|
|
|
|
|
1999-11-15 08:13:40 +00:00
|
|
|
/**
|
2000-03-23 07:52:28 +00:00
|
|
|
* Initialize the file widget.
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
|
|
|
* @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
|
|
|
|
*
|
|
|
|
*/
|
2000-03-23 07:52:28 +00:00
|
|
|
void init(in nsIDOMWindow parent, in wstring title, in short mode);
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
/**
|
2000-05-25 00:44:10 +00:00
|
|
|
* Append to the filter list with things from the predefined list
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
2000-03-23 07:41:09 +00:00
|
|
|
* @param filters mask of filters i.e. (filterAll | filterHTML)
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
|
|
|
*/
|
2000-05-25 00:44:10 +00:00
|
|
|
void appendFilters(in long filterMask);
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
/**
|
2000-03-23 07:41:09 +00:00
|
|
|
* Add a filter
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
2000-03-23 07:41:09 +00:00
|
|
|
* @param title name of the filter
|
|
|
|
* @param filter extentions to filter -- semicolon and space seperated
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
|
|
|
*/
|
2000-03-23 07:41:09 +00:00
|
|
|
void appendFilter(in wstring title,
|
|
|
|
in wstring filter);
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
/* what is this? */
|
2000-05-22 22:19:00 +00:00
|
|
|
attribute wstring defaultString;
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the directory that the file open/save dialog initially displays
|
|
|
|
*
|
|
|
|
* @param displayDirectory the name of the directory
|
|
|
|
*
|
|
|
|
*/
|
2000-03-22 09:17:01 +00:00
|
|
|
attribute nsILocalFile displayDirectory;
|
1999-11-15 08:13:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2000-04-04 23:50:41 +00:00
|
|
|
* Get the nsILocalFile for the file or directory.
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
|
|
|
* @return Returns the file currently selected
|
|
|
|
*/
|
2000-03-22 09:17:01 +00:00
|
|
|
readonly attribute nsILocalFile file;
|
1999-11-15 08:13:40 +00:00
|
|
|
|
2000-04-04 23:50:41 +00:00
|
|
|
/**
|
|
|
|
* Get the nsIFileURL for the file or directory.
|
|
|
|
*
|
|
|
|
* @return Returns the file currently selected
|
|
|
|
*/
|
|
|
|
readonly attribute nsIFileURL fileURL;
|
|
|
|
|
1999-11-15 08:13:40 +00:00
|
|
|
/**
|
|
|
|
* Show File Dialog. The dialog is displayed modally.
|
|
|
|
*
|
1999-11-15 10:19:00 +00:00
|
|
|
* @return returnOK if the user selects OK, returnCancel if the user selects cancel
|
1999-11-15 08:13:40 +00:00
|
|
|
*
|
|
|
|
*/
|
1999-11-15 10:19:00 +00:00
|
|
|
short show();
|
1999-11-15 08:13:40 +00:00
|
|
|
};
|