Important: The information in this document is obsolete and should not be used for new development.
SendAEFromTSMComponent
TheSendAEFromTSMComponent
function sends Apple events from a text service component to a client application.
FUNCTION SendAEFromTSMComponent (VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LongInt; idleProc: IdleProcPtr; filterProc: EventFilterProcPtr): OSErr;
theAppleEvent
- The Apple event to be sent.
reply
- 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 in Inside Macintosh: Interapplication Communication.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 routine 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.
DESCRIPTION
TheSendAEFromTSMComponent
function is essentially a wrapper routine for the Apple Event Manager functionAESend
. See the description ofAESend
for additional necessary information, including constants for thesendMode
parameter and result codes.
SendAEFromTSMComponent
identifies your text service component from thekeyAEServerInstance
parameter in the Apple event specified in thetheAppleEvent
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 thekeyAETSMDocumentRefcon
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.
- IMPORTANT
- 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.
- Note
- 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.SEE ALSO
TheAESend
function is described with the Apple Event Manager in Inside Macintosh: Interapplication Communication.The
kCurrentProcess
constant is described in Inside Macintosh: Processes.For sample code showing how a text service component calls the
SendAEFromTSMComponent
function, see Listing 7-11 on page 7-45.