gecko-dev/widget/public/nsIFileSpecWithUI.idl
1999-05-29 07:22:58 +00:00

77 lines
2.2 KiB
Plaintext

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// This is the only correct cross-platform way to specify a file.
// Strings are not such a way. If you grew up on windows or unix, you
// may think they are. Welcome to reality.
#include "nsIFileSpec.idl"
%{C++
#include "nscore.h" // for NS_WIDGET
%}
native StandardFilterMask(nsIFileSpecWithUI::StandardFilterMask);
[scriptable, uuid(8ddf7681-139a-11d3-915f-dc1f8c138b7c)]
interface nsIFileSpecWithUI : nsIFileSpec
{
%{C++
//
// The "choose" functions present the file picker UI in order to set the
// value of the file spec.
%}
void chooseOutputFile(in string windowTitle, in string suggestedLeafName);
%{C++
// The mask for standard filters is given as follows:
enum StandardFilterMask
{
eAllReadable = (1<<0)
, eHTMLFiles = (1<<1)
, eXMLFiles = (1<<2)
, eImageFiles = (1<<3)
, eAllFiles = (1<<4)
// Mask containing all the above default filters
, eAllStandardFilters = (
eAllReadable
| eHTMLFiles
| eXMLFiles
| eImageFiles
| eAllFiles)
// The "extra filter" bit should be set if the "extra filter"
// is passed in to chooseInputFile.
, eExtraFilter = (1<<31)
};
enum { kNumStandardFilters = 5 };
%}
void chooseInputFile(
in string title
, in StandardFilterMask standardFilterMask
, in string extraFilterTitle
, in string extraFilter
);
void chooseDirectory(in string title);
};
%{C++
// Factory methods
extern NS_WIDGET nsresult NS_NewFileSpecWithUI(nsIFileSpecWithUI** result);
%}