gecko-dev/widget/public/nsIFileSpecWithUI.idl

99 строки
3.5 KiB
Plaintext
Исходник Обычный вид История

1999-05-27 21:59:00 +04: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.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/
1999-05-27 21:59:00 +04: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-05-27 21:59:00 +04:00
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
1999-05-27 21:59:00 +04:00
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
1999-05-27 21:59:00 +04:00
*/
// 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"
2000-01-13 02:12:12 +03:00
interface nsIDOMWindowInternal;
1999-05-27 21:59:00 +04:00
[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;
1999-05-27 21:59:00 +04:00
const unsigned long eAllStandardFilters = eAllReadable |
eHTMLFiles |
eXMLFiles |
eImageFiles |
eMailFiles |
eTextFiles |
eAllFiles;
const unsigned long eAllMailOutputFilters = eHTMLFiles |
eMailFiles |
eTextFiles;
1999-05-27 21:59:00 +04:00
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);
attribute nsIDOMWindowInternal parentWindow;
1999-05-27 21:59:00 +04:00
};
%{C++
// Define Contractid and CID
1999-06-22 07:51:11 +04:00
// {e3326a80-2816-11d3-a7e5-98cb48c74f3c}
#define NS_FILESPECWITHUI_CID \
{ 0xe3326a80, 0x2816, 0x11d3, { 0xa7, 0xe5, 0x98, 0xcb, 0x48, 0xc7, 0x4f, 0x3c } }
#define NS_FILESPECWITHUI_CONTRACTID "@mozilla.org/filespecwithui;1"
1999-06-22 07:51:11 +04:00
#define NS_FILESPECWITHUI_CLASSNAME "nsIFileSpecWithUI"
1999-05-27 21:59:00 +04:00
// Factory methods
1999-06-22 07:51:11 +04:00
inline nsIFileSpecWithUI* NS_CreateFileSpecWithUI()
{
nsIFileSpecWithUI* spec = nsnull;
nsresult rv = nsComponentManager::CreateInstance(
(const char*)NS_FILESPECWITHUI_CONTRACTID,
1999-06-22 07:51:11 +04:00
(nsISupports*)nsnull,
(const nsID&)NS_GET_IID(nsIFileSpecWithUI),
1999-06-22 07:51:11 +04:00
(void**)&spec);
NS_ASSERTION(NS_SUCCEEDED(rv), "ERROR: Could not make a file spec.");
return spec;
}
1999-05-27 21:59:00 +04:00
%}