gecko-dev/widget/public/nsIFileSpecWithUI.idl

95 lines
3.4 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.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):
*/
// 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"
#include "nsIComponentManager.idl"
[scriptable, uuid(8ddf7681-139a-11d3-915f-dc1f8c138b7c)]
interface nsIFileSpecWithUI : nsIFileSpec
{
// Filter mask flags. These may be or'd together.
const unsigned long eAllReadable = 1<<0;
const unsigned long eHTMLFiles = 1<<1;
const unsigned long eXMLFiles = 1<<2;
const unsigned long eImageFiles = 1<<3;
const unsigned long eMailFiles = 1<<4;
const unsigned long eTextFiles = 1<<5;
const unsigned long eAllFiles = 1<<6;
const unsigned long eAllStandardFilters = eAllReadable |
eHTMLFiles |
eXMLFiles |
eImageFiles |
eMailFiles |
eTextFiles |
eAllFiles;
const unsigned long eAllMailOutputFilters = eHTMLFiles |
eMailFiles |
eTextFiles;
const unsigned long eExtraFilter = 1<<31;
const unsigned long kNumStandardFilters = 7;
const unsigned long kNumMailFilters = 3;
void chooseInputFile( in string title,
in unsigned long filterMask,
in string extraFilterTitle,
in string extraFilter );
void chooseOutputFile( in string windowTitle,
in string suggestedLeafName,
in unsigned long filterMask );
string chooseFile(in string title);
string chooseDirectory(in string title);
};
%{C++
// 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"
// Factory methods
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;
}
%}