![]() |
TXNFindProcPtr |
||||
Header: | MacTextEditor.h | Carbon status: | Supported | |
typedef OSStatus(* TXNFindProcPtr) ( const TXNMatchTextRecord *matchData, TXNDataType iDataType, TXNMatchOptions iMatchOptions, const void *iSearchTextPtr, TextEncoding encoding, TXNOffset absStartOffset, ByteCount searchTextLength, TXNOffset *oStartMatch, TXNOffset *oEndMatch, Boolean *ofound, UInt32 refCon );
You would declare your function like this if you were to name it MyTXNFindCallback:
OSStatus MyTXNFindCallback ( const TXNMatchTextRecord *matchData, TXNDataType iDataType, TXNMatchOptions iMatchOptions, const void *iSearchTextPtr, TextEncoding encoding, TXNOffset absStartOffset, ByteCount searchTextLength, TXNOffset *oStartMatch, TXNOffset *oEndMatch, Boolean *ofound, UInt32 refCon );
A pointer to a TXNMatchTextRecord structure containing the text to match, the length of that text, and the texts encoding. Pass NULL if you are looking for a graphics, sound, or movie object.
A
A
A pointer to the text you want to search.
A variable of type TextEncoding that specifies the encoding of the text you want to search.
A variable of type TXNOffset. This specifies the offset at which a search should begin. The constant kTXNStartOffset specifies the start of the objects data.
A variable of type ByteCount that specifies the length, in bytes, of the text you want to search.
An unsigned 32-bit integer your application can use as needed.
A pointer to a variable of type TXNOffset. On return, it specifies the absolute offset to the start of the match. It is set to 0xFFFFFFFF if there is no match.
A pointer to a variable of type TXNOffset. On return, it specifies the absolute offset to the end of the match. It is set to 0xFFFFFFFF if there is no match.
A pointer to a Boolean value. On return, ofound is true if a match is found.
A result code.
You pass a pointer to your find callback function as a parameter to the TXNFind function. To provide a pointer to your find callback function, you create a universal procedure pointer (UPP) of type TXNFindUPP, using the NewTXNFindUPP function. You can do so with code like the following:
TXNFindUPP MyTXNFindUPP;
MyTXNFindUPP = NewTXNFindUPP (&MyFindCallback);
If you wish to call your find callback function directly, you can use the InvokeTXNFindUPP function.
When you are finished with your find callback function, you should use the DisposeTXNFindUPP function to dispose of the universal procedure pointer associated with it. However, if you plan to use the same find callback function in subsequent calls to the TXNFind function, you can reuse the same UPP, rather than dispose of it and later create a new UPP.
Supported in Carbon.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)