Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 7 - Text Services Manager / Text Services Manager Reference
Text Services Manager Routines for Client Applications / Making Text Services Available to the User


OpenTextService

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

FUNCTION OpenTextService (idocID: TSMDocumentID; 
                          aComponent: Component; 
                          VAR aComponentInstance: 
                          ComponentInstance): OSErr;
idocID
The identification number of a TSM document created by a prior call to the NewTSMDocument function (see page 7-50).
aComponent
A component identifier for this text service component.
aComponentInstance
Upon completion of the call, contains 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.
DESCRIPTION
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 record 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 (see page 7-84) and ActivateTextService (see page 7-85) 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.

Note
This function is for opening text service components other
than input methods. Your application does not need to open or close input methods.
RESULT CODES
noErrNo error
tsmInvalidDocIDErrThe document is not a valid TSM document
tsmComponentAlreadyOpenErrComponent is already open for this document
tsmCantOpenComponentErrComponent doesn't exist or won't open

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996