Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Ticket Services Reference

Framework
ApplicationServices/ApplicationServices.h, Carbon/Carbon.h
Declared in
PMDefinitions.h
PMDefinitionsDeprecated.h
PMTemplate.h
PMTicket.h
PMTicketDeprecated.h

Overview

Ticket Services provides the functions and data types used to communicate printing information (page format and print settings) among the various modules in the printing system. Developers who write printing dialog extensions and printer modules need to use the functions described in this reference and also need to consult the Printing Plug-in Interfaces Reference. Developers who write applications do not need this reference; see the Carbon Printing Manager Reference instead.

Functions by Task

Managing Tickets

Setting Ticket Items

Getting Ticket Items

Managing Templates

Setting Template Items

Getting Template Items

Converting To and From XML

Deprecated Functions

Functions

PMTemplateCreate

Creates a new job template.

OSStatus PMTemplateCreate (
   PMTemplateRef *newTemplate
);

Parameters
newTemplate

On return, points to a job template data structure allocated by the function.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateCreateXML

Converts the data in a job template to data represented as XML.

OSStatus PMTemplateCreateXML (
   PMTemplateRef srcTemplate,
   CFDataRef *xmlData
);

Parameters
srcTemplate

A reference to a job template created by calling the function PMTemplateCreate.

xmlData

On return, points to a reference to an XML representation of the data in the job template specified by the srcTemplate parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateDelete

Deletes an existing job template.

OSStatus PMTemplateDelete (
   PMTemplateRef *oldTemplate
);

Parameters
oldTemplate

On input, a reference to a job template created by calling the function PMTemplateCreate. On return, points to NULL.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetBooleanDefaultValue

Obtains the default value for a job template entry of type Boolean.

OSStatus PMTemplateGetBooleanDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   Boolean *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to the default value for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetCFArrayConstraintValue

Obtains an array of constraint values for a job template entry of type CFArrayRef.

OSStatus PMTemplateGetCFArrayConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   CFArrayRef *constraintValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

constraintValue

On return, a poinrter to a Core Foundation array reference for the constraint values for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetCFDataDefaultValue

Obtains the default value for a job template entry of type CFDataRef.

OSStatus PMTemplateGetCFDataDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   CFDataRef *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to a Core Foundation data reference that specfies the default data for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetCFDefaultValue

Obtains the default value for a job template entry of type CFTypeRef.

OSStatus PMTemplateGetCFDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   CFTypeRef *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to a Core Foundation type reference that specifies the default data for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetCFRangeConstraintValue

Obtains the range of constraint values for a job template entry of type CFTypeRef.

OSStatus PMTemplateGetCFRangeConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   CFTypeRef *min,
   CFTypeRef *max
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

min

On return, points to a Core Foundation type reference that specifies the minimum value to which the template entry specified by the key parameter is constrained.

max

On return, points to a Core Foundation type reference that specifies the maximum value to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetConstraintType

Obtains the constraint type for a job template entry.

