Carbon


OpenTextService

Header: TextServices.h Carbon status: Supported

Instructs the Text Services Manager to open a text service component that a user has chosen and to associate it with a TSM document.

OSErr OpenTextService (
    TSMDocumentID idocID, 
    Component aComponent, 
    ComponentInstance *aComponentInstance
);
Parameter descriptions
idocID

The identification number of a TSM document created by a prior call to the NewTSMDocument function.

aComponent

A component identifier for this text service component.

aComponentInstance

Upon completion of the call, contains a pointer to a component instance. This value identifies your application’s connection to a text service component. You must supply this value whenever you call the text service functions provided by the component directly.

function result

A result code.

DISCUSSION

You can obtain the component identifier to pass in aComponent by comparing the menu item name selected by the user with the component item names in the TextServiceList structure obtained by calling GetServiceList.

The Text Services Manager opens the requested component by calling the Component Manager OpenComponent function.

If the specified text service component is already open, the Text Services Manager does not open it again and the tsmComponentAlreadyOpenErr error message is returned as a result code. Whether or not the text service is open, the Text Services Manager calls the functions InitiateTextService and ActivateTextService for the given text service and returns a valid component instance. Upon completion of the OpenTextService call, the selected text service component is initialized and active.

This function is for opening text service components other than input methods. Your application does not need to open or close input methods.

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)