Carbon


SendAEFromTSMComponent

Header: TextServices.h Carbon status: Supported

Sends Apple events from a text service component to a client application.

OSErr SendAEFromTSMComponent (
    const AppleEvent *theAppleEvent, 
    AppleEvent *reply, 
    AESendMode sendMode, 
    AESendPriority sendPriority, 
    SInt32 timeOutInTicks, 
    AEIdleUPP idleProc, 
    AEFilterUPP filterProc
);
Parameter descriptions
theAppleEvent

A pointer to the Apple event to be sent.

reply

A pointer to the reply Apple event returned by SendAEFromTSMComponent.

sendMode

The value that lets you specify one of the following modes specified by corresponding constants: the reply mode for the Apple event, the interaction level, the application switch mode, the reconnection mode, and the return receipt mode. To obtain the value for this parameter, add the appropriate constants. Comprehensive details about these constants are provided in the description of the Apple Event Manager AESend function.

sendPriority

The value that specifies whether to put the Apple event at the back of the event queue (set with the kAENormalPriority flag) or at the front of the queue (kAEHighPriority flag).

timeOutInTicks

The length of time (in ticks) that the client application is willing to wait for the reply or return receipt from the server application before it times out. If the value of this parameter is kNoTimeOut, the Apple event never times out.

idleProc

A pointer to a function for any tasks (such as displaying a globe, a wristwatch, or a spinning beach ball cursor) that the application performs while waiting for a reply or a return receipt.

filterProc

A pointer to a function that accepts certain incoming Apple events that are received while the handler waits for a reply or a return receipt and filters out the rest.

function result

A result code.

DISCUSSION

The SendAEFromTSMComponent function is essentially a wrapper function for the Apple Event Manager function AESend. See the description of AESend for additional necessary information, including constants for the sendMode parameter and result codes.

SendAEFromTSMComponent identifies your text service component from the keyAEServerInstance parameter in the Apple event specified in the theAppleEvent parameter. If a reference constant (refcon) in a TSM document that corresponds to this parameter is found in the internal data structures of the Text Services Manager, SendAEFromTSMComponent adds the reference constant as the keyAETSMDocumentRefcon parameter to the given Apple event before sending it to the application.

If the client application is not TSM-aware, SendAEFromTSMComponent routes the Apple events to the floating input window to allow bottomline input.

If your text service component changes the environment in any way—such as by modifying the A5 world or changing the current zone—while constructing an Apple event, it must restore the previous settings before sending the Apple event.

Your text service component should always use the kCurrentProcess constant as the target address when it creates an Apple event to send to the Text Services Manager.

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)