2006-02-16 21:31:53 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2006-02-16 21:32:25 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-06-28 23:39:35 +00:00
|
|
|
*
|
2006-02-16 21:32:25 +00: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/
|
1999-06-28 23:39:35 +00:00
|
|
|
*
|
2006-02-16 21:31:53 +00: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-06-28 23:39:35 +00:00
|
|
|
*
|
2006-02-16 21:31:44 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2006-02-16 21:32:25 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2006-02-16 21:31:53 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-06-28 23:39:35 +00:00
|
|
|
*
|
2006-02-16 21:31:53 +00:00
|
|
|
* Contributor(s):
|
2006-02-16 21:31:44 +00:00
|
|
|
* John Fairhurst <john_fairhurst@iname.com>
|
2006-02-16 21:31:53 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2006-02-16 21:32:25 +00: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"),
|
2006-02-16 21:31:53 +00: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
|
2006-02-16 21:32:25 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2006-02-16 21:31:53 +00: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
|
2006-02-16 21:32:25 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2006-02-16 21:31:53 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
#ifndef nsDeviceContextSpecOS2_h___
|
|
|
|
#define nsDeviceContextSpecOS2_h___
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
#define INCL_PM
|
|
|
|
#define INCL_DOS
|
|
|
|
#define INCL_DOSERRORS
|
|
|
|
#define INCL_SPLDOSPRINT
|
2006-02-16 21:32:02 +00:00
|
|
|
#define INCL_DEV
|
|
|
|
#define INCL_DEVDJP
|
|
|
|
#define INCL_GRE_DEVICE
|
2006-02-16 21:31:45 +00:00
|
|
|
|
2006-02-16 21:32:13 +00:00
|
|
|
#include "nsCOMPtr.h"
|
1999-06-28 23:39:35 +00:00
|
|
|
#include "nsIDeviceContextSpec.h"
|
2006-02-16 21:31:54 +00:00
|
|
|
#include "nsIPrintOptions.h"
|
2006-02-16 21:31:56 +00:00
|
|
|
#include "nsIPrintSettings.h"
|
2006-02-16 21:31:54 +00:00
|
|
|
#include "nsVoidArray.h"
|
|
|
|
#ifdef USE_XPRINT
|
|
|
|
#include "nsIDeviceContextSpecXPrint.h"
|
|
|
|
#endif /* USE_XPRINT */
|
|
|
|
#include "nsPrintdOS2.h"
|
|
|
|
#include <os2.h>
|
2006-02-16 21:32:02 +00:00
|
|
|
#include <pmddim.h>
|
2006-02-16 21:31:54 +00:00
|
|
|
|
2006-02-16 21:34:07 +00:00
|
|
|
#include "nsPrintOS2.h"
|
2006-02-16 21:31:54 +00:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
// nsDeviceContextSpecOS2
|
|
|
|
//---------------------------------------------------------------------
|
1999-06-28 23:39:35 +00:00
|
|
|
|
|
|
|
class nsDeviceContextSpecOS2 : public nsIDeviceContextSpec
|
2006-02-16 21:31:54 +00:00
|
|
|
#ifdef USE_XPRINT
|
|
|
|
, public nsIDeviceContextSpecXp
|
|
|
|
#endif
|
1999-06-28 23:39:35 +00:00
|
|
|
{
|
2006-02-16 21:31:44 +00:00
|
|
|
public:
|
2006-02-16 21:31:54 +00:00
|
|
|
/**
|
2006-02-23 09:36:43 +00:00
|
|
|
* Construct a nsDeviceContextSpecOS2, which is an object which contains and manages a mac printrecord
|
2006-02-16 21:31:54 +00:00
|
|
|
* @update dc 12/02/98
|
|
|
|
*/
|
2006-02-16 21:31:44 +00:00
|
|
|
nsDeviceContextSpecOS2();
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2006-02-16 21:31:44 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
/**
|
2006-02-23 09:36:43 +00:00
|
|
|
* Initialize the nsDeviceContextSpecOS2 for use. This will allocate a printrecord for use
|
2006-02-16 21:31:54 +00:00
|
|
|
* @update dc 2/16/98
|
2006-12-09 17:18:56 +00:00
|
|
|
* @param aWidget Unused
|
|
|
|
* @param aPS Settings for this print job
|
|
|
|
* @param aIsPrintPreview if PR_TRUE, creating Spec for PrintPreview
|
2006-02-16 21:31:54 +00:00
|
|
|
* @return error status
|
|
|
|
*/
|
2006-12-09 17:18:56 +00:00
|
|
|
NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, PRBool aIsPrintPreview);
|
2006-02-16 21:31:54 +00:00
|
|
|
|
|
|
|
NS_IMETHOD ClosePrintManager();
|
|
|
|
|
2006-02-16 21:32:09 +00:00
|
|
|
NS_IMETHOD GetDestination ( int &aDestination );
|
2006-02-16 21:31:54 +00:00
|
|
|
|
2006-02-16 21:31:56 +00:00
|
|
|
NS_IMETHOD GetPrinterName ( char **aPrinter );
|
2006-02-16 21:31:54 +00:00
|
|
|
|
|
|
|
NS_IMETHOD GetCopies ( int &aCopies );
|
|
|
|
|
|
|
|
NS_IMETHOD GetPath ( char **aPath );
|
|
|
|
|
|
|
|
NS_IMETHOD GetUserCancelled( PRBool &aCancel );
|
|
|
|
|
2006-02-16 21:31:44 +00:00
|
|
|
NS_IMETHOD GetPRTQUEUE(PRTQUEUE *&p);
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2007-01-28 22:20:21 +00:00
|
|
|
#ifdef MOZ_CAIRO_GFX
|
|
|
|
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface);
|
|
|
|
NS_IMETHOD BeginDocument(PRUnichar* aTitle, PRUnichar* aPrintToFileName,
|
|
|
|
PRInt32 aStartPage, PRInt32 aEndPage);
|
|
|
|
NS_IMETHOD EndDocument();
|
|
|
|
#endif
|
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
/**
|
2006-02-23 09:36:43 +00:00
|
|
|
* Destructor for nsDeviceContextSpecOS2, this will release the printrecord
|
2006-02-16 21:31:54 +00:00
|
|
|
* @update dc 2/16/98
|
|
|
|
*/
|
2006-02-16 21:31:44 +00:00
|
|
|
virtual ~nsDeviceContextSpecOS2();
|
1999-06-28 23:39:35 +00:00
|
|
|
|
2006-02-16 21:31:56 +00:00
|
|
|
static PRINTDLG PrnDlg;
|
2006-02-16 21:32:29 +00:00
|
|
|
static nsresult SetPrintSettingsFromDevMode(nsIPrintSettings* aPrintSettings, ULONG printer);
|
2006-02-16 21:31:56 +00:00
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
OS2PrData mPrData;
|
2006-02-16 21:31:44 +00:00
|
|
|
PRTQUEUE *mQueue;
|
2006-02-16 21:31:56 +00:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
1999-06-28 23:39:35 +00:00
|
|
|
};
|
|
|
|
|
2006-02-16 21:31:54 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Printer Enumerator
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
class nsPrinterEnumeratorOS2 : public nsIPrinterEnumerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsPrinterEnumeratorOS2();
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPRINTERENUMERATOR
|
|
|
|
|
|
|
|
protected:
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-06-28 23:39:35 +00:00
|
|
|
#endif
|
2006-02-16 21:31:54 +00:00
|
|
|
|