Carbon


NewTSMDocument

Header: TextServices.h Carbon status: Supported

Creates a TSM document and returns a handle to the document’s ID.

OSErr NewTSMDocument (
    SInt16 numOfInterface, 
    InterfaceTypeList supportedInterfaceTypes, 
    TSMDocumentID *idocID, 
    SInt32 refcon
);
Parameter descriptions
numOfInterface

The number of supported text service interface types. Currently, this number must be 1.

supportedInterfaceTypes

A list of supported interface types. This list helps the Text Services Manager to locate the text services that have the correct interface type. Currently, the Text Services Manager has defined one interface type: kTextService ( = 'tsvc'). The data type InterfaceTypeList is a simple array of 4-character (OSType) tags.

idocID

Upon successful completion of the call, a pointer to the document identification number of the TSM document created. If NewTSMDocument fails to create a new TSM document, it returns an error and sets idocID to NULL.

refcon

A reference constant to store in the TSM document structure. It may have any value you wish.

function result

A result code.

DISCUSSION

Each time your client application calls the NewTSMDocument function, the Text Services Manager creates an internal structure called a TSM document and returns its ID.

If the call is successful, NewTSMDocument opens the default input method text service component of the current keyboard script and assigns it to this document. If NewTSMDocument returns tsmScriptHasNoIMErr, it has still created a valid TSM document, but has not associated an input method with it.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)