2 (c) Copyright 1996 Hewlett-Packard Company
3 (c) Copyright 1996 International Business Machines Corp.
4 (c) Copyright 1996 Sun Microsystems, Inc.
5 (c) Copyright 1996 Novell, Inc.
6 (c) Copyright 1996 Digital Equipment Corp.
7 (c) Copyright 1996 Fujitsu Limited
8 (c) Copyright 1996 Hitachi, Ltd.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Except as contained in this notice, the names of the copyright holders shall
28 not be used in advertising or otherwise to promote the sale, use or other
29 dealings in this Software without prior written authorization from said
33 #ifdef HAVE_DIX_CONFIG_H
34 #include <dix-config.h>
37 #ifndef _Xp_AttrValid_h
38 #define _Xp_AttrValid_h
40 #include <X11/extensions/Printstr.h>
43 #define XpNumber(a) (sizeof(a) / sizeof(*(a)))
46 * Attribute pool validation valid values and defaults
50 XpOidList
* valid_content_orientations_supported
;
51 XpOidList
* default_content_orientations_supported
;
53 XpOidDocFmtList
* valid_document_formats_supported
;
54 XpOidDocFmtList
* default_document_formats_supported
;
56 XpOidList
* valid_input_trays
;
57 XpOidList
* valid_medium_sizes
;
59 XpOidList
* valid_plexes_supported
;
60 XpOidList
* default_plexes_supported
;
62 XpOidCardList
* valid_printer_resolutions_supported
;
63 XpOidCardList
* default_printer_resolutions_supported
;
65 XpOidDocFmtList
* valid_xp_embedded_formats_supported
;
66 XpOidDocFmtList
* default_xp_embedded_formats_supported
;
68 XpOidList
* valid_xp_listfonts_modes_supported
;
69 XpOidList
* default_xp_listfonts_modes_supported
;
71 XpOidDocFmtList
* valid_xp_raw_formats_supported
;
72 XpOidDocFmtList
* default_xp_raw_formats_supported
;
74 XpOidList
* valid_xp_setup_proviso
;
76 XpOidDocFmt
* default_document_format
;
77 XpOidList
* valid_available_compressions_supported
;
78 XpOidList
* default_available_compressions_supported
;
83 * XpOid resource access
85 #define XpGetStringAttr(pContext, pool, oid) \
86 (const char*)XpGetOneAttribute(pContext, pool, (char*)XpOidString(oid))
87 #define XpPutStringAttr(pContext, pool, oid, value) \
88 XpPutOneAttribute(pContext, pool, XpOidString(oid), value)
90 #ifdef _XP_PRINT_SERVER_ /* needed for XpContextPtr in Printstr.h */
93 * XpOid-valued attribute access
95 XpOid
XpGetOidAttr(XpContextPtr pContext
,
98 const XpOidList
* valid_oid_list
);
99 void XpPutOidAttr(XpContextPtr pContext
,
103 void XpValidateOidAttr(XpContextPtr pContext
,
106 const XpOidList
* valid_oids
,
109 * cardinal-valued attribute access
111 unsigned long XpGetCardAttr(XpContextPtr pContext
,
114 const XpOidCardList
* valid_card_list
);
115 void XpPutCardAttr(XpContextPtr pContext
,
118 unsigned long value_card
);
119 void XpValidateCardAttr(XpContextPtr pContext
,
122 const XpOidCardList
* valid_cards
,
123 unsigned long default_card
);
125 * XpOidList-valued attribute access
127 XpOidList
* XpGetListAttr(XpContextPtr pContext
,
130 const XpOidList
* valid_oid_list
);
131 void XpPutListAttr(XpContextPtr pContext
,
134 const XpOidList
* list
);
135 void XpValidateListAttr(XpContextPtr pContext
,
138 const XpOidList
* valid_oids
,
139 const XpOidList
* default_oids
);
141 * XpOidCardList-valued attribute access
143 XpOidCardList
* XpGetCardListAttr(XpContextPtr pContext
,
146 const XpOidCardList
* valid_card_list
);
147 void XpPutCardListAttr(XpContextPtr pContext
,
150 const XpOidCardList
* list
);
151 void XpValidateCardListAttr(XpContextPtr pContext
,
154 const XpOidCardList
* valid_cards
,
155 const XpOidCardList
* default_cards
);
157 * XpOidDocFmtList-valued attribute access
159 XpOidDocFmtList
* XpGetDocFmtListAttr(XpContextPtr pContext
,
162 const XpOidDocFmtList
* valid_fmt_list
);
163 void XpPutDocFmtListAttr(XpContextPtr pContext
,
166 const XpOidDocFmtList
* list
);
167 void XpValidateDocFmtListAttr(XpContextPtr pContext
,
170 const XpOidDocFmtList
* valid_fmts
,
171 const XpOidDocFmtList
* default_fmts
);
173 * XpOidMediumSS-valued attribute access
175 XpOidMediumSS
* XpGetMediumSSAttr(XpContextPtr pContext
,
178 const XpOidList
* valid_trays
,
179 const XpOidList
* valid_sizes
);
180 void XpPutMediumSSAttr(XpContextPtr pContext
,
183 const XpOidMediumSS
* msss
);
184 const XpOidMediumSS
* XpGetDefaultMediumSS(void);
187 * XpOidTrayMediumList-valued attribute access
189 XpOidTrayMediumList
* XpGetTrayMediumListAttr(XpContextPtr pContext
,
192 const XpOidList
* valid_trays
,
193 const XpOidMediumSS
* msss
);
194 void XpPutTrayMediumListAttr(XpContextPtr pContext
,
197 const XpOidTrayMediumList
* tm
);
198 void XpValidatePrinterMediaAttrs(XpContextPtr pContext
,
199 const XpOidList
* valid_trays
,
200 const XpOidList
* valid_sizes
);
202 * Attribute pool validation
204 void XpValidateAttributePool(XpContextPtr pContext
,
206 const XpValidatePoolsRec
* vpr
);
207 void XpValidatePrinterPool(XpContextPtr pContext
,
208 const XpValidatePoolsRec
* vpr
);
209 void XpValidateNotificationProfile(XpContextPtr pContext
);
210 void XpValidateJobPool(XpContextPtr pContext
,
211 const XpValidatePoolsRec
* vpr
);
212 void XpValidateDocumentPool(XpContextPtr pContext
,
213 const XpValidatePoolsRec
* vpr
);
214 void XpValidatePagePool(XpContextPtr pContext
,
215 const XpValidatePoolsRec
* vpr
);
217 #endif /* _XP_PRINT_SERVER_ */
219 #endif /* _Xp_AttrValid_h - don't add anything after this line */