Important: The information in this document is obsolete and should not be used for new development.
NewTSMDocument
TheNewTSMDocument
function 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 typeInterfaceTypeList
is 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 theNewTSMDocument
function, the Text Services Manager creates an internal record 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. IfNewTSMDocument
returnstsmScriptHasNoIMErr
, it has still created a valid TSM document, but has not associated an input method with it.If
NewTSMDocument
fails to create a new TSM document, it returns an error and setsidocID
toNIL
.RESULT CODES
noEr r
No error m emFullErr
Insufficient memory to open document tsmUnsupportedTypeErr Supported type was not 'tsvc
't smNeverRegisteredErr
Application is not TSM-aware t smScriptHasNoIMErr
Current script does not use input methods t smCantOpenComponentErr
Cannot open default input of current script SEE ALSO
For sample code that uses theNewTSMDocument
function, see Listing 7-2 on page 7-19.