2001-09-26 04:16:04 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2000-06-22 02:21:34 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The contents of this file are subject to the Mozilla 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/MPL/
|
2000-06-22 02:21:34 +04:00
|
|
|
*
|
2001-09-26 04:16:04 +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.
|
2000-06-22 02:21:34 +04:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-26 04:16:04 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2000-06-22 02:21:34 +04:00
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Don Cone <dcone@netscape.com>
|
2001-11-22 13:00:44 +03:00
|
|
|
* Jessica Blanco <jblanco@us.ibm.com>
|
2001-09-26 04:16:04 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-26 04:16:04 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-26 04:16:04 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-26 04:16:04 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-06-22 02:21:34 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2001-11-03 17:45:46 +03:00
|
|
|
#include "nsIPrintSettings.idl"
|
2000-06-22 02:21:34 +04:00
|
|
|
|
2001-01-27 17:09:34 +03:00
|
|
|
%{ C++
|
|
|
|
#include "nsFont.h"
|
|
|
|
%}
|
2000-06-22 02:21:34 +04:00
|
|
|
|
2001-11-22 13:00:44 +03:00
|
|
|
interface nsISimpleEnumerator;
|
|
|
|
|
2001-02-02 11:42:53 +03:00
|
|
|
/**
|
|
|
|
* Native types
|
|
|
|
*/
|
|
|
|
[ref] native nsNativeFontRef(nsFont);
|
|
|
|
[ref] native nsNativeStringRef(nsString);
|
|
|
|
|
2000-06-22 02:21:34 +04:00
|
|
|
/**
|
2003-04-18 00:17:01 +04:00
|
|
|
* Print options interface
|
2001-03-24 03:22:18 +03:00
|
|
|
*
|
2003-04-18 00:17:01 +04:00
|
|
|
* Do not attempt to freeze this API - it still needs lots of work. Consult
|
|
|
|
* John Keiser <jkeiser@netscape.com> and Roland Mainz
|
|
|
|
* <roland.mainz@informatik.med.uni-giessen.de> for futher details.
|
2000-06-22 02:21:34 +04:00
|
|
|
*/
|
|
|
|
[scriptable, uuid(CAE87E20-479E-11d4-A856-00105A183419)]
|
|
|
|
|
|
|
|
interface nsIPrintOptions : nsISupports
|
|
|
|
{
|
2001-01-27 17:09:34 +03:00
|
|
|
/**
|
|
|
|
* Show Native Print Options dialog, this may not be supported on all platforms
|
|
|
|
*/
|
2002-02-07 08:32:59 +03:00
|
|
|
void ShowPrintSetupDialog(in nsIPrintSettings aThePrintSettings);
|
2000-06-22 02:21:34 +04:00
|
|
|
|
2002-01-01 15:58:53 +03:00
|
|
|
/**
|
|
|
|
* Creates a new PrintSettnigs Object
|
|
|
|
* and initializes it from prefs
|
|
|
|
*/
|
|
|
|
nsIPrintSettings CreatePrintSettings();
|
|
|
|
|
2002-03-16 16:08:45 +03:00
|
|
|
/**
|
|
|
|
* available Printers
|
2003-04-18 00:17:01 +04:00
|
|
|
* It returns an enumerator object or throws an exception on error cases
|
|
|
|
* like if internal setup failed and/or no printers are available.
|
2002-03-16 16:08:45 +03:00
|
|
|
*/
|
|
|
|
nsISimpleEnumerator availablePrinters ();
|
2001-01-27 17:09:34 +03:00
|
|
|
|
2002-05-21 14:53:45 +04:00
|
|
|
/**
|
|
|
|
* Get a prefixed integer pref
|
|
|
|
*/
|
|
|
|
PRInt32 getPrinterPrefInt(in nsIPrintSettings aPrintSettings, in wstring aPrefName);
|
|
|
|
|
2002-03-16 16:08:45 +03:00
|
|
|
/**
|
|
|
|
* display Printer Job Properties dialog
|
|
|
|
*/
|
|
|
|
void displayJobProperties (in wstring aPrinter, in nsIPrintSettings aPrintSettings, out boolean aDisplayed);
|
2001-11-26 15:48:41 +03:00
|
|
|
|
2002-03-16 16:08:45 +03:00
|
|
|
// no script methods
|
2001-02-02 11:42:53 +03:00
|
|
|
[noscript] void SetFontNamePointSize(in nsNativeStringRef aName, in PRInt32 aPointSize);
|
|
|
|
|
2002-03-16 16:08:45 +03:00
|
|
|
[noscript] void SetDefaultFont(in nsNativeFontRef aFont);
|
2001-02-02 11:42:53 +03:00
|
|
|
/* Purposely made this an "in" arg */
|
2002-03-16 16:08:45 +03:00
|
|
|
[noscript] void GetDefaultFont(in nsNativeFontRef aFont);
|
2001-01-27 17:09:34 +03:00
|
|
|
|
2001-10-13 03:48:34 +04:00
|
|
|
/**
|
|
|
|
* Native data constants
|
|
|
|
*/
|
|
|
|
const short kNativeDataPrintRecord = 0;
|
|
|
|
|
|
|
|
[noscript] voidPtr GetNativeData(in short aDataType);
|
2001-11-22 13:00:44 +03:00
|
|
|
};
|
2001-10-13 03:48:34 +04:00
|
|
|
|
2001-11-22 13:00:44 +03:00
|
|
|
[scriptable, uuid(a6cf9128-15b3-11d2-932e-00805f8add32)]
|
|
|
|
interface nsIPrinterEnumerator : nsISupports
|
|
|
|
{
|
2002-02-13 16:58:41 +03:00
|
|
|
/**
|
|
|
|
* The name of the default printer
|
|
|
|
* This name must be in the list of printer names returned by
|
|
|
|
* "availablePrinters"
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
readonly attribute wstring defaultPrinterName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes certain settings from the native printer into the PrintSettings
|
|
|
|
* These settings include, but are not limited to:
|
|
|
|
* Page Orientation
|
|
|
|
* Page Size
|
|
|
|
* Number of Copies
|
|
|
|
*/
|
|
|
|
void initPrintSettingsFromPrinter(in wstring aPrinterName, in nsIPrintSettings aPrintSettings);
|
|
|
|
|
2001-11-22 13:00:44 +03:00
|
|
|
/**
|
2002-01-01 15:58:53 +03:00
|
|
|
* Returns an array of the names of all installed printers.
|
2001-11-22 13:00:44 +03:00
|
|
|
*
|
|
|
|
* @param aCount returns number of printers returned
|
|
|
|
* @param aResult returns array of names
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
void enumeratePrinters(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
|
|
|
|
|
|
|
|
/* takes printer selected and will display job properties dlg for that printer
|
|
|
|
* returns true if dialog displays
|
|
|
|
*/
|
2002-01-01 15:58:53 +03:00
|
|
|
void displayPropertiesDlg(in wstring aPrinter, in nsIPrintSettings aPrintSettings);
|
|
|
|
|
2000-06-22 02:21:34 +04:00
|
|
|
};
|
2001-11-22 13:00:44 +03:00
|
|
|
|