gecko-dev/widget/public/nsIFileSpecWithUI.idl

109 lines
3.3 KiB
Plaintext
Raw Normal View History

1999-05-27 17:59:00 +00:00
/* -*- 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
1999-06-22 03:51:11 +00:00
#include "nsIComponentManager.h"
1999-05-27 17:59:00 +00:00
%}
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.
%}
%{C++
// The mask for standard filters is given as follows:
enum StandardFilterMask
{
eAllReadable = (1<<0)
, eHTMLFiles = (1<<1)
, eXMLFiles = (1<<2)
, eImageFiles = (1<<3)
, eMailFiles = (1<<4)
, eTextFiles = (1<<5)
, eAllFiles = (1<<6)
1999-05-27 17:59:00 +00:00
// Mask containing all the above default filters
, eAllStandardFilters = (
eAllReadable
| eHTMLFiles
| eXMLFiles
| eImageFiles
| eMailFiles
| eTextFiles
1999-05-27 17:59:00 +00:00
| eAllFiles)
, eAllMailOutputFilters = (
eHTMLFiles
| eMailFiles
| eTextFiles)
1999-05-27 17:59:00 +00:00
// The "extra filter" bit should be set if the "extra filter"
// is passed in to chooseInputFile.
, eExtraFilter = (1<<31)
};
enum { kNumStandardFilters = 7, kNumMailFilters = 3 };
1999-05-27 17:59:00 +00:00
%}
[noscript] void chooseInputFile(
1999-05-27 17:59:00 +00:00
in string title
, in StandardFilterMask standardFilterMask
, in string extraFilterTitle
, in string extraFilter
);
[noscript] void chooseOutputFile(in string windowTitle,
in string suggestedLeafName,
in StandardFilterMask standardFilterMask);
string chooseFile(in string title);
string chooseDirectory(in string title);
1999-05-27 17:59:00 +00:00
};
%{C++
1999-06-22 03:51:11 +00:00
// Define Progid and CID
// {e3326a80-2816-11d3-a7e5-98cb48c74f3c}
#define NS_FILESPECWITHUI_CID \
{ 0xe3326a80, 0x2816, 0x11d3, { 0xa7, 0xe5, 0x98, 0xcb, 0x48, 0xc7, 0x4f, 0x3c } }
#define NS_FILESPECWITHUI_PROGID "component://netscape/filespecwithui"
#define NS_FILESPECWITHUI_CLASSNAME "nsIFileSpecWithUI"
1999-05-27 17:59:00 +00:00
// Factory methods
1999-06-22 03:51:11 +00:00
inline nsIFileSpecWithUI* NS_CreateFileSpecWithUI()
{
nsIFileSpecWithUI* spec = nsnull;
nsresult rv = nsComponentManager::CreateInstance(
(const char*)NS_FILESPECWITHUI_PROGID,
(nsISupports*)nsnull,
(const nsID&)nsIFileSpecWithUI::GetIID(),
(void**)&spec);
NS_ASSERTION(NS_SUCCEEDED(rv), "ERROR: Could not make a file spec.");
return spec;
}
1999-05-27 17:59:00 +00:00
%}