Important: The information in this document is obsolete and should not be used for new development.
NewTSMDocument
TheNewTSMDocumentfunction creates a TSM document and returns a handle to the document's ID.
FUNCTION NewTSMDocument (numOfInterface: Integer; VAR supportedInterfaceTypes: InterfaceTypeList; VAR idocID: TSMDocumentID; refCon: LongInt): OSErr;
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 typeInterfaceTypeListis a simple array of 4-character (OSType) tags.idocID- Upon successful completion of the call, contains the document identification number of the TSM document created.
refCon- A reference constant to store in the TSM document record. It may have any value you wish.
DESCRIPTION
Each time your client application calls theNewTSMDocumentfunction, the Text Services Manager creates an internal record called a TSM document and returns its ID.If the call is successful,
NewTSMDocumentopens the default input method text service component of the current keyboard script and assigns it to this document. IfNewTSMDocumentreturnstsmScriptHasNoIMErr, it has still created a valid TSM document, but has not associated an input method with it.If
NewTSMDocumentfails to create a new TSM document, it returns an error and setsidocIDtoNIL.RESULT CODES
noEr rNo error m emFullErrInsufficient memory to open document tsmUnsupportedTypeErr Supported type was not 'tsvc't smNeverRegisteredErrApplication is not TSM-aware t smScriptHasNoIMErrCurrent script does not use input methods t smCantOpenComponentErrCannot open default input of current script SEE ALSO
For sample code that uses theNewTSMDocumentfunction, see Listing 7-2 on page 7-19.