Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2076 lines
73 KiB

  1. /*
  2. File: PMTicket.h
  3. Contains: Mac OS X Printing Manager Job Ticket Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __MACTYPES__
  11. #include <MacTypes.h>
  12. #endif
  13. #ifndef __CFSTRING__
  14. #include <CFString.h>
  15. #endif
  16. #ifndef __CFNUMBER__
  17. #include <CFNumber.h>
  18. #endif
  19. #ifndef __CFDATE__
  20. #include <CFDate.h>
  21. #endif
  22. #ifndef __PMERRORS__
  23. #include <PMErrors.h>
  24. #endif
  25. #ifndef __PMDEFINITIONS__
  26. #include <PMDefinitions.h>
  27. #endif
  28. #include <stdio.h>
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38. #if PRAGMA_STRUCT_ALIGN
  39. #pragma options align=mac68k
  40. #elif PRAGMA_STRUCT_PACKPUSH
  41. #pragma pack(push, 2)
  42. #elif PRAGMA_STRUCT_PACK
  43. #pragma pack(2)
  44. #endif
  45. /* SECTION I: DATA TYPES, STUCTURES, and CONSTANTS */
  46. /* General opaque Ticket object reference. This is returned when you create a PageFormat, */
  47. /* PrintSettings, DocumentInfo, JobInfo, or JobTicket. A list of Job Tickets or other */
  48. /* tickets can be saved as a list of references. */
  49. typedef struct OpaquePMTicketRef* PMTicketRef;
  50. typedef struct OpaquePMTemplateRef* PMTemplateRef;
  51. /* A few constants that will be useful in calling Job Ticket functions. */
  52. enum {
  53. kPMUnlocked = false,
  54. kPMLocked = true
  55. };
  56. #define kPMDontFetchItem NULL /* Used to ask GetItem if an item exists. */
  57. /* The following constant determines if the ticket code sets an item in the top level ticket */
  58. /* or down in some sub-ticket within the top level ticket. If passed as the document number, */
  59. /* the ticket code will simply set the item in the ticket passed. If the document number is */
  60. /* non "kTopLevel" but the page number is "kTopLevel", the ticket code will set the item in the */
  61. /* document level sub-ticket. If both parameters are non "kTopLevel", the ticket code will set */
  62. /* the item in the correct sub ticket for the document and page. */
  63. /* For now, all calls should use kPMTopLevel for document and page numbers, or the passed in */
  64. /* docment and page numbers if they are available. In the future we expect to enable embedded */
  65. /* document and page tickets. */
  66. enum {
  67. kPMTopLevel = 0
  68. };
  69. /* There are several different types of tickets that use the same accessor functions and */
  70. /* allow the programmer to use different keys to access the proper fields in each ticket. */
  71. /* A Job Ticket has the following structure: */
  72. /* Job Ticket */
  73. /* Job Ticket Fields */
  74. /* Page Format Ticket (required) */
  75. /* Paper Info Ticket (required) */
  76. /* Print Settings Ticket (required) */
  77. /* Paper Info Ticket (required) */
  78. /* DOWNSTREAM TICKETS - Heading from PC or PJC to other modules. */
  79. #define kPMJobTicket CFSTR("com.apple.print.JobTicket")
  80. #define kPMDocumentTicket CFSTR("com.apple.print.DocumentTicket")
  81. #define kPMPageTicket CFSTR("com.apple.print.PageTicket")
  82. #define kPMPageFormatTicket CFSTR("com.apple.print.PageFormatTicket")
  83. #define kPMPrintSettingsTicket CFSTR("com.apple.print.PrintSettingsTicket")
  84. #define kPMDestinationTicket CFSTR("com.apple.print.DestinationTicket")
  85. #define kPMConverterSetupTicket CFSTR("com.apple.print.ConverterSetupTicket")
  86. /* UPSTREAM TICKETS - Expected to be created by low level modules and passed up. */
  87. #define kPMPrinterInfoTicket CFSTR("com.apple.print.PrinterInfoTicket")
  88. #define kPMModuleInfoTicket CFSTR("com.apple.print.ModuleInfoTicket")
  89. /* OTHER TICKETS, going either direction */
  90. #define kPMTicketList CFSTR("com.apple.print.TicketList")
  91. #define kPMPaperInfoTicket CFSTR("com.apple.print.PaperInfoTicket")
  92. /* An enum to keep track in a programmatic way of which type of ticket we're working */
  93. /* with. These do not need to match up with the order of tickets listed in the ticket */
  94. /* types in PMTicket.h because we convert from string to enum in an internal function. */
  95. /* Warning: Don't use these tags when creating tickets. Use the CFSTRs above. */
  96. typedef SInt16 PMTicketType;
  97. enum {
  98. kPMTicketTypeUnknown = -1,
  99. kPMJobTicketType = 1,
  100. kPMDocumentTicketType = 2,
  101. kPMPageTicketType = 3,
  102. kPMPageFormatTicketType = 4,
  103. kPMPrintSettingsTicketType = 5,
  104. kPMPrinterInfoTicketType = 6,
  105. kPMDestinationTicketType = 7,
  106. kPMConverterSetupTicketType = 8,
  107. kPMModuleInfoTicketType = 9,
  108. kPMTicketListType = 10,
  109. kPMPaperInfoTicketType = 11
  110. };
  111. /*
  112. * PMPrintingPhaseType
  113. *
  114. * Discussion:
  115. * An enum to demark where in the printing process we are. This
  116. * value will be stored in the print settings ticket at the top
  117. * level in the Job Ticket. It will be used to signal shift from one
  118. * phase to the next and may be set by just about any part of the
  119. * system. Users will want to check for ">" (greater than) or "<"
  120. * (less than) conditions when possible, allowing for additional
  121. * phases to be defined later on.
  122. */
  123. typedef UInt16 PMPrintingPhaseType;
  124. enum {
  125. kPMPhaseUnknown = 0, /* Not clear what phase we're in yet. */
  126. kPMPhasePreDialog = 1, /* Just before we execute the code to open the dialog. */
  127. kPMPhaseDialogsUp = 2, /* One of the dialogs is in front of the user. */
  128. kPMPhasePostDialogs = 3, /* Dialogs are down, not yet spooling. */
  129. kPMPhasePreAppDrawing = 4, /* Just before we begin to spool */
  130. kPMPhaseAppDrawing = 5, /* We're spooling drawing commands from the app. */
  131. kPMPhasePostAppDrawing = 6, /* Finished with spooling, not yet rendering or converting. */
  132. kPMPhasePreConversion = 7, /* Just before we begin to convert to PS, Raster, or other final format. */
  133. kPMPhaseConverting = 8, /* Converting from Spool file to final printer format. */
  134. kPMPhasePostConversion = 9, /* Done with printer ready data, waiting for completion. */
  135. kPMPhasePrinting = 10 /* In the process of waiting for the printer. */
  136. };
  137. typedef SInt16 PMTicketErrors;
  138. /* BATCH PROCESSING ENUMS AND STRUCTURES */
  139. /* - Look in this section for help creating statically defined tickets. */
  140. /* We have the ability to create a Ticket from an array of key/item pairs that define */
  141. /* the keys and items for the entries in the ticket. To facilitate easy conversion of */
  142. /* these key/item pairs, we've defined a few constants to help in the batch processing of */
  143. /* these arrays. These are basically key types that are allowed for batch processing. */
  144. typedef UInt16 PMTicketItemType;
  145. enum {
  146. kPMItemInvalidType = 0,
  147. kPMItemCStringType = 1, /* a C string pointed to by a char* */
  148. kPMItemSInt32Type = 2, /* a C signed 32 bit integer. */
  149. kPMItemBooleanType = 3, /* A Boolean */
  150. kPMItemCStrListType = 4, /* A list of c-strings. */
  151. kPMItemPMRectType = 5, /* A pointer to a PMRect */
  152. kPMItemSInt32ListType = 6, /* A pointer to a SInt32List */
  153. kPMItemPMRectListType = 7 /* A pointer to a PMRectList */
  154. };
  155. /* A structure that holds a list of CString pointers, along with a definition for a constant list. */
  156. struct CStrList {
  157. SInt32 count; /* Number of CString pointers in the array. */
  158. const char ** strArray; /* Pointer to first CString pointer. */
  159. };
  160. typedef struct CStrList CStrList;
  161. typedef const CStrList ConstCStrList;
  162. /* A structure to hold a list of Signed 32 bit integers. */
  163. struct SInt32List {
  164. SInt32 count; /* Number of Signed 32 bit values in array. */
  165. const SInt32 * sInt32Array; /* Pointer to the first 32 bit value in array. */
  166. };
  167. typedef struct SInt32List SInt32List;
  168. typedef const SInt32List ConstSInt32List;
  169. /* A structure to hold a list of PMRect structures. PMRect is defined in PMDefinitions.h */
  170. /* and is basically a set of four doubles (top, left, bottom, and right). */
  171. struct PMRectList {
  172. SInt32 count; /* Number of PMRect pointers in the array. */
  173. const PMRect ** pmRectArray; /* Pointer to the first PMRect pointer. */
  174. };
  175. typedef struct PMRectList PMRectList;
  176. typedef const PMRectList ConstPMRectList;
  177. /* CF types can't be statically initialized, but CString and Pascal strings can be. */
  178. /* We have created utilities to convert from static C and Pascal based data into CF types. */
  179. /* The structure below will serve as a statically defined "Ticket Item" that can then be */
  180. /* converted into a job ticket item. An array of these structures would be made into a ticket. */
  181. struct PMTicketItemStruct {
  182. char * key; /* The CString for the key. */
  183. PMTicketItemType itemType; /* What type of item is being defined in union below. */
  184. Boolean locked; /* Can other callers change this after it's entered in a ticket? */
  185. union { /* The item data itself. */
  186. const void * GenericData; /* Generic data */
  187. const char * cString; /* kPMItemCStringType */
  188. SInt32 sInt32; /* kPMItemSInt32Type */
  189. UInt32 boolean; /* kPMItemBooleanType */
  190. ConstCStrList * cStrlist; /* kPMItemCStrListType */
  191. PMRect * rect; /* kPMItemPMRectType */
  192. ConstSInt32List * sInt32List; /* kPMItemSInt32ListType */
  193. ConstPMRectList * pmRectList; /* kPMItemPMRectListType */
  194. } value;
  195. };
  196. typedef struct PMTicketItemStruct PMTicketItemStruct;
  197. /* END OF BATCH PROCESSING ENUMS AND STRUCTURES */
  198. /* ENUMS for Ticket Values */
  199. /* The values for kPMDuplexingKey */
  200. enum {
  201. kPMDuplexNone = 1,
  202. kPMDuplexNoTumble = 2, /* Print on both sides of the paper, pages flip from left to right.*/
  203. kPMDuplexTumble = 3, /* Print on both sides of the paper, tumbling on so pages flip top to bottom.*/
  204. kPMSimplexTumble = 4, /* Print on only one side of the paper, but tumble the images while printing.*/
  205. kPMDuplexDefault = kPMDuplexNone /* If the kPMDuplexingKey is not in a ticket then kPMDuplexDefault should be assumed.*/
  206. };
  207. /* Values for the kPMPSErrorHandlerKey */
  208. enum {
  209. kPSNoErrorHandler = 0,
  210. kPSErrorHandler = 1
  211. };
  212. /* If the kPMCopyCollateKey is not present, then kPMCopyCollateDefault should be assumed. */
  213. enum {
  214. kPMCopyCollateDefault = true
  215. };
  216. /* END OF SECTION I: DATA TYPES, STUCTURES, and CONSTANTS */
  217. /* SECTION II: TICKET KEYS */
  218. /* - Look in this section for particular predefined keys for various tickets. */
  219. /* Each key is defined to store it's data as a particular CF type, but there are some */
  220. /* utilities defined to fetch data in different formats. For instance, it would be simple */
  221. /* to read in the Job Name as a CFString, or as a 'C' string. */
  222. /* Ticket: PAPER INFO TICKET
  223. This ticket contains a single Paper Info set, with all the information necessary to
  224. describe a paper type available from the Printer Module.
  225. */
  226. #define kPMPaperInfoPrelude "com.apple.print.PaperInfo."
  227. /* CFString for the name of the paper displayed in UI */
  228. #define kPMPaperNameStr "com.apple.print.PaperInfo.PMPaperName"
  229. #define kPMPaperNameKey CFSTR("com.apple.print.PaperInfo.PMPaperName")
  230. /* CFArray of 4 CFNumbers of kCFNumberDoubleType for paper size in points. */
  231. #define kPMUnadjustedPaperRectStr "com.apple.print.PaperInfo.PMUnadjustedPaperRect"
  232. #define kPMUnadjustedPaperRectKey CFSTR("com.apple.print.PaperInfo.PMUnadjustedPaperRect")
  233. /* CFArray of 4 CFNumbers of kCFNumberDoubleType for page size within the paper, in points. */
  234. #define kPMUnadjustedPageRectStr "com.apple.print.PaperInfo.PMUnadjustedPageRect"
  235. #define kPMUnadjustedPageRectKey CFSTR("com.apple.print.PaperInfo.PMUnadjustedPageRect")
  236. /* CFBoolean tells if we need to find a closest match for this paper */
  237. #define kPMMatchPaperStr "com.apple.print.PaperInfo.PMMatchPaper"
  238. #define kPMMatchPaperKey CFSTR("com.apple.print.PaperInfo.PMMatchPaper")
  239. /* Ticket: PAGE FORMAT TICKET
  240. Describes the application's drawing environment, including resolution, scaling, and
  241. orientation. All information in the page format ticket is saved with the user's document,
  242. so the single paper info stored inside the page format ticket describes the logical page
  243. an application may draw to. This logical page is then mapped to a physical page defined
  244. in the Print Settings Ticket.
  245. */
  246. #define kPMPageFormatPrelude "com.apple.print.PageFormat."
  247. /* CFArray of 4 CFNumbers of kCFNumberDoubleType for scaled and rotated page rectangle. */
  248. #define kPMAdjustedPaperRectStr "com.apple.print.PageFormat.PMAdjustedPaperRect"
  249. #define kPMAdjustedPaperRectKey CFSTR("com.apple.print.PageFormat.PMAdjustedPaperRect")
  250. /* CFArray of 4 CFNumbers of kCFNumberDoubleType for scaled and rotated page rectangle, in points. */
  251. #define kPMAdjustedPageRectStr "com.apple.print.PageFormat.PMAdjustedPageRect"
  252. #define kPMAdjustedPageRectKey CFSTR("com.apple.print.PageFormat.PMAdjustedPageRect")
  253. /* CFNumber - kCFNumberDoubleType, Drawing resolution in horizontal direction. */
  254. #define kPMDrawingResHorizontalStr "com.apple.print.PageFormat.PMHorizontalRes"
  255. #define kPMDrawingResHorizontalKey CFSTR("com.apple.print.PageFormat.PMHorizontalRes")
  256. /* CFNumber - kCFNumberDoubleType, Drawing resolution in vertical direction. */
  257. #define kPMDrawingResVerticalStr "com.apple.print.PageFormat.PMVerticalRes"
  258. #define kPMDrawingResVerticalKey CFSTR("com.apple.print.PageFormat.PMVerticalRes")
  259. /* CFNumber - kCFNumberDoubleType, Horizontal scaling factor applied to original page size - 1 = 100% */
  260. #define kPMPageScalingHorizontalStr "com.apple.print.PageFormat.PMScaling"
  261. #define kPMPageScalingHorizontalKey CFSTR("com.apple.print.PageFormat.PMScaling")
  262. /* CFNumber - kCFNumberDoubleType, Vertical scaling factor applied to original page size - 1 = 100%. */
  263. #define kPMPageScalingVerticalStr "com.apple.print.PageFormat.PMVerticalScaling"
  264. #define kPMPageScalingVerticalKey CFSTR("com.apple.print.PageFormat.PMVerticalScaling")
  265. /* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, 3 = reverse landscape, 4 = reverse portrait. */
  266. #define kPMPageOrientationStr "com.apple.print.PageFormat.PMOrientation"
  267. #define kPMPageOrientationKey CFSTR("com.apple.print.PageFormat.PMOrientation")
  268. /* CFData - Print record handle, allowing easy access during most calls. Not used when flattened. (OS8 Only) */
  269. #define kPMPageBackupRecordHdlStr "com.apple.print.PageFormat.BackupPrintRecordHandle"
  270. #define kPMPageBackupRecordHdlKey CFSTR("com.apple.print.PageFormat.BackupPrintRecordHandle")
  271. /* CFData - Print record stored in complete form - used when flattening Ticket w/ record. (OS8 only) */
  272. #define kPMPageBackupRecordDataStr "com.apple.print.PageFormat.BackupPrintRecord"
  273. #define kPMPageBackupRecordDataKey CFSTR("com.apple.print.PageFormat.BackupPrintRecord")
  274. /* CFData - Handle to the print record using for custom dialog calls. Not stored when flattened. (OS8 Only) */
  275. #define kPMPageCustomDialogHdlStr "com.apple.print.PageFormat.CustomDialogRecord"
  276. #define kPMPageCustomDialogHdlKey CFSTR("com.apple.print.PageFormat.CustomDialogRecord")
  277. /* CFString - name of the formating printer */
  278. #define kPMFormattingPrinterStr "com.apple.print.PageFormat.FormattingPrinter"
  279. #define kPMFormattingPrinterKey CFSTR("com.apple.print.PageFormat.FormattingPrinter")
  280. /* Ticket: PRINT SETTINGS TICKET
  281. Contains the user's print dialog selections. Includes items set by the application to
  282. further refine the output produced on the printer. Information in this ticket may also
  283. be saved with the decument, but are likely to be overwritten by any saved settings.
  284. Logical page information is mapped to the physical page defined in this ticket.
  285. */
  286. #define kPMPrintSettingsPrelude "com.apple.print.PrintSettings."
  287. /* CFNumber, kCFNumberSInt32Type kPMDestinationPrinter kPMDestinationFile kPMDestinationFax. */
  288. #define kPMDestinationTypeStr "com.apple.print.PrintSettings.PMDestinationType"
  289. #define kPMDestinationTypeKey CFSTR("com.apple.print.PrintSettings.PMDestinationType")
  290. /* CFString - URL for the output filename. */
  291. #define kPMOutputFilenameStr "com.apple.print.PrintSettings.PMOutputFilename"
  292. #define kPMOutputFilenameKey CFSTR("com.apple.print.PrintSettings.PMOutputFilename")
  293. /* CFNumber, kCFNumberSInt32Type, number of copies to print. */
  294. #define kPMCopiesStr "com.apple.print.PrintSettings.PMCopies"
  295. #define kPMCopiesKey CFSTR("com.apple.print.PrintSettings.PMCopies")
  296. /* CFBoolean, Turns on collating */
  297. #define kPMCopyCollateStr "com.apple.print.PrintSettings.PMCopyCollate"
  298. #define kPMCopyCollateKey CFSTR("com.apple.print.PrintSettings.PMCopyCollate")
  299. /* CFBoolean, If true, we print sheets back to front. All layout options are unaffected by reverse order. */
  300. #define kPMReverseOrderStr "com.apple.print.PrintSettings.PMReverseOrder"
  301. #define kPMReverseOrderKey CFSTR("com.apple.print.PrintSettings.PMReverseOrder")
  302. /* CFArray of kCFNumberSInt32Type, each pair indicating valid range of pages that the application is able to print. Does not signify user choices. */
  303. #define kPMPageRangeStr "com.apple.print.PrintSettings.PMPageRange"
  304. #define kPMPageRangeKey CFSTR("com.apple.print.PrintSettings.PMPageRange")
  305. /* CFNumber - kCFNumberSInt32Type, first page selected by user to print. */
  306. #define kPMFirstPageStr "com.apple.print.PrintSettings.PMFirstPage"
  307. #define kPMFirstPageKey CFSTR("com.apple.print.PrintSettings.PMFirstPage")
  308. /* CFNumber - kCFNumberSInt32Type, last page selected by user to print. */
  309. #define kPMLastPageStr "com.apple.print.PrintSettings.PMLastPage"
  310. #define kPMLastPageKey CFSTR("com.apple.print.PrintSettings.PMLastPage")
  311. /* CFBoolean - If true, we do borders. */
  312. #define kPMBorderStr "com.apple.print.PrintSettings.PMBorder"
  313. #define kPMBorderKey CFSTR("com.apple.print.PrintSettings.PMBorder")
  314. /* CFNumber - kCFNumberSInt32Type, Enum (PMBorderType) */
  315. #define kPMBorderTypeStr "com.apple.print.PrintSettings.PMBorderType"
  316. #define kPMBorderTypeKey CFSTR("com.apple.print.PrintSettings.PMBorderType")
  317. /* CFBoolean, Turns on N-Up layout. */
  318. #define kPMLayoutNUpStr "com.apple.print.PrintSettings.PMLayoutNUp"
  319. #define kPMLayoutNUpKey CFSTR("com.apple.print.PrintSettings.PMLayoutNUp")
  320. /* CFNumber - kCFNumberSInt32Type, indicates number of layout rows. */
  321. #define kPMLayoutRowsStr "com.apple.print.PrintSettings.PMLayoutRows"
  322. #define kPMLayoutRowsKey CFSTR("com.apple.print.PrintSettings.PMLayoutRows")
  323. /* CFNumber - kCFNumberSInt32Type, indicates number of layout columns. */
  324. #define kPMLayoutColumnsStr "com.apple.print.PrintSettings.PMLayoutColumns"
  325. #define kPMLayoutColumnsKey CFSTR("com.apple.print.PrintSettings.PMLayoutColumns")
  326. /* CFNumber - kCFNumberSInt32Type, Enum (PMLayoutDirection) */
  327. #define kPMLayoutDirectionStr "com.apple.print.PrintSettings.PMLayoutDirection"
  328. #define kPMLayoutDirectionKey CFSTR("com.apple.print.PrintSettings.PMLayoutDirection")
  329. /* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, etc. */
  330. #define kPMLayoutTileOrientationStr "com.apple.print.PrintSettings.PMLayoutTileOrientation"
  331. #define kPMLayoutTileOrientationKey CFSTR("com.apple.print.PrintSettings.PMLayoutTileOrientation")
  332. /* CFNumber - kCFNumberSInt32Type, Enum, draft, normal, best */
  333. #define kPMQualityStr "com.apple.print.PrintSettings.PMQuality"
  334. #define kPMQualityKey CFSTR("com.apple.print.PrintSettings.PMQuality")
  335. /* CFNumber - kCFNumberSInt32Type, Enum, draft, normal, best */
  336. #define kPMPaperTypeStr "com.apple.print.PrintSettings.PMPaperType"
  337. #define kPMPaperTypeKey CFSTR("com.apple.print.PrintSettings.PMPaperType")
  338. /* CFNumber - kCFNumberSInt32Type, Enum, active = 0, pending, hold until, hold indefinitely, aborted, finished */
  339. #define kPMJobStateStr "com.apple.print.PrintSettings.PMJobState"
  340. #define kPMJobStateKey CFSTR("com.apple.print.PrintSettings.PMJobState")
  341. /* CFDate - Time we expect to print the job. */
  342. #define kPMJobHoldUntilTimeStr "com.apple.print.PrintSettings.PMJobHoldUntilTime"
  343. #define kPMJobHoldUntilTimeKey CFSTR("com.apple.print.PrintSettings.PMJobHoldUntilTime")
  344. /* CFNumber - kCFNumberSInt32Type, Enum, Low = 0, normal, urgent */
  345. #define kPMJobPriorityStr "com.apple.print.PrintSettings.PMJobPriority"
  346. #define kPMJobPriorityKey CFSTR("com.apple.print.PrintSettings.PMJobPriority")
  347. /* CFNUmber - kCFNumberSInt32Type, Enum, paper sources. */
  348. #define kPMPaperSourceStr "com.apple.print.PrintSettings.PMPaperSource"
  349. #define kPMPaperSourceKey CFSTR("com.apple.print.PrintSettings.PMPaperSource")
  350. /* CFNumber - kCFNumberSInt32Type, Enum, kPMDuplexNone, kPMDuplexNoTumble, kPMDuplexTumble, kPMSimplexTumble */
  351. #define kPMDuplexingStr "com.apple.print.PrintSettings.PMDuplexing"
  352. #define kPMDuplexingKey CFSTR("com.apple.print.PrintSettings.PMDuplexing")
  353. /* CFNumber - kCFNumberSInt32Type, Enum, B/W, Grayscale, Color, HiFi Color. */
  354. #define kPMColorModeStr "com.apple.print.PrintSettings.PMColorMode"
  355. #define kPMColorModeKey CFSTR("com.apple.print.PrintSettings.PMColorMode")
  356. /* CFNumber - kCFNumberSInt32Type, ID of profile to use. */
  357. #define kPMColorSyncProfileIDStr "com.apple.print.PrintSettings.PMColorSyncProfileID"
  358. #define kPMColorSyncProfileIDKey CFSTR("com.apple.print.PrintSettings.PMColorSyncProfileID")
  359. /* CFString - path of system profile. */
  360. #define kPMColorSyncSystemProfilePathStr "com.apple.print.PrintSettings.PMColorSyncSystemProfilePath"
  361. #define kPMColorSyncSystemProfilePathKey CFSTR("com.apple.print.PrintSettings.PMColorSyncSystemProfilePath")
  362. /* CFNumber - kCFNumberDoubleType, Horizontal scaling factor applied to original page size. */
  363. #define kPMPrintScalingHorizontalStr "com.apple.print.PrintSettings.PMScaling"
  364. #define kPMPrintScalingHorizontalKey CFSTR("com.apple.print.PrintSettings.PMScaling")
  365. /* CFNumber - kCFNumberDoubleType, Vertical scaling factor applied to original page size. */
  366. #define kPMPrintScalingVerticalStr "com.apple.print.PrintSettings.PMVerticalScaling"
  367. #define kPMPrintScalingVerticalKey CFSTR("com.apple.print.PrintSettings.PMVerticalScaling")
  368. /* CFNumber - kCFNumberSInt32Type, Enum (PMScalingAlignment) */
  369. #define kPMPrintScalingAlignmentStr "com.apple.print.PrintSettings.PMScalingAlignment"
  370. #define kPMPrintScalingAlignmentKey CFSTR("com.apple.print.PrintSettings.PMScalingAlignment")
  371. /* CFNumber - kCFNumberSInt32Type, PMOrientation, 1 = portrait, 2 = landscape, etc. */
  372. #define kPMPrintOrientationStr "com.apple.print.PrintSettings.PMOrientation"
  373. #define kPMPrintOrientationKey CFSTR("com.apple.print.PrintSettings.PMOrientation")
  374. /* CFString - YES means the user clicked on the Preview button */
  375. #define kPMPreviewStr "com.apple.print.PrintSettings.PMPreview"
  376. #define kPMPreviewKey CFSTR("com.apple.print.PrintSettings.PMPreview")
  377. /* CFData - Print record handle, allowing easy access during most calls. Not used when flattened. (OS8 Only) */
  378. #define kPMPrintBackupRecordHdlStr "com.apple.print.PrintSettings.BackupPrintRecordHandle"
  379. #define kPMPrintBackupRecordHdlKey CFSTR("com.apple.print.PrintSettings.BackupPrintRecordHandle")
  380. /* CFData - Print record stored in complete form - used when flattening Ticket w/ record. (OS8 only) */
  381. #define kPMPrintBackupRecordDataStr "com.apple.print.PrintSettings.BackupPrintRecord"
  382. #define kPMPrintBackupRecordDataKey CFSTR("com.apple.print.PrintSettings.BackupPrintRecord")
  383. /* CFData - Handle to the print record using for custom dialog calls. Not stored when flattened. (OS8 Only) */
  384. #define kPMPrintCustomDialogHdlStr "com.apple.print.PrintSettings.CustomDialogRecord"
  385. #define kPMPrintCustomDialogHdlKey CFSTR("com.apple.print.PrintSettings.CustomDialogRecord")
  386. /* CFArray - main & option PPD key for input paper feed */
  387. #define kPMPrimaryPaperFeedStr "com.apple.print.PrintSettings.PMPrimaryPaperFeed"
  388. #define kPMPrimaryPaperFeedKey CFSTR("com.apple.print.PrintSettings.PMPrimaryPaperFeed")
  389. /* CFArray - main & option PPD key for input paper feed */
  390. #define kPMSecondaryPaperFeedStr "com.apple.print.PrintSettings.PMSecondaryPaperFeed"
  391. #define kPMSecondaryPaperFeedKey CFSTR("com.apple.print.PrintSettings.PMSecondaryPaperFeed")
  392. /* CFNumber - kCFNumberSInt32Type */
  393. #define kPMPSErrorHandlerStr "com.apple.print.PrintSettings.PMPSErrorHandler"
  394. #define kPMPSErrorHandlerKey CFSTR("com.apple.print.PrintSettings.PMPSErrorHandler")
  395. /* CFBoolean, Turns on PS error on screen notification. */
  396. #define kPMPSErrorOnScreenStr "com.apple.print.PrintSettings.PMPSErrorOnScreen"
  397. #define kPMPSErrorOnScreenKey CFSTR("com.apple.print.PrintSettings.PMPSErrorOnScreen")
  398. /* CFArray - main & option PPD key for tray switching */
  399. #define kPMPSTraySwitchStr "com.apple.print.PrintSettings.PMPSTraySwitch"
  400. #define kPMPSTraySwitchKey CFSTR("com.apple.print.PrintSettings.PMPSTraySwitch")
  401. /* CFDictionary - main & option PPD keys for additional features */
  402. #define kPMPPDDictStr "com.apple.print.PrintSettings.kPMPPDDictStr"
  403. #define kPMPPDDictKey CFSTR("com.apple.print.PrintSettings.kPMPPDDictStr")
  404. /* Ticket: PAGE TICKET
  405. Future Feature. Intended to hold Page Format and Print Settings ticket for a single
  406. page of the document. Not yet implemented.
  407. */
  408. #define kPMPageTicketPrelude "com.apple.print.PageTicket."
  409. /* Ticket: DOCUMENT TICKET
  410. Future Feature. Intended to hold multiple Page Tickets and separate Page Format
  411. and Print Settings tickets for a single document. Not yet implemented. For now,
  412. the keys listed here will be included at the Job Ticket Level.
  413. */
  414. #define kPMDocumentTicketPrelude "com.apple.print.DocumentTicket."
  415. /* CFString. Indicates format of data stored in the spool file. */
  416. #define kPMSpoolFormatStr "com.apple.print.DocumentTicket.PMSpoolFormat"
  417. #define kPMSpoolFormatKey CFSTR("com.apple.print.DocumentTicket.PMSpoolFormat")
  418. /* CFString. Indicates format of data going to the Printer Module. */
  419. #define kPMPrinterModuleFormatStr "com.apple.print.DocumentTicket.PMDocPMInputFormat"
  420. #define kPMPrinterModuleFormatKey CFSTR("com.apple.print.DocumentTicket.PMDocPMInputFormat")
  421. /* Ticket: JOB TICKET
  422. Holds a Page Format and Print Settings ticket, as well as a few other fields that
  423. are Job Specific, such as information about the user that submitted the job. The
  424. fidelity bit controls what happens when the system encounters settings that can't
  425. be obeyed.
  426. In the future a Job Ticket may hold multiple document tickets in addition to the
  427. Print Settings and Page Format tickets.
  428. */
  429. #define kPMJobTicketPrelude "com.apple.print.JobInfo."
  430. /* CFString, The name of the job to be displayed in the queue window. */
  431. #define kPMJobNameStr "com.apple.print.JobInfo.PMJobName"
  432. #define kPMJobNameKey CFSTR("com.apple.print.JobInfo.PMJobName")
  433. /* CFString, The application's name */
  434. #define kPMApplicationNameStr "com.apple.print.JobInfo.PMApplicationName"
  435. #define kPMApplicationNameKey CFSTR("com.apple.print.JobInfo.PMApplicationName")
  436. /* CFNumber - kCFNumberSInt32Type, TBD how this is interpreted. */
  437. #define kPMUserLanguageStr "com.apple.print.JobInfo.PMUserLanguage"
  438. #define kPMUserLanguageKey CFSTR("com.apple.print.JobInfo.PMUserLanguage")
  439. /* CFString - Name of the user who submitted the job. */
  440. #define kPMJobOwnerStr "com.apple.print.JobInfo.PMJobOwner"
  441. #define kPMJobOwnerKey CFSTR("com.apple.print.JobInfo.PMJobOwner")
  442. /* CFDictionary - PMTemplateRef, actually. See PMTemplate.h */
  443. #define kPMJobTemplateStr "com.apple.print.JobInfo.PMJobTemplate"
  444. #define kPMJobTemplateKey CFSTR("com.apple.print.JobInfo.PMJobTemplate")
  445. /* CFNumber, kCFNumberSInt32Type, Enum - Spooling, RIPing, etc. */
  446. #define kPMPhaseStr "com.apple.print.JobInfo.PMPrintingPhase"
  447. #define kPMPhaseKey CFSTR("com.apple.print.JobInfo.PMPrintingPhase")
  448. /* CFString, Mime type from the kPMOutputTypeListKey array the printer module should generate. */
  449. #define kPMOutputTypeStr "com.apple.print.JobInfo.PMOutputType"
  450. #define kPMOutputTypeKey CFSTR("com.apple.print.JobInfo.PMOutputType")
  451. /* Ticket: LIST TICKET
  452. Contains a list of other tickets. There is no restriction on the type of tickets
  453. that can be stored in a list, any ticket will do.
  454. */
  455. #define kPMTicketListPrelude "com.apple.print.TicketList."
  456. /* Ticket: Printer Info Ticket
  457. Created by the Printer Module to describe features and settings of the current
  458. printer. This is information largely used by the Printer Module itself and the Print
  459. Dialog Extensions associated with the PM. All "range" type values that would be
  460. verified at dialog time should go in a separate Template.
  461. */
  462. #define kPMPrinterInfoPrelude "com.apple.print.PrinterInfo."
  463. /* CFString, Full name of the printer. */
  464. #define kPMPrinterLongNameStr "com.apple.print.PrinterInfo.PMPrinterLongName"
  465. #define kPMPrinterLongNameKey CFSTR("com.apple.print.PrinterInfo.PMPrinterLongName")
  466. /* CFString, Shorter name to use when you have less space. */
  467. #define kPMPrinterShortNameStr "com.apple.print.PrinterInfo.PMPrinterShortName"
  468. #define kPMPrinterShortNameKey CFSTR("com.apple.print.PrinterInfo.PMPrinterShortName")
  469. /* CFString, Product name is used for ???? */
  470. #define kPMMakeAndModelNameStr "com.apple.print.PrinterInfo.PMMakeAndModelName"
  471. #define kPMMakeAndModelNameKey CFSTR("com.apple.print.PrinterInfo.PMMakeAndModelName")
  472. /* CFData, Product address. */
  473. #define kPMPrinterAddressStr "com.apple.print.PrinterInfo.PMPrinterAddress"
  474. #define kPMPrinterAddressKey CFSTR("com.apple.print.PrinterInfo.PMPrinterAddress")
  475. /* CFBoolean, If Non-zero, printer/PM can do color. */
  476. #define kPMSupportsColorStr "com.apple.print.PrinterInfo.PMSupportsColor"
  477. #define kPMSupportsColorKey CFSTR("com.apple.print.PrinterInfo.PMSupportsColor")
  478. /* CFBoolean, If Non-zero, printer/PM can do copies */
  479. #define kPMDoesCopiesStr "com.apple.print.PrinterInfo.PMDoesCopies"
  480. #define kPMDoesCopiesKey CFSTR("com.apple.print.PrinterInfo.PMDoesCopies")
  481. /* CFBoolean, If Non-zero, printer/PM can collate. */
  482. #define kPMDoesCopyCollateStr "com.apple.print.PrinterInfo.PMDoesCopyCollate"
  483. #define kPMDoesCopyCollateKey CFSTR("com.apple.print.PrinterInfo.PMDoesCopyCollate")
  484. /* CFBoolean, If Non-zero, printer/PM can reverse the printing order. */
  485. #define kPMDoesReverseOrderStr "com.apple.print.PrinterInfo.PMDoesReverseOrderK"
  486. #define kPMDoesReverseOrderKey CFSTR("com.apple.print.PrinterInfo.PMDoesReverseOrderK")
  487. /* CFArray of CFStrings indicating file types. See PMDefinitions.h for complete list. */
  488. #define kPMInputFileTypeListStr "com.apple.print.PrinterInfo.PMInputFileTypeList"
  489. #define kPMInputFileTypeListKey CFSTR("com.apple.print.PrinterInfo.PMInputFileTypeList")
  490. /* CFArray of CFStrings indicating the MIME type for the data is can send to an IO module. */
  491. #define kPMOutputTypeListStr "com.apple.print.PrinterInfo.PMOutputTypeList"
  492. #define kPMOutputTypeListKey CFSTR("com.apple.print.PrinterInfo.PMOutputTypeList")
  493. /* Postscript printing related tags */
  494. /* CFNumber - kCFNumberSInt32Type, indicates PostScript Language level. Contains one of the values from the enum below */
  495. #define kPMPostScriptLevelStr "com.apple.print.PrinterInfo.PMPostScriptLevel"
  496. #define kPMPostScriptLevelKey CFSTR("com.apple.print.PrinterInfo.PMPostScriptLevel")
  497. /* CFString e.g."2040.113"*/
  498. #define kPMPostScriptVersionStr "com.apple.print.PrinterInfo.PMPSVersion"
  499. #define kPMPostScriptVersionKey CFSTR("com.apple.print.PrinterInfo.PMPSVersion")
  500. /* CFNumber - kCFNumberSInt32Type, contains the PostScript revision which is an integer.*/
  501. #define kPMPostScriptRevisionStr "com.apple.print.PrinterInfo.PMPSRevision"
  502. #define kPMPostScriptRevisionKey CFSTR("com.apple.print.PrinterInfo.PMPSRevision")
  503. /* CFNumber - kCFNumberSInt32Type, contains one of the values from the enum below.*/
  504. #define kPMPostScriptTrueTypeFontRasterizerStr "com.apple.print.PrinterInfo.PMPSTTRasterizer"
  505. #define kPMPostScriptTrueTypeFontRasterizerKey CFSTR("com.apple.print.PrinterInfo.PMPSTTRasterizer")
  506. /* Enum for the possible font rasterizers. */
  507. enum {
  508. kPMPSTTRasterizerUnknown = 0, /* unknown*/
  509. kPMPSTTRasterizerNone = 1, /* none*/
  510. kPMPSTTRasterizerAccept68K = 2, /* accept 68k*/
  511. kPMPSTTRasterizerType42 = 3 /* type 42*/
  512. };
  513. /* Enum for possible PostScript Language Levels. */
  514. enum {
  515. kPMPSTargetLanguageLevel2and3 = -3, /* Level 2 Compatible, may take advantage of Level 3 features*/
  516. kPMPSTargetLanguageLevel1and2 = -2, /* Level 1 Compatible, may take advantage of Level 2 and 3 features*/
  517. kPMPSTargetLanguageLevelUnknown = -1, /* language level of target is unknown*/
  518. kPMPSTargetLanguageLevel1 = 1, /* level 1*/
  519. kPMPSTargetLanguageLevel2 = 2, /* level 2*/
  520. kPMPSTargetLanguageLevel3 = 3, /* level 3*/
  521. kPMPSTargetLanguageLevelDefault = kPMPSTargetLanguageLevelUnknown /* default*/
  522. };
  523. /* Note, we've removed the PMLanguageInfoKey because it's not valid to store strings or structures, everything needs to be a CFType.*/
  524. /* CFNumber - kCFNumberSInt32Type, Memory on the Printer itself. */
  525. #define kPMTotalMemInstalledStr "com.apple.print.PrinterInfo.PMTotalMemInstalled"
  526. #define kPMTotalMemInstalledKey CFSTR("com.apple.print.PrinterInfo.PMTotalMemInstalled")
  527. /* CFNumber - kCFNumberSInt32Type, Remaining memory available for use. */
  528. #define kPMTotalMemAvailableStr "com.apple.print.PrinterInfo.PMTotalMemAvailable"
  529. #define kPMTotalMemAvailableKey CFSTR("com.apple.print.PrinterInfo.PMTotalMemAvailable")
  530. /* PPD related tags */
  531. /* CFString, PPD file name or other description file. */
  532. #define kPMDescriptionFileStr "com.apple.print.PrinterInfo.PMDescriptionFile"
  533. #define kPMDescriptionFileKey CFSTR("com.apple.print.PrinterInfo.PMDescriptionFile")
  534. /* CFData, Compiled PPD file to ease parsing after the fact. Not sure we need. */
  535. #define kPMCompiledPPDStr "com.apple.print.PrinterInfo.PMCompiledPPD"
  536. #define kPMCompiledPPDKey CFSTR("com.apple.print.PrinterInfo.PMCompiledPPD")
  537. /* ColorSync related tags */
  538. /* CFString, representing a CFUUID - must be unique per device */
  539. #define kPMColorDeviceIDStr "com.apple.print.PrinterInfo.PMColorDeviceID"
  540. #define kPMColorDeviceIDKey CFSTR("com.apple.print.PrinterInfo.PMColorDeviceID")
  541. /* CFArray - of CFDicts, one for each factory profile. */
  542. #define kPMColorSyncProfilesStr "com.apple.print.PrinterInfo.PMColorSyncProfiles"
  543. #define kPMColorSyncProfilesKey CFSTR("com.apple.print.PrinterInfo.PMColorSyncProfiles")
  544. /* Installable options string. */
  545. /* CFData, Installable options from PPD file. */
  546. #define kPMInstallableOptionStr "com.apple.print.PrinterInfo.PMInstallableOption"
  547. #define kPMInstallableOptionKey CFSTR("com.apple.print.PrinterInfo.PMInstallableOption")
  548. /* Suggested app drawing resolutions */
  549. /* CFArray - array of pairs of kCFNumberDoubleType - One pair for each recommended resolution*/
  550. #define kPMPrinterSuggestedResStr "com.apple.print.PrinterInfo.PMPrinterSuggestedRes"
  551. #define kPMPrinterSuggestedResKey CFSTR("com.apple.print.PrinterInfo.PMPrinterSuggestedRes")
  552. /* Min and max range of resolutions */
  553. /* CFArray - 2 CFNumber, kCFNumberDoubleType, min resolution of printer */
  554. #define kPMPrinterMinResStr "com.apple.print.PrinterInfo.PMPrinterMinRes"
  555. #define kPMPrinterMinResKey CFSTR("com.apple.print.PrinterInfo.PMPrinterMinRes")
  556. /* CFArray - 2 CFNumber, kCFNumberDoubleType, max resolution of printer */
  557. #define kPMPrinterMaxResStr "com.apple.print.PrinterInfo.PMPrinterMaxRes"
  558. #define kPMPrinterMaxResKey CFSTR("com.apple.print.PrinterInfo.PMPrinterMaxRes")
  559. /* driver creator code */
  560. /* CFNumber - kCFNumberSInt32Type creator signiture for driver*/
  561. #define kPMDriverCreatorStr "com.apple.print.PrinterInfo.PMDriverCreator"
  562. #define kPMDriverCreatorKey CFSTR("com.apple.print.PrinterInfo.PMDriverCreator")
  563. /* Printer Resident font data handle */
  564. /* CFData, Printer resident fonts from printer query. */
  565. #define kPMPrinterFontStr "com.apple.print.PrinterInfo.Printer Fonts"
  566. #define kPMPrinterFontKey CFSTR("com.apple.print.PrinterInfo.Printer Fonts")
  567. /* CFBoolean - PJCIsPostScriptDriver*/
  568. #define kPMPrinterIsPostScriptDriverStr "com.apple.print.PrinterInfo.PMIsPostScriptDriver"
  569. #define kPMPrinterIsPostScriptDriverKey CFSTR("com.apple.print.PrinterInfo.PMIsPostScriptDriver")
  570. #define kPMIsBinaryOKStr "com.apple.print.PrinterInfo.PMIsBinaryOK"
  571. #define kPMIsBinaryOKKey CFSTR("com.apple.print.PrinterInfo.PMIsBinaryOK")
  572. /* CFBoolean - Can the comm channel take bytes with the high bit set?*/
  573. #define kPM8BitCommStr "com.apple.print.PrinterInfo.PM8BitComm"
  574. #define kPM8BitCommKey CFSTR("com.apple.print.PrinterInfo.PM8BitComm")
  575. #define kPMTransparentCommStr "com.apple.print.PrinterInfo.PMTransparentComm"
  576. #define kPMTransparentCommKey CFSTR("com.apple.print.PrinterInfo.PMTransparentComm")
  577. /* Ticket: Converter Setup Ticket
  578. Contains controls for converter. Generally, the Printer Module and Job Manager will set
  579. tags in this ticket to control the various settings of the conversion process.
  580. */
  581. #define kPMConverterSetupPrelude "com.apple.print.ConverterSetup."
  582. /* CFBoolean, turns on banding if it's available. */
  583. #define kPMBandingRequestedStr "com.apple.print.ConverterSetup.PMBandingRequested"
  584. #define kPMBandingRequestedKey CFSTR("com.apple.print.ConverterSetup.PMBandingRequested")
  585. /* CFNumber, number of scan lines needed for each band. Could be whole page, in which case banding is disabled. */
  586. #define kPMRequiredBandHeightStr "com.apple.print.ConverterSetup.PMRequiredBandHeight"
  587. #define kPMRequiredBandHeightKey CFSTR("com.apple.print.ConverterSetup.PMRequiredBandHeight")
  588. /* CFBoolean. If true, the printer module wants converter to switch between b/w bands and color bands when possible. */
  589. #define kPMDepthSwitchingEnabledStr "com.apple.print.ConverterSetup.PMDepthSwitching"
  590. #define kPMDepthSwitchingEnabledKey CFSTR("com.apple.print.ConverterSetup.PMDepthSwitching")
  591. /* CFBoolean. If true, the printer module wants converter to skip over white space if possible. */
  592. #define kPMWhiteSkippingEnabledStr "com.apple.print.ConverterSetup.PMWhiteSpaceSkipping"
  593. #define kPMWhiteSkippingEnabledKey CFSTR("com.apple.print.ConverterSetup.PMWhiteSpaceSkipping")
  594. /* CFNumber, CFNumberDoubleType indicating horizontal final rendering resolution. */
  595. #define kPMConverterResHorizontalStr "com.apple.print.ConverterSetup.PMConversionResHorizontal"
  596. #define kPMConverterResHorizontalKey CFSTR("com.apple.print.ConverterSetup.PMConversionResHorizontal")
  597. /* CFNumber, CFNumberDoubleType indicating vertical final rendering resolution. */
  598. #define kPMConverterResVerticalStr "com.apple.print.ConverterSetup.PMConversionResVertcial"
  599. #define kPMConverterResVerticalKey CFSTR("com.apple.print.ConverterSetup.PMConversionResVertcial")
  600. /* CFNumber, CFNumberLongType, indicates the pixel format requested of the converter. */
  601. #define kPMRequestedPixelFormatStr "com.apple.print.ConverterSetup.PMPixelFormat"
  602. #define kPMRequestedPixelFormatKey CFSTR("com.apple.print.ConverterSetup.PMPixelFormat")
  603. /* CFNumber, CFNumberLongType, indicates the pixel layout requested of the converter. */
  604. #define kPMRequestedPixelLayoutStr "com.apple.print.ConverterSetup.PMPixelLayout"
  605. #define kPMRequestedPixelLayoutKey CFSTR("com.apple.print.ConverterSetup.PMPixelLayout")
  606. /* CFNumber, kCFNumberSInt32Type, the profile ID for the profile to be used with this job. */
  607. #define kPMCVColorSyncProfileIDStr "com.apple.print.ConverterSetup.PMProfileID"
  608. #define kPMCVColorSyncProfileIDKey CFSTR("com.apple.print.ConverterSetup.PMProfileID")
  609. /* END OF SECTION II: TICKET KEYS */
  610. /* SECTION III, FUNCTIONS: */
  611. /* Create, or copy a Ticket. As a Ticket is created, its type is stored in the object itself */
  612. /* and used to help the programmer make sure they are adding the correct fields to the object. */
  613. /*
  614. * PMTicketCreate()
  615. *
  616. * Availability:
  617. * Non-Carbon CFM: not available
  618. * CarbonLib: not available
  619. * Mac OS X: in version 10.0 and later
  620. */
  621. EXTERN_API_C( OSStatus )
  622. PMTicketCreate(
  623. CFAllocatorRef allocator,
  624. CFStringRef ticketType,
  625. PMTicketRef * newTicket);
  626. /*
  627. * PMTicketCopy()
  628. *
  629. * Availability:
  630. * Non-Carbon CFM: not available
  631. * CarbonLib: not available
  632. * Mac OS X: in version 10.0 and later
  633. */
  634. EXTERN_API_C( OSStatus )
  635. PMTicketCopy(
  636. CFAllocatorRef allocator,
  637. PMTicketRef sourceTicket,
  638. PMTicketRef * destinationTicket);
  639. /* Retain, release, or get retain count of a Ticket. The behavior is modelled after */
  640. /* CoreFoundation's CFRetain, CFRelease, and CFGetRetainCount APIs. */
  641. /*
  642. * PMTicketGetRetainCount()
  643. *
  644. * Availability:
  645. * Non-Carbon CFM: not available
  646. * CarbonLib: not available
  647. * Mac OS X: in version 10.0 and later
  648. */
  649. EXTERN_API_C( OSStatus )
  650. PMTicketGetRetainCount(
  651. PMTicketRef ticket,
  652. CFIndex * retainCount);
  653. /*
  654. * PMTicketRetain()
  655. *
  656. * Availability:
  657. * Non-Carbon CFM: not available
  658. * CarbonLib: not available
  659. * Mac OS X: in version 10.0 and later
  660. */
  661. EXTERN_API_C( OSStatus )
  662. PMTicketRetain(PMTicketRef ticket);
  663. /*
  664. * PMTicketRelease()
  665. *
  666. * Availability:
  667. * Non-Carbon CFM: not available
  668. * CarbonLib: not available
  669. * Mac OS X: in version 10.0 and later
  670. */
  671. EXTERN_API_C( OSStatus )
  672. PMTicketRelease(PMTicketRef ticket);
  673. /*
  674. * PMTicketReleaseAndClear()
  675. *
  676. * Discussion:
  677. * PMTicketReleaseAndClear does the same thing as PMTicketRelease
  678. * except that it sets the passed in pointer to NULL, which we think
  679. * is good programming practice. Other references to the ticket may
  680. * still be valid, but this one is no longer expected to be used.
  681. *
  682. * Availability:
  683. * Non-Carbon CFM: not available
  684. * CarbonLib: not available
  685. * Mac OS X: in version 10.0 and later
  686. */
  687. EXTERN_API_C( OSStatus )
  688. PMTicketReleaseAndClear(PMTicketRef * ticket);
  689. /*
  690. * PMTicketGetLockedState()
  691. *
  692. * Discussion:
  693. * Tickets may be locked by the printing system, so we provide a
  694. * function to determine if the ticket is indeed locked. Any
  695. * attempted changes to a locked ticket will result in
  696. * "kPMTicketLocked" error.
  697. *
  698. * Availability:
  699. * Non-Carbon CFM: not available
  700. * CarbonLib: not available
  701. * Mac OS X: in version 10.0 and later
  702. */
  703. EXTERN_API_C( OSStatus )
  704. PMTicketGetLockedState(
  705. PMTicketRef ticket,
  706. Boolean * lockedState);
  707. /*
  708. * PMTicketConfirmTicket()
  709. *
  710. * Discussion:
  711. * To confirm that we have a real ticket, this short function gets
  712. * called.
  713. *
  714. * Availability:
  715. * Non-Carbon CFM: not available
  716. * CarbonLib: not available
  717. * Mac OS X: in version 10.0 and later
  718. */
  719. EXTERN_API_C( OSStatus )
  720. PMTicketConfirmTicket(PMTicketRef ticket);
  721. /*
  722. * PMTicketValidate()
  723. *
  724. * Discussion:
  725. * We validate an entire ticket by calling our PMTicketValidate
  726. * function, passing a template which contains constraints for all
  727. * the values in the ticket. Those entries in the ticket that don't
  728. * have constraints will not be checked, so developers can add their
  729. * own custom data. For now we have to verify a single ticket at a
  730. * time. Future updates will allow the caller to confirm an entire
  731. * tree of tickets.
  732. *
  733. * Availability:
  734. * Non-Carbon CFM: not available
  735. * CarbonLib: not available
  736. * Mac OS X: in version 10.0 and later
  737. */
  738. EXTERN_API_C( OSStatus )
  739. PMTicketValidate(
  740. PMTicketRef ticket,
  741. PMTemplateRef verifyingTemplate,
  742. CFArrayRef * invalidItems);
  743. /* A couple of utility functions to find out what type of ticket is references, as well */
  744. /* as access to the allocator function passed in for a ticket. We also provide a function */
  745. /* to check the API version for a ticket, to protect against future conversion problems */
  746. /* from old to new tickets. */
  747. /*
  748. * PMTicketGetType()
  749. *
  750. * Availability:
  751. * Non-Carbon CFM: not available
  752. * CarbonLib: not available
  753. * Mac OS X: in version 10.0 and later
  754. */
  755. EXTERN_API_C( OSStatus )
  756. PMTicketGetType(
  757. PMTicketRef ticket,
  758. CFStringRef * ticketType);
  759. /*
  760. * PMTicketGetEnumType()
  761. *
  762. * Availability:
  763. * Non-Carbon CFM: not available
  764. * CarbonLib: not available
  765. * Mac OS X: in version 10.0 and later
  766. */
  767. EXTERN_API_C( OSStatus )
  768. PMTicketGetEnumType(
  769. PMTicketRef ticket,
  770. PMTicketType * ticketType);
  771. /*
  772. * PMTicketGetAllocator()
  773. *
  774. * Availability:
  775. * Non-Carbon CFM: not available
  776. * CarbonLib: not available
  777. * Mac OS X: in version 10.0 and later
  778. */
  779. EXTERN_API_C( OSStatus )
  780. PMTicketGetAllocator(
  781. PMTicketRef ticket,
  782. CFAllocatorRef * allocator);
  783. /*
  784. * PMTicketGetAPIVersion()
  785. *
  786. * Availability:
  787. * Non-Carbon CFM: not available
  788. * CarbonLib: not available
  789. * Mac OS X: in version 10.0 and later
  790. */
  791. EXTERN_API_C( OSStatus )
  792. PMTicketGetAPIVersion(
  793. PMTicketRef ticket,
  794. CFStringRef * apiVersion);
  795. /* To store a Ticket object it needs to be converted to XML, a serialization that */
  796. /* creates human readable text. If the data is to be written to file anyway, a second */
  797. /* function is provided to go "all the way." */
  798. /*
  799. * PMTicketToXML()
  800. *
  801. * Discussion:
  802. * Convert to XML
  803. *
  804. * Availability:
  805. * Non-Carbon CFM: not available
  806. * CarbonLib: not available
  807. * Mac OS X: in version 10.0 and later
  808. */
  809. EXTERN_API_C( OSStatus )
  810. PMTicketToXML(
  811. PMTicketRef ticket,
  812. CFDataRef * anXMLTicket);
  813. /*
  814. * PMTicketWriteXMLToFile()
  815. *
  816. * Discussion:
  817. * Convert to XML and write to file
  818. *
  819. * Availability:
  820. * Non-Carbon CFM: not available
  821. * CarbonLib: not available
  822. * Mac OS X: in version 10.0 and later
  823. */
  824. EXTERN_API_C( OSStatus )
  825. PMTicketWriteXMLToFile(
  826. PMTicketRef ticket,
  827. const char * path);
  828. /*
  829. * PMTicketWriteXML()
  830. *
  831. * Discussion:
  832. * Convert to XML and write to FILE stream
  833. *
  834. * Availability:
  835. * Non-Carbon CFM: not available
  836. * CarbonLib: not available
  837. * Mac OS X: in version 10.0 and later
  838. */
  839. EXTERN_API_C( OSStatus )
  840. PMTicketWriteXML(
  841. PMTicketRef ticket,
  842. FILE * xmlFile);
  843. /*
  844. * PMXMLToTicket()
  845. *
  846. * Discussion:
  847. * Convert from XML
  848. *
  849. * Availability:
  850. * Non-Carbon CFM: not available
  851. * CarbonLib: not available
  852. * Mac OS X: in version 10.0 and later
  853. */
  854. EXTERN_API_C( OSStatus )
  855. PMXMLToTicket(
  856. CFAllocatorRef allocator,
  857. CFDataRef anXMLTicket,
  858. PMTicketRef * ticket,
  859. CFStringRef * conversionError);
  860. /*
  861. * PMTicketReadXMLFromFile()
  862. *
  863. * Discussion:
  864. * Read from XML file
  865. *
  866. * Availability:
  867. * Non-Carbon CFM: not available
  868. * CarbonLib: not available
  869. * Mac OS X: in version 10.0 and later
  870. */
  871. EXTERN_API_C( OSStatus )
  872. PMTicketReadXMLFromFile(
  873. CFAllocatorRef allocator,
  874. const char * path,
  875. PMTicketRef * ticket,
  876. CFStringRef * errorString);
  877. /* To add an item to a ticket, the "SetItem" call for the specific data type is used whenever */
  878. /* possible. This adds a new item if one doesn't exist and updates a previous item if it */
  879. /* already exists. The "locked" field will determine if subsequent updates are allowed. */
  880. /* Strings: */
  881. /* CFString */
  882. /*
  883. * PMTicketSetCFString()
  884. *
  885. * Availability:
  886. * Non-Carbon CFM: not available
  887. * CarbonLib: not available
  888. * Mac OS X: in version 10.0 and later
  889. */
  890. EXTERN_API_C( OSStatus )
  891. PMTicketSetCFString(
  892. PMTicketRef ticket,
  893. CFStringRef clientID,
  894. CFStringRef key,
  895. CFStringRef item,
  896. Boolean locked);
  897. /* Pascal String */
  898. /*
  899. * PMTicketSetPString()
  900. *
  901. * Availability:
  902. * Non-Carbon CFM: not available
  903. * CarbonLib: not available
  904. * Mac OS X: in version 10.0 and later
  905. */
  906. EXTERN_API_C( OSStatus )
  907. PMTicketSetPString(
  908. PMTicketRef ticket,
  909. CFStringRef clientID,
  910. CFStringRef key,
  911. ConstStringPtr value,
  912. Boolean locked);
  913. /* 'C' String */
  914. /*
  915. * PMTicketSetCString()
  916. *
  917. * Availability:
  918. * Non-Carbon CFM: not available
  919. * CarbonLib: not available
  920. * Mac OS X: in version 10.0 and later
  921. */
  922. EXTERN_API_C( OSStatus )
  923. PMTicketSetCString(
  924. PMTicketRef ticket,
  925. CFStringRef clientID,
  926. CFStringRef key,
  927. const char * value,
  928. Boolean locked);
  929. /* Array of 'C' Strings */
  930. /*
  931. * PMTicketSetCStringArray()
  932. *
  933. * Availability:
  934. * Non-Carbon CFM: not available
  935. * CarbonLib: not available
  936. * Mac OS X: in version 10.0 and later
  937. */
  938. EXTERN_API_C( OSStatus )
  939. PMTicketSetCStringArray(
  940. PMTicketRef ticket,
  941. CFStringRef clientID,
  942. CFStringRef key,
  943. const char ** cStringArray,
  944. UInt32 count,
  945. Boolean locked);
  946. /* Numbers: */
  947. /* CFNumber */
  948. /*
  949. * PMTicketSetCFNumber()
  950. *
  951. * Availability:
  952. * Non-Carbon CFM: not available
  953. * CarbonLib: not available
  954. * Mac OS X: in version 10.0 and later
  955. */
  956. EXTERN_API_C( OSStatus )
  957. PMTicketSetCFNumber(
  958. PMTicketRef ticket,
  959. CFStringRef clientID,
  960. CFStringRef key,
  961. CFNumberRef item,
  962. Boolean locked);
  963. /* SInt32 */
  964. /*
  965. * PMTicketSetSInt32()
  966. *
  967. * Availability:
  968. * Non-Carbon CFM: not available
  969. * CarbonLib: not available
  970. * Mac OS X: in version 10.0 and later
  971. */
  972. EXTERN_API_C( OSStatus )
  973. PMTicketSetSInt32(
  974. PMTicketRef ticket,
  975. CFStringRef clientID,
  976. CFStringRef key,
  977. SInt32 value,
  978. Boolean locked);
  979. /* Array of SInt32 */
  980. /*
  981. * PMTicketSetSInt32Array()
  982. *
  983. * Availability:
  984. * Non-Carbon CFM: not available
  985. * CarbonLib: not available
  986. * Mac OS X: in version 10.0 and later
  987. */
  988. EXTERN_API_C( OSStatus )
  989. PMTicketSetSInt32Array(
  990. PMTicketRef ticket,
  991. CFStringRef clientID,
  992. CFStringRef key,
  993. const SInt32 * sInt32Array,
  994. UInt32 count,
  995. Boolean locked);
  996. /* UInt32 */
  997. /* NOTE: The underlying code uses SInt32s in the CF code, so this function can't set -1 */
  998. /* as the largest unsigned number. Please avoid setting the high bit */
  999. /*
  1000. * PMTicketSetUInt32()
  1001. *
  1002. * Availability:
  1003. * Non-Carbon CFM: not available
  1004. * CarbonLib: not available
  1005. * Mac OS X: in version 10.0 and later
  1006. */
  1007. EXTERN_API_C( OSStatus )
  1008. PMTicketSetUInt32(
  1009. PMTicketRef ticket,
  1010. CFStringRef clientID,
  1011. CFStringRef key,
  1012. UInt32 value,
  1013. Boolean locked);
  1014. /* Array of UInt32 */
  1015. /* NOTE: The underlying code uses SInt32s in the CF code, so this function can't set -1 */
  1016. /* as the largest unsigned number. Please avoid setting the high bit */
  1017. /*
  1018. * PMTicketSetUInt32Array()
  1019. *
  1020. * Availability:
  1021. * Non-Carbon CFM: not available
  1022. * CarbonLib: not available
  1023. * Mac OS X: in version 10.0 and later
  1024. */
  1025. EXTERN_API_C( OSStatus )
  1026. PMTicketSetUInt32Array(
  1027. PMTicketRef ticket,
  1028. CFStringRef clientID,
  1029. CFStringRef key,
  1030. const UInt32 * uInt32Array,
  1031. UInt32 count,
  1032. Boolean locked);
  1033. /* Double */
  1034. /*
  1035. * PMTicketSetDouble()
  1036. *
  1037. * Availability:
  1038. * Non-Carbon CFM: not available
  1039. * CarbonLib: not available
  1040. * Mac OS X: in version 10.0 and later
  1041. */
  1042. EXTERN_API_C( OSStatus )
  1043. PMTicketSetDouble(
  1044. PMTicketRef ticket,
  1045. CFStringRef clientID,
  1046. CFStringRef key,
  1047. double value,
  1048. Boolean locked);
  1049. /* Array of doubles */
  1050. /*
  1051. * PMTicketSetDoubleArray()
  1052. *
  1053. * Availability:
  1054. * Non-Carbon CFM: not available
  1055. * CarbonLib: not available
  1056. * Mac OS X: in version 10.0 and later
  1057. */
  1058. EXTERN_API_C( OSStatus )
  1059. PMTicketSetDoubleArray(
  1060. PMTicketRef ticket,
  1061. CFStringRef clientID,
  1062. CFStringRef key,
  1063. const double * doubleArray,
  1064. UInt32 count,
  1065. Boolean changeable);
  1066. /* PMResolution - Array of 2 Doubles */
  1067. /*
  1068. * PMTicketSetPMResolution()
  1069. *
  1070. * Availability:
  1071. * Non-Carbon CFM: not available
  1072. * CarbonLib: not available
  1073. * Mac OS X: in version 10.0 and later
  1074. */
  1075. EXTERN_API_C( OSStatus )
  1076. PMTicketSetPMResolution(
  1077. PMTicketRef ticket,
  1078. CFStringRef clientID,
  1079. CFStringRef key,
  1080. PMResolution * value,
  1081. Boolean locked);
  1082. /* Array of PMResolution */
  1083. /*
  1084. * PMTicketSetPMResolutionArray()
  1085. *
  1086. * Availability:
  1087. * Non-Carbon CFM: not available
  1088. * CarbonLib: not available
  1089. * Mac OS X: in version 10.0 and later
  1090. */
  1091. EXTERN_API_C( OSStatus )
  1092. PMTicketSetPMResolutionArray(
  1093. PMTicketRef ticket,
  1094. CFStringRef clientID,
  1095. CFStringRef key,
  1096. PMResolution * pmResolutionArray,
  1097. UInt32 count,
  1098. Boolean locked);
  1099. /* PMRect - Array of 4 Doubles */
  1100. /*
  1101. * PMTicketSetPMRect()
  1102. *
  1103. * Availability:
  1104. * Non-Carbon CFM: not available
  1105. * CarbonLib: not available
  1106. * Mac OS X: in version 10.0 and later
  1107. */
  1108. EXTERN_API_C( OSStatus )
  1109. PMTicketSetPMRect(
  1110. PMTicketRef ticket,
  1111. CFStringRef clientID,
  1112. CFStringRef key,
  1113. PMRect * value,
  1114. Boolean locked);
  1115. /* Array of PMRects */
  1116. /*
  1117. * PMTicketSetPMRectArray()
  1118. *
  1119. * Availability:
  1120. * Non-Carbon CFM: not available
  1121. * CarbonLib: not available
  1122. * Mac OS X: in version 10.0 and later
  1123. */
  1124. EXTERN_API_C( OSStatus )
  1125. PMTicketSetPMRectArray(
  1126. PMTicketRef ticket,
  1127. CFStringRef clientID,
  1128. CFStringRef key,
  1129. PMRect * pmRectArray,
  1130. UInt32 count,
  1131. Boolean locked);
  1132. /* Raw Data */
  1133. /* CFData */
  1134. /*
  1135. * PMTicketSetCFData()
  1136. *
  1137. * Availability:
  1138. * Non-Carbon CFM: not available
  1139. * CarbonLib: not available
  1140. * Mac OS X: in version 10.0 and later
  1141. */
  1142. EXTERN_API_C( OSStatus )
  1143. PMTicketSetCFData(
  1144. PMTicketRef ticket,
  1145. CFStringRef clientID,
  1146. CFStringRef key,
  1147. CFDataRef item,
  1148. Boolean locked);
  1149. /* UInt8 - 'C' Bytes */
  1150. /*
  1151. * PMTicketSetBytes()
  1152. *
  1153. * Availability:
  1154. * Non-Carbon CFM: not available
  1155. * CarbonLib: not available
  1156. * Mac OS X: in version 10.0 and later
  1157. */
  1158. EXTERN_API_C( OSStatus )
  1159. PMTicketSetBytes(
  1160. PMTicketRef ticket,
  1161. CFStringRef clientID,
  1162. CFStringRef key,
  1163. const UInt8 * data,
  1164. UInt32 size,
  1165. Boolean locked);
  1166. /* Booleans */
  1167. /* CFBoolean */
  1168. /*
  1169. * PMTicketSetCFBoolean()
  1170. *
  1171. * Availability:
  1172. * Non-Carbon CFM: not available
  1173. * CarbonLib: not available
  1174. * Mac OS X: in version 10.0 and later
  1175. */
  1176. EXTERN_API_C( OSStatus )
  1177. PMTicketSetCFBoolean(
  1178. PMTicketRef ticket,
  1179. CFStringRef clientID,
  1180. CFStringRef key,
  1181. CFBooleanRef item,
  1182. Boolean locked);
  1183. /* 'C' Boolean */
  1184. /*
  1185. * PMTicketSetBoolean()
  1186. *
  1187. * Availability:
  1188. * Non-Carbon CFM: not available
  1189. * CarbonLib: not available
  1190. * Mac OS X: in version 10.0 and later
  1191. */
  1192. EXTERN_API_C( OSStatus )
  1193. PMTicketSetBoolean(
  1194. PMTicketRef ticket,
  1195. CFStringRef clientID,
  1196. CFStringRef key,
  1197. Boolean value,
  1198. Boolean locked);
  1199. /* Dates */
  1200. /*
  1201. * PMTicketSetCFDate()
  1202. *
  1203. * Availability:
  1204. * Non-Carbon CFM: not available
  1205. * CarbonLib: not available
  1206. * Mac OS X: in version 10.0 and later
  1207. */
  1208. EXTERN_API_C( OSStatus )
  1209. PMTicketSetCFDate(
  1210. PMTicketRef ticket,
  1211. CFStringRef clientID,
  1212. CFStringRef key,
  1213. CFDateRef item,
  1214. Boolean locked);
  1215. /* Arrays */
  1216. /*
  1217. * PMTicketSetCFArray()
  1218. *
  1219. * Availability:
  1220. * Non-Carbon CFM: not available
  1221. * CarbonLib: not available
  1222. * Mac OS X: in version 10.0 and later
  1223. */
  1224. EXTERN_API_C( OSStatus )
  1225. PMTicketSetCFArray(
  1226. PMTicketRef ticket,
  1227. CFStringRef clientID,
  1228. CFStringRef key,
  1229. CFArrayRef item,
  1230. Boolean locked);
  1231. /* Dictionaries */
  1232. /*
  1233. * PMTicketSetCFDictionary()
  1234. *
  1235. * Availability:
  1236. * Non-Carbon CFM: not available
  1237. * CarbonLib: not available
  1238. * Mac OS X: in version 10.0 and later
  1239. */
  1240. EXTERN_API_C( OSStatus )
  1241. PMTicketSetCFDictionary(
  1242. PMTicketRef ticket,
  1243. CFStringRef clientID,
  1244. CFStringRef key,
  1245. CFDictionaryRef item,
  1246. Boolean locked);
  1247. /* Templates, which are defined to be opaque. */
  1248. /*
  1249. * PMTicketSetTemplate()
  1250. *
  1251. * Availability:
  1252. * Non-Carbon CFM: not available
  1253. * CarbonLib: not available
  1254. * Mac OS X: in version 10.0 and later
  1255. */
  1256. EXTERN_API_C( OSStatus )
  1257. PMTicketSetTemplate(
  1258. PMTicketRef ticket,
  1259. CFStringRef clientID,
  1260. CFStringRef key,
  1261. PMTemplateRef item,
  1262. Boolean locked);
  1263. /* Generic CF Type */
  1264. /*
  1265. * PMTicketSetItem()
  1266. *
  1267. * Availability:
  1268. * Non-Carbon CFM: not available
  1269. * CarbonLib: not available
  1270. * Mac OS X: in version 10.0 and later
  1271. */
  1272. EXTERN_API_C( OSStatus )
  1273. PMTicketSetItem(
  1274. PMTicketRef ticket,
  1275. CFStringRef clientID,
  1276. CFStringRef key,
  1277. CFTypeRef item,
  1278. Boolean locked);
  1279. /*
  1280. * PMTicketSetMetaItem()
  1281. *
  1282. * Discussion:
  1283. * To add an item that doesn't need to be stored in the XML file,
  1284. * use the PMTicketSetMetaItem() call. It allows simple addition of
  1285. * an item, but that item won't be written to XML when the rest of
  1286. * the ticket is stored. By definition, all meta items are not
  1287. * locked, simply because we have no easy mechanism for keeping
  1288. * track of a locked state for a meta item. Our intent is to allow a
  1289. * caller to add items temporarily to a ticket, perhaps to keep
  1290. * track of the "default" ticket in a list of tickets, or the
  1291. * "current" paper info in a list of papers.
  1292. *
  1293. * Availability:
  1294. * Non-Carbon CFM: not available
  1295. * CarbonLib: not available
  1296. * Mac OS X: in version 10.0 and later
  1297. */
  1298. EXTERN_API_C( OSStatus )
  1299. PMTicketSetMetaItem(
  1300. PMTicketRef ticket,
  1301. CFStringRef key,
  1302. CFTypeRef item);
  1303. /*
  1304. * PMTicketFillFromArray()
  1305. *
  1306. * Discussion:
  1307. * Convert an array of static item structures into entries for a
  1308. * ticket and add them one at a time to the ticket. Could fail part
  1309. * way through.
  1310. *
  1311. * Availability:
  1312. * Non-Carbon CFM: not available
  1313. * CarbonLib: not available
  1314. * Mac OS X: in version 10.0 and later
  1315. */
  1316. EXTERN_API_C( OSStatus )
  1317. PMTicketFillFromArray(
  1318. PMTicketRef ticket,
  1319. CFStringRef clientID,
  1320. const PMTicketItemStruct * items,
  1321. UInt32 itemCount);
  1322. /*
  1323. * PMTicketCopyItem()
  1324. *
  1325. * Discussion:
  1326. * If an item must be copied from one ticket to another, use the
  1327. * "CopyItem" call to make the simple transfer. This will update the
  1328. * recorded date and client ID for the item. The "locked" field will
  1329. * determine if subsequent updates may be made.
  1330. *
  1331. * Availability:
  1332. * Non-Carbon CFM: not available
  1333. * CarbonLib: not available
  1334. * Mac OS X: in version 10.0 and later
  1335. */
  1336. EXTERN_API_C( OSStatus )
  1337. PMTicketCopyItem(
  1338. PMTicketRef sourceTicket,
  1339. PMTicketRef destTicket,
  1340. CFStringRef clientID,
  1341. CFStringRef key,
  1342. Boolean locked);
  1343. /* A couple of functions that will help in managing the "locked" state of any ticket */
  1344. /* item. These functions only work for items directly stored in the current ticket, not */
  1345. /* for items in sub-tickets. */
  1346. /*
  1347. * PMTicketIsItemLocked()
  1348. *
  1349. * Availability:
  1350. * Non-Carbon CFM: not available
  1351. * CarbonLib: not available
  1352. * Mac OS X: in version 10.0 and later
  1353. */
  1354. EXTERN_API_C( OSStatus )
  1355. PMTicketIsItemLocked(
  1356. PMTicketRef ticket,
  1357. CFStringRef key,
  1358. Boolean * locked);
  1359. /*
  1360. * PMTicketLockItem()
  1361. *
  1362. * Availability:
  1363. * Non-Carbon CFM: not available
  1364. * CarbonLib: not available
  1365. * Mac OS X: in version 10.0 and later
  1366. */
  1367. EXTERN_API_C( OSStatus )
  1368. PMTicketLockItem(
  1369. PMTicketRef ticket,
  1370. CFStringRef clientID,
  1371. CFStringRef key);
  1372. /*
  1373. * PMTicketUnlockItem()
  1374. *
  1375. * Availability:
  1376. * Non-Carbon CFM: not available
  1377. * CarbonLib: not available
  1378. * Mac OS X: in version 10.0 and later
  1379. */
  1380. EXTERN_API_C( OSStatus )
  1381. PMTicketUnlockItem(
  1382. PMTicketRef ticket,
  1383. CFStringRef clientID,
  1384. CFStringRef key);
  1385. /*
  1386. * PMTicketDeleteItem()
  1387. *
  1388. * Discussion:
  1389. * Disable an item using PMTicketDelete. Future callers will see
  1390. * "ItemNotFound" errors. This call actually tags a new set of
  1391. * structures to the end of an item's dictionary, in order to keep a
  1392. * history of the item.
  1393. *
  1394. * Availability:
  1395. * Non-Carbon CFM: not available
  1396. * CarbonLib: not available
  1397. * Mac OS X: in version 10.0 and later
  1398. */
  1399. EXTERN_API_C( OSStatus )
  1400. PMTicketDeleteItem(
  1401. PMTicketRef ticket,
  1402. CFStringRef clientID,
  1403. CFStringRef key);
  1404. /*
  1405. * PMTicketReleaseItem()
  1406. *
  1407. * Discussion:
  1408. * Release an item (quite different from delete) when you want it
  1409. * completely removed from the ticket. This can only be done if the
  1410. * item is unlocked.
  1411. *
  1412. * Availability:
  1413. * Non-Carbon CFM: not available
  1414. * CarbonLib: not available
  1415. * Mac OS X: in version 10.0 and later
  1416. */
  1417. EXTERN_API_C( OSStatus )
  1418. PMTicketReleaseItem(
  1419. PMTicketRef ticket,
  1420. CFStringRef key);
  1421. /*
  1422. * PMTicketContainsItem()
  1423. *
  1424. * Discussion:
  1425. * Fetching an item back out of the ticket requires the "GetItem"
  1426. * call for the particular type of data you're fetching. In some
  1427. * cases, the caller doesn't know what type of data is being
  1428. * returned, so we have a generic "GetItem" call, but for all other
  1429. * cases developers are encouraged to use the specific call for the
  1430. * data they need, thus enabling type checking and reducing errors.
  1431. * Returns true if item exists.
  1432. *
  1433. * Availability:
  1434. * Non-Carbon CFM: not available
  1435. * CarbonLib: not available
  1436. * Mac OS X: in version 10.0 and later
  1437. */
  1438. EXTERN_API_C( Boolean )
  1439. PMTicketContainsItem(
  1440. PMTicketRef ticket,
  1441. UInt32 nodeIndex1,
  1442. UInt32 nodeIndex2,
  1443. CFStringRef key);
  1444. /* Strings */
  1445. /* CFString */
  1446. /*
  1447. * PMTicketGetCFString()
  1448. *
  1449. * Availability:
  1450. * Non-Carbon CFM: not available
  1451. * CarbonLib: not available
  1452. * Mac OS X: in version 10.0 and later
  1453. */
  1454. EXTERN_API_C( OSStatus )
  1455. PMTicketGetCFString(
  1456. PMTicketRef ticket,
  1457. UInt32 nodeIndex1,
  1458. UInt32 nodeIndex2,
  1459. CFStringRef key,
  1460. CFStringRef * item);
  1461. /* Pascal String */
  1462. /*
  1463. * PMTicketGetPString()
  1464. *
  1465. * Availability:
  1466. * Non-Carbon CFM: not available
  1467. * CarbonLib: not available
  1468. * Mac OS X: in version 10.0 and later
  1469. */
  1470. EXTERN_API_C( OSStatus )
  1471. PMTicketGetPString(
  1472. PMTicketRef ticket,
  1473. UInt32 nodeIndex1,
  1474. UInt32 nodeIndex2,
  1475. CFStringRef key,
  1476. UInt32 bufferSize,
  1477. CFStringEncoding encoding,
  1478. StringPtr value);
  1479. /* 'C' String */
  1480. /*
  1481. * PMTicketGetCString()
  1482. *
  1483. * Availability:
  1484. * Non-Carbon CFM: not available
  1485. * CarbonLib: not available
  1486. * Mac OS X: in version 10.0 and later
  1487. */
  1488. EXTERN_API_C( OSStatus )
  1489. PMTicketGetCString(
  1490. PMTicketRef ticket,
  1491. UInt32 nodeIndex1,
  1492. UInt32 nodeIndex2,
  1493. CFStringRef key,
  1494. UInt32 bufferSize,
  1495. CFStringEncoding encoding,
  1496. char * value);
  1497. /* Numbers */
  1498. /* CFNumber */
  1499. /*
  1500. * PMTicketGetCFNumber()
  1501. *
  1502. * Availability:
  1503. * Non-Carbon CFM: not available
  1504. * CarbonLib: not available
  1505. * Mac OS X: in version 10.0 and later
  1506. */
  1507. EXTERN_API_C( OSStatus )
  1508. PMTicketGetCFNumber(
  1509. PMTicketRef ticket,
  1510. UInt32 nodeIndex1,
  1511. UInt32 nodeIndex2,
  1512. CFStringRef key,
  1513. CFNumberRef * item);
  1514. /* SInt32 */
  1515. /*
  1516. * PMTicketGetSInt32()
  1517. *
  1518. * Availability:
  1519. * Non-Carbon CFM: not available
  1520. * CarbonLib: not available
  1521. * Mac OS X: in version 10.0 and later
  1522. */
  1523. EXTERN_API_C( OSStatus )
  1524. PMTicketGetSInt32(
  1525. PMTicketRef ticket,
  1526. UInt32 nodeIndex1,
  1527. UInt32 nodeIndex2,
  1528. CFStringRef key,
  1529. SInt32 * value);
  1530. /* UInt32 */
  1531. /*
  1532. * PMTicketGetUInt32()
  1533. *
  1534. * Availability:
  1535. * Non-Carbon CFM: not available
  1536. * CarbonLib: not available
  1537. * Mac OS X: in version 10.0 and later
  1538. */
  1539. EXTERN_API_C( OSStatus )
  1540. PMTicketGetUInt32(
  1541. PMTicketRef ticket,
  1542. UInt32 nodeIndex1,
  1543. UInt32 nodeIndex2,
  1544. CFStringRef key,
  1545. UInt32 * value);
  1546. /* Double */
  1547. /*
  1548. * PMTicketGetDouble()
  1549. *
  1550. * Availability:
  1551. * Non-Carbon CFM: not available
  1552. * CarbonLib: not available
  1553. * Mac OS X: in version 10.0 and later
  1554. */
  1555. EXTERN_API_C( OSStatus )
  1556. PMTicketGetDouble(
  1557. PMTicketRef ticket,
  1558. UInt32 nodeIndex1,
  1559. UInt32 nodeIndex2,
  1560. CFStringRef key,
  1561. double * value);
  1562. /* PMResolution - Array of 2 doubles */
  1563. /*
  1564. * PMTicketGetPMResolution()
  1565. *
  1566. * Availability:
  1567. * Non-Carbon CFM: not available
  1568. * CarbonLib: not available
  1569. * Mac OS X: in version 10.0 and later
  1570. */
  1571. EXTERN_API_C( OSStatus )
  1572. PMTicketGetPMResolution(
  1573. PMTicketRef ticket,
  1574. UInt32 nodeIndex1,
  1575. UInt32 nodeIndex2,
  1576. CFStringRef key,
  1577. PMResolution * res);
  1578. /*
  1579. * PMTicketGetIndexPMResolution()
  1580. *
  1581. * Availability:
  1582. * Non-Carbon CFM: not available
  1583. * CarbonLib: not available
  1584. * Mac OS X: in version 10.0 and later
  1585. */
  1586. EXTERN_API_C( OSStatus )
  1587. PMTicketGetIndexPMResolution(
  1588. PMTicketRef ticket,
  1589. UInt32 nodeIndex1,
  1590. UInt32 nodeIndex2,
  1591. CFStringRef key,
  1592. UInt32 index,
  1593. PMResolution * res);
  1594. /* PMRect - Array of 4 doubles */
  1595. /*
  1596. * PMTicketGetPMRect()
  1597. *
  1598. * Availability:
  1599. * Non-Carbon CFM: not available
  1600. * CarbonLib: not available
  1601. * Mac OS X: in version 10.0 and later
  1602. */
  1603. EXTERN_API_C( OSStatus )
  1604. PMTicketGetPMRect(
  1605. PMTicketRef ticket,
  1606. UInt32 nodeIndex1,
  1607. UInt32 nodeIndex2,
  1608. CFStringRef key,
  1609. PMRect * value);
  1610. /* Raw Data */
  1611. /* CFData */
  1612. /*
  1613. * PMTicketGetCFData()
  1614. *
  1615. * Availability:
  1616. * Non-Carbon CFM: not available
  1617. * CarbonLib: not available
  1618. * Mac OS X: in version 10.0 and later
  1619. */
  1620. EXTERN_API_C( OSStatus )
  1621. PMTicketGetCFData(
  1622. PMTicketRef ticket,
  1623. UInt32 nodeIndex1,
  1624. UInt32 nodeIndex2,
  1625. CFStringRef key,
  1626. CFDataRef * item);
  1627. /* UInt8 - 'C' Bytes */
  1628. /* NOTE: Caller is expected to call twice if size is unknown, passing null for data pointer */
  1629. /* and a valid pointer for the size before allocating space and calling back with both pointers */
  1630. /* set, this time with valid data pointer and valid size pointer pointing to # of bytes requested. */
  1631. /*
  1632. * PMTicketGetBytes()
  1633. *
  1634. * Availability:
  1635. * Non-Carbon CFM: not available
  1636. * CarbonLib: not available
  1637. * Mac OS X: in version 10.0 and later
  1638. */
  1639. EXTERN_API_C( OSStatus )
  1640. PMTicketGetBytes(
  1641. PMTicketRef ticket,
  1642. UInt32 nodeIndex1,
  1643. UInt32 nodeIndex2,
  1644. CFStringRef key,
  1645. UInt8 * data,
  1646. UInt32 * size);
  1647. /* Booleans */
  1648. /* CFBoolean */
  1649. /*
  1650. * PMTicketGetCFBoolean()
  1651. *
  1652. * Availability:
  1653. * Non-Carbon CFM: not available
  1654. * CarbonLib: not available
  1655. * Mac OS X: in version 10.0 and later
  1656. */
  1657. EXTERN_API_C( OSStatus )
  1658. PMTicketGetCFBoolean(
  1659. PMTicketRef ticket,
  1660. UInt32 nodeIndex1,
  1661. UInt32 nodeIndex2,
  1662. CFStringRef key,
  1663. CFBooleanRef * item);
  1664. /* 'C' Boolean */
  1665. /*
  1666. * PMTicketGetBoolean()
  1667. *
  1668. * Availability:
  1669. * Non-Carbon CFM: not available
  1670. * CarbonLib: not available
  1671. * Mac OS X: in version 10.0 and later
  1672. */
  1673. EXTERN_API_C( OSStatus )
  1674. PMTicketGetBoolean(
  1675. PMTicketRef ticket,
  1676. UInt32 nodeIndex1,
  1677. UInt32 nodeIndex2,
  1678. CFStringRef key,
  1679. Boolean * value);
  1680. /* Dates */
  1681. /*
  1682. * PMTicketGetCFDate()
  1683. *
  1684. * Availability:
  1685. * Non-Carbon CFM: not available
  1686. * CarbonLib: not available
  1687. * Mac OS X: in version 10.0 and later
  1688. */
  1689. EXTERN_API_C( OSStatus )
  1690. PMTicketGetCFDate(
  1691. PMTicketRef ticket,
  1692. UInt32 nodeIndex1,
  1693. UInt32 nodeIndex2,
  1694. CFStringRef key,
  1695. CFDateRef * item);
  1696. /* Non-numeric Arrays */
  1697. /*
  1698. * PMTicketGetCFArray()
  1699. *
  1700. * Availability:
  1701. * Non-Carbon CFM: not available
  1702. * CarbonLib: not available
  1703. * Mac OS X: in version 10.0 and later
  1704. */
  1705. EXTERN_API_C( OSStatus )
  1706. PMTicketGetCFArray(
  1707. PMTicketRef ticket,
  1708. UInt32 nodeIndex1,
  1709. UInt32 nodeIndex2,
  1710. CFStringRef key,
  1711. CFArrayRef * item);
  1712. /* Dictionaries */
  1713. /*
  1714. * PMTicketGetCFDictionary()
  1715. *
  1716. * Availability:
  1717. * Non-Carbon CFM: not available
  1718. * CarbonLib: not available
  1719. * Mac OS X: in version 10.0 and later
  1720. */
  1721. EXTERN_API_C( OSStatus )
  1722. PMTicketGetCFDictionary(
  1723. PMTicketRef ticket,
  1724. UInt32 nodeIndex1,
  1725. UInt32 nodeIndex2,
  1726. CFStringRef key,
  1727. CFDictionaryRef * item);
  1728. /* PMTemplates, which are defined to be opaque. */
  1729. /*
  1730. * PMTicketCreateTemplate()
  1731. *
  1732. * Availability:
  1733. * Non-Carbon CFM: not available
  1734. * CarbonLib: not available
  1735. * Mac OS X: in version 10.0 and later
  1736. */
  1737. EXTERN_API_C( OSStatus )
  1738. PMTicketCreateTemplate(
  1739. PMTicketRef ticket,
  1740. UInt32 nodeIndex1,
  1741. UInt32 nodeIndex2,
  1742. CFStringRef key,
  1743. PMTemplateRef * item);
  1744. /* The generic calls for regular items and meta items. See notes on "SetMetaItem" for more details. */
  1745. /*
  1746. * PMTicketGetItem()
  1747. *
  1748. * Availability:
  1749. * Non-Carbon CFM: not available
  1750. * CarbonLib: not available
  1751. * Mac OS X: in version 10.0 and later
  1752. */
  1753. EXTERN_API_C( OSStatus )
  1754. PMTicketGetItem(
  1755. PMTicketRef ticket,
  1756. UInt32 nodeIndex1,
  1757. UInt32 nodeIndex2,
  1758. CFStringRef key,
  1759. CFTypeRef * item);
  1760. /* Meta items don't get saved to XML. */
  1761. /*
  1762. * PMTicketGetMetaItem()
  1763. *
  1764. * Availability:
  1765. * Non-Carbon CFM: not available
  1766. * CarbonLib: not available
  1767. * Mac OS X: in version 10.0 and later
  1768. */
  1769. EXTERN_API_C( OSStatus )
  1770. PMTicketGetMetaItem(
  1771. PMTicketRef ticket,
  1772. CFStringRef key,
  1773. CFTypeRef * item);
  1774. /* Any ticket can contain another ticket, allowing us to store multiple PageFormat tickets */
  1775. /* (one for each page) and multiple Document Info tickets (for multi-document jobs). The following */
  1776. /* functions allow us to put a ticket into another ticket as a sub-ticket, and retreive it */
  1777. /* later on. */
  1778. /*
  1779. * PMTicketSetTicket()
  1780. *
  1781. * Availability:
  1782. * Non-Carbon CFM: not available
  1783. * CarbonLib: not available
  1784. * Mac OS X: in version 10.0 and later
  1785. */
  1786. EXTERN_API_C( OSStatus )
  1787. PMTicketSetTicket(
  1788. PMTicketRef ticket,
  1789. PMTicketRef ticketToAdd,
  1790. UInt32 index);
  1791. /*
  1792. * PMTicketContainsTicket()
  1793. *
  1794. * Availability:
  1795. * Non-Carbon CFM: not available
  1796. * CarbonLib: not available
  1797. * Mac OS X: in version 10.0 and later
  1798. */
  1799. EXTERN_API_C( OSStatus )
  1800. PMTicketContainsTicket(
  1801. PMTicketRef ticket,
  1802. CFStringRef requestedType,
  1803. UInt32 index,
  1804. Boolean * exists);
  1805. /*
  1806. * PMTicketGetTicket()
  1807. *
  1808. * Availability:
  1809. * Non-Carbon CFM: not available
  1810. * CarbonLib: not available
  1811. * Mac OS X: in version 10.0 and later
  1812. */
  1813. EXTERN_API_C( OSStatus )
  1814. PMTicketGetTicket(
  1815. PMTicketRef ticket,
  1816. CFStringRef requestedType,
  1817. UInt32 index,
  1818. PMTicketRef * retreivedTicket);
  1819. /*
  1820. * PMTicketRemoveTicket()
  1821. *
  1822. * Availability:
  1823. * Non-Carbon CFM: not available
  1824. * CarbonLib: not available
  1825. * Mac OS X: in version 10.0 and later
  1826. */
  1827. EXTERN_API_C( OSStatus )
  1828. PMTicketRemoveTicket(
  1829. PMTicketRef ticket,
  1830. CFStringRef typeToRemove,
  1831. UInt32 index);
  1832. /*
  1833. * PMTicketGetPPDDict()
  1834. *
  1835. * Availability:
  1836. * Non-Carbon CFM: not available
  1837. * CarbonLib: not available
  1838. * Mac OS X: in version 10.0 and later
  1839. */
  1840. EXTERN_API_C( OSStatus )
  1841. PMTicketGetPPDDict(
  1842. PMTicketRef ticket,
  1843. UInt32 nodeIndex1,
  1844. UInt32 nodeIndex2,
  1845. CFMutableDictionaryRef * dict);
  1846. #if PRAGMA_STRUCT_ALIGN
  1847. #pragma options align=reset
  1848. #elif PRAGMA_STRUCT_PACKPUSH
  1849. #pragma pack(pop)
  1850. #elif PRAGMA_STRUCT_PACK
  1851. #pragma pack()
  1852. #endif
  1853. #ifdef PRAGMA_IMPORT_OFF
  1854. #pragma import off
  1855. #elif PRAGMA_IMPORT
  1856. #pragma import reset
  1857. #endif
  1858. #ifdef __cplusplus
  1859. }
  1860. #endif