OSStatus PMTemplateGetConstraintType (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMConstraintType *constraintType
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data whose constraint type you want to retrieve from the template.

constraintType

On return, points to the constraint type for the data specified by the key parameter. See “Constraint Types” for a list of the constraint types that can be returned.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetDoubleDefaultValue

Obtains the default value for a job template entry of type double.

OSStatus PMTemplateGetDoubleDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   double *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to the default double value for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetDoubleListConstraintValue

Obtains constraint values for a job template entry of type double.

OSStatus PMTemplateGetDoubleListConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   int *listSize,
   double *doubleList
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

listSize

A pointer to the number of items in the array specified by the parameter doubleList.

doubleList

On return, points to an array of double values to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Discussion

You need to call the function PMTemplateGetDoubleListConstraintValue twice. First, call the function to get the number of items in the array specified by the parameter doubleList. You should call the function again after you allocate space for the array.

Availability
Declared In
PMTemplate.h

PMTemplateGetDoubleRangeConstraintValue

Obtains the default range of values for a job template entry of type double.

OSStatus PMTemplateGetDoubleRangeConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   double *min,
   double *max
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

min

On return, points to the minimum value to which the template entry specified by the key parameter is constrained.

max

On return, points to the maximum value to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetDoubleRangeDefaultValue

Obtains the default range values for a job template entry of type double.

OSStatus PMTemplateGetDoubleRangeDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   double *min,
   double *max
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

min

On return, points to the minimum value to which the range is constrained for the template entry specified by the key parameter.

max

On return, points to the maximum value to which the range is constrained for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetDoubleRangesConstraintValue

Obtains a range for the minimum and maximum constraint values for a job template entry that is a range of type double.

OSStatus PMTemplateGetDoubleRangesConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   double *minForMin,
   double *maxForMin,
   double *minForMax,
   double *maxForMax
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

minForMin

On return, points to the minimum value to which the minimum of the range is constrained for the template entry specified by the key parameter.

maxForMin

On return, points to the maximum value to which the minimum of the range is constrained for the template entry specified by the key parameter.

minForMax

On return, points to the minimum value to which the maximum of the range is constrained for the template entry specified by the key parameter.

maxForMax

On return, points to the maximum value to which the maximum of the range is constrained for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetListTicketConstraintValue

Obtains the constraint value for a job template entry that of type PMTicketRef.

OSStatus PMTemplateGetListTicketConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMTicketRef *listTicket
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

listTicket

On return, points to a reference to the list ticket to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetPMRectDefaultValue

Obtains the default value for a job template entry of type PMRect.

OSStatus PMTemplateGetPMRectDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMRect *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to the default PMRect data for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetPMRectListConstraintValue

Obtains constraint values for a job template entry of type PMRect.

OSStatus PMTemplateGetPMRectListConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   int *listSize,
   PMRect *rectList
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

listSize

A pointer to the number of items in the array specified by the parameter rectList.

rectList

On return, points to an array of PMRect values to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Discussion

You need to call the function PMTemplateGetPMRectListConstraintValue twice. First, call the function to get the number of items in the array specified by the parameter rectList. You should call the function again after you allocate space for the array.

Availability
Declared In
PMTemplate.h

PMTemplateGetPMTicketDefaultValue

Obtains the default value for a job template entry of type PMTicket.

OSStatus PMTemplateGetPMTicketDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMTicketRef *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to a reference to the default ticket for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetSInt32DefaultValue

Obtains the default value for a job template entry of type SInt32.

OSStatus PMTemplateGetSInt32DefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   SInt32 *defaultValue
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

defaultValue

On return, points to the default value for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetSInt32ListConstraintValue

Obtains constraint values for a job template entry of type SInt32.

OSStatus PMTemplateGetSInt32ListConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   int *listSize,
   SInt32 *sint32List
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

listSize

On return, points to the number of items in the array specified by the parameter sint32List.

sint32List

On return, points to an array of SInt32 values to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Discussion

You need to call the function PMTemplateGetSInt32ListConstraintValue twice. First, call the function to get the number of items in the array specified by the parameter sint32List. You should call the function again after you allocate space for the array.

Availability
Declared In
PMTemplate.h

PMTemplateGetSInt32RangeConstraintValue

Obtains the default range of values for a job template entry of type SInt32.

OSStatus PMTemplateGetSInt32RangeConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   SInt32 *min,
   SInt32 *max
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

min

On return, points to the minimum value to which the template entry specified by the key parameter is constrained.

max

On return, points to the maximum value to which the template entry specified by the key parameter is constrained.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetSInt32RangeDefaultValue

Obtains the default range values for a job template entry of type SInt32.

OSStatus PMTemplateGetSInt32RangeDefaultValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   SInt32 *min,
   SInt32 *max
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

min

On return, points to the minimum value to which the range is constrained for the template entry specified by the key parameter.

max

On return, points to the maximum value to which the range is constrained for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetSInt32RangesConstraintValue

Obtains a range of constraint values for a job template entry that is a range of type SInt32.

OSStatus PMTemplateGetSInt32RangesConstraintValue (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   SInt32 *minForMin,
   SInt32 *maxForMin,
   SInt32 *minForMax,
   SInt32 *maxForMax
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

minForMin

On return, points to the minimum value to which the minimum of the range is constrained for the template entry specified by the key parameter.

maxForMin

On return, points to the maximum value to which the minimum of the range is constrained for the template entry specified by the key parameter.

minForMax

On return, points to the minimum value to which the maximum of the range is constrained for the template entry specified by the key parameter.

maxForMax

On return, points to the maximum value to which the maximum of the range is constrained for the template entry specified by the key parameter.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateGetValueType

Obtains the data type of a job template entry.

OSStatus PMTemplateGetValueType (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMValueType *valueType
);

Parameters
pmTemplate

A reference to a job template. You can call the function PMSessionGetDataFromSession with the ticket type set to kPDE_PMJobTemplateRef to get a value that you can then cast to a job template reference.

key

A reference to a CFString object that uniquely identifies the data you want to retrieve from the template.

valueType

On return, points to the value type for the template entry specified by the key parameter. See “PMTicketItemType” for a list of values that can be returned.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateIsLocked

Checks to see if a job template is locked.

OSStatus PMTemplateIsLocked (
   PMTemplateRef srcTemplate,
   Boolean *locked
);

Parameters
srcTemplate

A reference to a job template created by calling the function PMTemplateCreate.

locked

On return, points to true if the job template is locked and false if the template is not locked.

Return Value

A result code. See “Ticket Services Result Codes.”

Discussion

A job template cannot be modified unless it is unlocked.

Availability
Declared In
PMTemplate.h

PMTemplateLoadFromXML

Restores a job template that was previously converted to XML.

OSStatus PMTemplateLoadFromXML (
   CFDataRef srcData,
   PMTemplateRef *destTemplate
);

Parameters
srcData

A reference to CFData that represents job template data. You obtain a CFDataRef by calling the function PMTemplateCreateXML.

destTemplate

A reference to a job template created by calling the function PMTemplateCreate. On return, the job template contains the entries specified by the XML data.

Return Value

A result code. See “Ticket Services Result Codes.”

Availability
Declared In
PMTemplate.h

PMTemplateMakeEntry

Creates a new entry in a job template.

OSStatus PMTemplateMakeEntry (
   PMTemplateRef pmTemplate,
   CFStringRef key,
   PMValueType valueType,
   PMConstraintType constraintType
);

Parameters
pmTemplate

A reference to a job template created by calling the function PMTemplateCreate.

key

A reference to a CFString object that uniquely identifies the entry. You use the key to set and obtain the data for this entry.

valueType

The data type of the value associated with the entry. See “PMValueType” for a list of constants you can use to specify the data type.

constraint