Add new GetFile method that uses an nsFileSpec instead of an nsString

This commit is contained in:
sdagley%netscape.com 1999-04-02 02:06:16 +00:00
parent 02d7145327
commit 1a4f805e40
3 changed files with 19 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#define nsIFileWidget_h__
#include "nsString.h"
#include "nsFileSpec.h"
// {F8030015-C342-11d1-97F0-00609703C14E}
#define NS_IFILEWIDGET_IID \
@ -34,7 +35,10 @@ enum nsMode {
/// Load a file or directory
eMode_load,
/// Save a file or directory
eMode_save };
eMode_save,
/// Select a fodler/directory
eMode_getfolder
};
/**
* File selector widget.
@ -95,6 +99,14 @@ public:
NS_IMETHOD GetFile(nsString& aFile) = 0;
/**
* Get the nsFileSpec for the file or directory.
*
* @param aFile on exit it contains the file or directory selected
*/
NS_IMETHOD GetFile(nsFileSpec& aFile) = 0;
/**
* Set the default string that appears in file open/save dialog

View File

@ -227,6 +227,11 @@ NS_IMETHODIMP nsFileWidget::GetFile(nsString& aFile)
return NS_OK;
}
NS_IMETHODIMP nsFileWidget::GetFile(nsFileSpec& aFile)
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the file + path

View File

@ -67,6 +67,7 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
virtual PRBool Show();
NS_IMETHOD GetFile(nsString& aFile);
NS_IMETHOD GetFile(nsFileSpec& aFile);
NS_IMETHOD SetDefaultString(nsString& aString);
NS_IMETHOD SetFilterList(PRUint32 aNumberOfFilters,
const nsString aTitles[],