1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #ifndef nsDeviceContextSpecGTK_h___
40 #define nsDeviceContextSpecGTK_h___
42 #include "nsIDeviceContextSpec.h"
43 #include "nsIPrintSettings.h"
44 #include "nsIPrintOptions.h"
47 #include "nsCRT.h" /* should be <limits.h>? */
52 #define NS_LANDSCAPE 1
60 class nsDeviceContextSpecGTK
: public nsIDeviceContextSpec
63 nsDeviceContextSpecGTK();
67 NS_IMETHOD
GetSurfaceForPrinter(gfxASurface
**surface
);
69 NS_IMETHOD
Init(nsIWidget
*aWidget
, nsIPrintSettings
* aPS
, PRBool aIsPrintPreview
);
70 NS_IMETHOD
ClosePrintManager();
71 NS_IMETHOD
BeginDocument(PRUnichar
* aTitle
, PRUnichar
* aPrintToFileName
, PRInt32 aStartPage
, PRInt32 aEndPage
);
72 NS_IMETHOD
EndDocument();
73 NS_IMETHOD
BeginPage() { return NS_ERROR_NOT_IMPLEMENTED
; }
74 NS_IMETHOD
EndPage() { return NS_ERROR_NOT_IMPLEMENTED
; }
76 NS_IMETHOD
GetToPrinter(PRBool
&aToPrinter
);
77 NS_IMETHOD
GetIsPrintPreview(PRBool
&aIsPPreview
);
78 NS_IMETHOD
GetPrinterName ( const char **aPrinter
);
79 NS_IMETHOD
GetCopies ( int &aCopies
);
80 NS_IMETHOD
GetFirstPageFirst(PRBool
&aFpf
);
81 NS_IMETHOD
GetGrayscale(PRBool
&aGrayscale
);
82 NS_IMETHOD
GetTopMargin(float &value
);
83 NS_IMETHOD
GetBottomMargin(float &value
);
84 NS_IMETHOD
GetLeftMargin(float &value
);
85 NS_IMETHOD
GetRightMargin(float &value
);
86 NS_IMETHOD
GetCommand(const char **aCommand
);
87 NS_IMETHOD
GetPath (const char **aPath
);
88 NS_IMETHOD
GetLandscape (PRBool
&aLandscape
);
89 NS_IMETHOD
GetUserCancelled(PRBool
&aCancel
);
90 NS_IMETHOD
GetPrintMethod(PrintMethod
&aMethod
);
91 static nsresult
GetPrintMethod(const char *aPrinter
, PrintMethod
&aMethod
);
92 NS_IMETHOD
GetPaperName(const char **aPaperName
);
93 NS_IMETHOD
GetPlexName(const char **aPlexName
);
94 NS_IMETHOD
GetResolutionName(const char **aResolutionName
);
95 NS_IMETHOD
GetColorspace(const char **aColorspace
);
96 NS_IMETHOD
GetDownloadFonts(PRBool
&aDownloadFonts
);
97 virtual ~nsDeviceContextSpecGTK();
100 nsCOMPtr
<nsIPrintSettings
> mPrintSettings
;
101 PRPackedBool mToPrinter
: 1; /* If PR_TRUE, print to printer */
102 PRPackedBool mIsPPreview
: 1; /* If PR_TRUE, is print preview */
103 PRPackedBool mFpf
: 1; /* If PR_TRUE, first page first */
104 PRPackedBool mGrayscale
: 1; /* If PR_TRUE, print grayscale */
105 PRPackedBool mDownloadFonts
: 1; /* If PR_TRUE, download fonts to printer */
106 PRPackedBool mCancel
: 1; /* If PR_TRUE, user cancelled */
107 int mOrientation
; /* Orientation e.g. Portrait */
108 char mCommand
[PATH_MAX
]; /* Print command e.g., lpr */
109 char mPath
[PATH_MAX
]; /* If toPrinter = PR_FALSE, dest file */
110 char mPrinter
[256]; /* Printer name */
111 char mPaperName
[256]; /* Printer name */
112 char mPlexName
[256]; /* Plex mode name */
113 char mResolutionName
[256];/* Resolution name */
114 char mColorspace
[256]; /* Colorspace */
115 int mCopies
; /* number of copies */
116 float mLeft
; /* left margin */
117 float mRight
; /* right margin */
118 float mTop
; /* top margin */
119 float mBottom
; /* bottom margin */
120 nsIPrintJobGTK
* mPrintJob
;
123 //-------------------------------------------------------------------------
124 // Printer Enumerator
125 //-------------------------------------------------------------------------
126 class nsPrinterEnumeratorGTK
: public nsIPrinterEnumerator
129 nsPrinterEnumeratorGTK();
131 NS_DECL_NSIPRINTERENUMERATOR
134 #endif /* !nsDeviceContextSpecGTK_h___ */