2006-02-17 00:31:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
#ifndef nsDeviceContextSpecOS2_h___
|
|
|
|
#define nsDeviceContextSpecOS2_h___
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
#define INCL_PM
|
|
|
|
#define INCL_DOS
|
|
|
|
#define INCL_DOSERRORS
|
|
|
|
#define INCL_SPLDOSPRINT
|
2006-02-17 00:32:02 +03:00
|
|
|
#define INCL_DEV
|
|
|
|
#define INCL_DEVDJP
|
|
|
|
#define INCL_GRE_DEVICE
|
2006-02-17 00:31:45 +03:00
|
|
|
|
2006-02-17 00:32:13 +03:00
|
|
|
#include "nsCOMPtr.h"
|
1999-06-29 03:39:35 +04:00
|
|
|
#include "nsIDeviceContextSpec.h"
|
2006-02-17 00:31:54 +03:00
|
|
|
#include "nsIPrintOptions.h"
|
2006-02-17 00:31:56 +03:00
|
|
|
#include "nsIPrintSettings.h"
|
2006-02-17 00:31:54 +03:00
|
|
|
#include "nsPrintdOS2.h"
|
|
|
|
#include <os2.h>
|
2006-02-17 00:32:02 +03:00
|
|
|
#include <pmddim.h>
|
2006-02-17 00:31:54 +03:00
|
|
|
|
2006-02-17 00:34:07 +03:00
|
|
|
#include "nsPrintOS2.h"
|
2006-02-17 00:31:54 +03:00
|
|
|
//---------------------------------------------------------------------
|
|
|
|
// nsDeviceContextSpecOS2
|
|
|
|
//---------------------------------------------------------------------
|
1999-06-29 03:39:35 +04:00
|
|
|
|
|
|
|
class nsDeviceContextSpecOS2 : public nsIDeviceContextSpec
|
|
|
|
{
|
2006-02-17 00:31:44 +03:00
|
|
|
public:
|
2006-02-17 00:31:54 +03:00
|
|
|
/**
|
2006-02-23 12:36:43 +03:00
|
|
|
* Construct a nsDeviceContextSpecOS2, which is an object which contains and manages a mac printrecord
|
2006-02-17 00:31:54 +03:00
|
|
|
* @update dc 12/02/98
|
|
|
|
*/
|
2006-02-17 00:31:44 +03:00
|
|
|
nsDeviceContextSpecOS2();
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2006-02-17 00:31:44 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
/**
|
2006-02-23 12:36:43 +03:00
|
|
|
* Initialize the nsDeviceContextSpecOS2 for use. This will allocate a printrecord for use
|
2006-02-17 00:31:54 +03:00
|
|
|
* @update dc 2/16/98
|
2006-12-09 20:18:56 +03:00
|
|
|
* @param aWidget Unused
|
|
|
|
* @param aPS Settings for this print job
|
2011-10-17 18:59:28 +04:00
|
|
|
* @param aIsPrintPreview if true, creating Spec for PrintPreview
|
2006-02-17 00:31:54 +03:00
|
|
|
* @return error status
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, bool aIsPrintPreview);
|
2006-02-17 00:31:54 +03:00
|
|
|
|
|
|
|
NS_IMETHOD ClosePrintManager();
|
|
|
|
|
2006-02-17 00:32:09 +03:00
|
|
|
NS_IMETHOD GetDestination ( int &aDestination );
|
2006-02-17 00:31:54 +03:00
|
|
|
|
2006-02-17 00:31:56 +03:00
|
|
|
NS_IMETHOD GetPrinterName ( char **aPrinter );
|
2006-02-17 00:31:54 +03:00
|
|
|
|
|
|
|
NS_IMETHOD GetCopies ( int &aCopies );
|
|
|
|
|
|
|
|
NS_IMETHOD GetPath ( char **aPath );
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD GetUserCancelled( bool &aCancel );
|
2006-02-17 00:31:54 +03:00
|
|
|
|
2006-02-17 00:31:44 +03:00
|
|
|
NS_IMETHOD GetPRTQUEUE(PRTQUEUE *&p);
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2007-01-29 01:20:21 +03:00
|
|
|
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **nativeSurface);
|
2013-07-24 15:48:37 +04:00
|
|
|
NS_IMETHOD BeginDocument(const nsAString& aTitle, PRUnichar* aPrintToFileName,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aStartPage, int32_t aEndPage);
|
2007-01-29 01:20:21 +03:00
|
|
|
NS_IMETHOD EndDocument();
|
2007-02-09 02:38:51 +03:00
|
|
|
NS_IMETHOD BeginPage();
|
|
|
|
NS_IMETHOD EndPage();
|
2007-01-29 01:20:21 +03:00
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
/**
|
2006-02-23 12:36:43 +03:00
|
|
|
* Destructor for nsDeviceContextSpecOS2, this will release the printrecord
|
2006-02-17 00:31:54 +03:00
|
|
|
* @update dc 2/16/98
|
|
|
|
*/
|
2006-02-17 00:31:44 +03:00
|
|
|
virtual ~nsDeviceContextSpecOS2();
|
1999-06-29 03:39:35 +04:00
|
|
|
|
2006-02-17 00:31:56 +03:00
|
|
|
static PRINTDLG PrnDlg;
|
2006-02-17 00:32:29 +03:00
|
|
|
static nsresult SetPrintSettingsFromDevMode(nsIPrintSettings* aPrintSettings, ULONG printer);
|
2006-02-17 00:31:56 +03:00
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
protected:
|
|
|
|
OS2PrData mPrData;
|
2006-02-17 00:31:44 +03:00
|
|
|
PRTQUEUE *mQueue;
|
2006-02-17 00:31:56 +03:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
2008-02-04 12:31:05 +03:00
|
|
|
HDC mPrintDC;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mPrintingStarted;
|
1999-06-29 03:39:35 +04:00
|
|
|
};
|
|
|
|
|
2006-02-17 00:31:54 +03:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Printer Enumerator
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
class nsPrinterEnumeratorOS2 : public nsIPrinterEnumerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsPrinterEnumeratorOS2();
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPRINTERENUMERATOR
|
|
|
|
|
|
|
|
protected:
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-06-29 03:39:35 +04:00
|
|
|
#endif
|
2006-02-17 00:31:54 +03:00
|
|
|
|