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


GetServiceList

The GetServiceList function obtains a complete list of text service components of a given kind available to the user of your client application.

FUNCTION GetServiceList (numOfInterfaceTypes: Integer; 
                         supportedInterfaceTypes: 
                         InterfaceTypeList; 
                         VAR serviceInfo: TextServiceListHandle; 
                         VAR seedValue: LongInt): OSErr;
numOfInterfaceTypes
The number of interface types supported by your client application.
supportedInterfaceTypes
A list of the interface types supported by your client application. The data type InterfaceTypeList is a simple list of 4-character (OSType) tags.
serviceInfo
A handle to the text service component list data structure. If the handle is NIL, the Text Services Manager allocates the handle; otherwise, it assumes the handle is a valid text service component list handle, as defined by the TextServiceListHandle data type.
seedValue
A value that indicates whether the list of text service components returned by GetServiceList may have been modified. This value is returned in this parameter after the Text Services Manager calls the Component Manager GetComponentListModSeed function.
DESCRIPTION
When your client application calls GetServiceList, the Text Services Manager locates all the text service components that support the specified interface and text service component types and creates a text service component list, defined by the TextServiceList data type, that contains an entry for each of the text service components.

It is possible to register text service components or withdraw them from registration at any time. Once it has compiled a list of text services, the Text Services Manager invokes the GetComponentListModSeed function and returns the value in the modseed parameter. You can save that value and, the next time you need to draw or regenerate the list of services, call the Component Manager GetComponentListModSeed function. If the seed value differs from the one you received from your last call to GetServiceList, you need to call GetServiceList once more to update the information. Alternatively, you can simply call GetServiceList each time you need to update the list, although that may be less efficient.

GetServiceList uses the text service component information record, defined by the TextServiceInfo data type, and the text service component list record, defined by the TextServiceList data type.

TYPE TextServiceInfo = 
   RECORD
      fComponent: Component;
      fItemName:  Str255;
   END;
   TextServicesInfoPtr = ^TextServiceInfo;
Field Description
fComponent
A component identifier for this text service component. You can use the component identifier in Text Services Manager functions that open or obtain information about a text service component.
itemName
A Pascal string with the name of a text service component. (The script system to use for displaying the string is specified in the componentFlags field of the component description record. See page 7-15.)
TYPE TextServiceList = 
   RECORD
      fTextServiceCount:   Integer;
      fServices:           ARRAY[0..0] of TextServiceInfo;
   END;
   TextServiceListPtr = ^TextServiceList;
   TextServiceListHandle = ^TextServiceListPtr;
Field Description
fTextServiceCount
An integer that provides the number of text service components in the text service component list.
fServices
A variable-length array of text service component information records.
RESULT CODES
noErrNo error
memFullErrInsufficient memory
tsmUnsupportedTypeErrSupported type was not 'tsvc'

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996