Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtPrint / Print.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: Print.h /main/13 1996/10/31 02:09:08 cde-hp $ */
24 /*
25  * DtPrint/Print.h
26  */
27 /* (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
28  *     ALL RIGHTS RESERVED
29  * (c) Copyright 1989, 1996 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
30  * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996,
31  *     HEWLETT-PACKARD COMPANY
32  * (c) Copyright 1996 International Business Machines Corp.
33  * (c) Copyright 1996 Sun Microsystems, Inc.
34  * (c) Copyright 1996 Novell, Inc. 
35  * (c) Copyright 1996 FUJITSU LIMITED.
36  * (c) Copyright 1996 Hitachi.
37  */
38 #ifndef _DtPrint_h
39 #define _DtPrint_h
40
41 #include <Xm/Xm.h>
42 #include <X11/extensions/Print.h> 
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 /*
49  * Class record constants 
50  */
51 externalref WidgetClass dtPrintSetupBoxWidgetClass;
52
53 typedef struct _DtPrintSetupBoxClassRec * DtPrintSetupBoxWidgetClass;
54 typedef struct _DtPrintSetupBoxRec      * DtPrintSetupBoxWidget;
55
56
57 #ifndef DtIsPrintSetupBox
58 #define DtIsPrintSetupBox(w)  (XtIsSubclass (w, dtPrintSetupBoxWidgetClass))
59 #endif
60
61 /*
62  * Resource Names
63  */
64 #define DtNcancelCallback "cancelCallback"
65 #define DtNclosePrintDisplayCallback "closePrintDisplayCallback"
66 #define DtNcopies "copies"
67 #define DtNdescription "description"
68 #define DtNdestroyContextCallback "destroyContextCallback"
69 #define DtNfileName "fileName"
70 #ifndef DtNminimizeButtons
71 # define DtNminimizeButtons "minimizeButtons"
72 #endif
73 #define DtNoptionCount "optionCount"
74 #define DtNoptions "options"
75 #define DtNprintCallback "printCallback"
76 #define DtNprintDestination "printDestination"
77 #define DtNprinterInfoProc "printerInfoProc"
78 #define DtNprinterName "printerName"
79 #define DtNprintSetupMode "printSetupMode"
80 #define DtNselectFileProc "selectFileProc"
81 #define DtNselectPrinterProc "selectPrinterProc"
82 #define DtNsetupCallback "setupCallback"
83 #define DtNverifyPrinterProc "verifyPrinterProc"
84 #define DtNworkAreaLocation "workAreaLocation"
85
86 #define DtCCancelCallback "CancelCallback"
87 #define DtCClosePrintDisplayCallback "ClosePrintDisplayCallback"
88 #define DtCCopies "Copies"
89 #define DtCDescription "Description"
90 #define DtCDestroyContextCallback "DestroyContextCallback"
91 #define DtCFileName "FileName"
92 #ifndef DtCMinimizeButtons
93 # define DtCMinimizeButtons "MinimizeButtons"
94 #endif
95 #define DtCOptionCount "OptionCount"
96 #define DtCOptions "Options"
97 #define DtCPrintCallback "PrintCallback"
98 #define DtCPrintDestination "PrintDestination"
99 #define DtCPrinterInfoProc "PrinterInfoProc"
100 #define DtCPrinterName "PrinterName"
101 #define DtCPrintSetupMode "PrintSetupMode"
102 #define DtCSelectFileProc "SelectFileProc"
103 #define DtCSelectPrinterProc "SelectPrinterProc"
104 #define DtCSetupCallback "SetupCallback"
105 #define DtCVerifyPrinterProc "VerifyPrinterProc"
106 #define DtCWorkAreaLocation "WorkAreaLocation"
107
108 #define DtRPrintSetupProc "PrintSetupProc"
109
110 /*
111  * DtNsetupMode Resource Values
112  */
113 enum {
114     DtPRINT_SETUP_PLAIN,
115     DtPRINT_SETUP_XP
116 };
117
118 /*
119  * DtNworkAreaLocation Resource Values
120  */
121 enum {
122     DtWORK_AREA_NONE,
123     DtWORK_AREA_TOP,
124     DtWORK_AREA_TOP_AND_BOTTOM,
125     DtWORK_AREA_BOTTOM
126 };
127
128 /*
129  * DtNprintDestination Resource Values
130  */
131 enum { DtPRINT_NO_DESTINATION, DtPRINT_TO_PRINTER, DtPRINT_TO_FILE };
132
133 /*
134  * DtNprinterNameMode Resource Values
135  */
136 enum { DtSHORT_NAME, DtMEDIUM_NAME, DtLONG_NAME };
137
138 /*
139  * Mode values for DtPrintSetupBoxResetConnection()
140  */
141 typedef enum {
142     DtPRINT_CLOSE_CONNECTION,
143     DtPRINT_RELEASE_CONNECTION
144 } DtPrintResetConnectionMode;
145
146 /*
147  * Callback Reasons
148  */
149 enum {
150     DtPRINT_CR_NONE,
151     DtPRINT_CR_CANCEL,
152     DtPRINT_CR_CLOSE_PRINT_DISPLAY,
153     DtPRINT_CR_PRINT,
154     DtPRINT_CR_SETUP
155 };
156
157 /*
158  * DtPrint proecdure return values
159  */
160 enum {
161     DtPRINT_SUCCESS,
162     DtPRINT_BAD_PARM,
163     DtPRINT_FAILURE,
164     DtPRINT_INVALID_DISPLAY,
165     DtPRINT_NOT_XP_DISPLAY,
166     DtPRINT_NO_CONNECTION,
167     DtPRINT_NO_DEFAULT,
168     DtPRINT_NO_DEFAULT_DISPLAY,
169     DtPRINT_NO_PRINTER,
170     DtPRINT_PRINTER_MISSING
171 };
172
173 enum {
174     DtPRINT_HINT_MESSAGES_OK,
175     DtPRINT_HINT_NO_MESSAGES
176 };
177
178 /*
179  * PrintSetupBox Callback Structure Definition
180  */
181 typedef struct _DtPrintSetupData
182 {
183     String printer_name;
184     Display *print_display;
185     XPContext print_context;
186     XtEnum destination;
187     String dest_info;
188     XtEnum messages_hint;
189 } DtPrintSetupData;
190
191 typedef struct _DtPrintSetupCallbackStruct
192 {
193     int reason;
194     XEvent *event;
195     DtPrintSetupData *print_data;
196 } DtPrintSetupCallbackStruct;
197
198 /*
199  * PrintSetupBox Procedure Resource Type Definition
200  */
201 typedef XtEnum (*DtPrintSetupProc)(Widget, DtPrintSetupData*);
202
203 /*
204  * Public Function Declarations
205  */
206 extern Widget DtCreatePrintSetupBox(
207                                     Widget p,
208                                     String name,
209                                     ArgList args,
210                                     Cardinal n) ;
211 extern Widget DtCreatePrintSetupDialog(
212                                        Widget ds_p,
213                                        String name,
214                                        ArgList sb_args,
215                                        Cardinal sb_n) ;
216 extern DtPrintSetupData* DtPrintCopySetupData(
217                                               DtPrintSetupData* target,
218                                               const DtPrintSetupData* source);
219 extern XtEnum DtPrintFillSetupData(
220                                    Widget psub,
221                                    DtPrintSetupData* print_data);
222 extern void DtPrintFreeSetupData(
223                                  DtPrintSetupData* target);
224 extern XtEnum DtPrintResetConnection(
225                                      Widget psub,
226                                      DtPrintResetConnectionMode m);
227
228 #ifdef __cplusplus
229 }  /* Close scope of 'extern "C"' declaration which encloses file. */
230 #endif
231
232 #endif /* _DtPrint_h */
233 /* DON'T ADD ANYTHING AFTER THIS #endif */