home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.9 KB | 156 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLTxtPar.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SLTXTPAR_H
- #define SLTXTPAR_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWCHARAC_H
- #include "FWCharac.h"
- #endif
-
- #ifndef SLLOCALE_H
- #include "SLLocale.h"
- #endif
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- // Export or Import functions for CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import on
- #elif defined(FW_ODFLIB)
- #pragma export on
- #endif
-
-
- FW_EXTERN_C_BEGIN
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- struct ODIText;
- struct FW_ODITextParams;
- struct FW_ODITextFunctions;
-
- //========================================================================================
- // Typedefs
- //========================================================================================
-
- typedef void (*FW_TextParams_GetParamsProc)(ODIText *text,
- FW_ODITextParams* params,
- FW_PlatformError *error);
- typedef FW_Boolean (*FW_TextParams_IsCharacterStartProc)(ODIText *text,
- FW_BytePosition knownCharacterStartPosition,
- FW_BytePosition positionToCheck,
- FW_PlatformError *error);
- typedef FW_BytePosition (*FW_TextParams_GetBytePositionProc)(ODIText *text,
- FW_CharacterPosition position,
- FW_PlatformError *error);
- typedef void (*FW_TextParams_SetCapacityProc)(ODIText *text,
- long capacity,
- FW_Boolean deletePrevBuffer,
- FW_PlatformError *error);
- typedef void (*FW_TextParams_SetLengthProc)(ODIText *text,
- long length,
- FW_PlatformError *error);
- typedef void (*FW_TextParams_SetLocaleProc)(ODIText *text,
- FW_Locale locale,
- FW_PlatformError *error);
-
- //========================================================================================
- // STRUCT FW_ODITextParams
- //========================================================================================
-
- struct FW_ODITextParams
- {
- char* fTextStart;
- FW_ByteCount fTextByteLength;
- FW_ByteCount fTextByteCapacity;
- FW_Locale fTextLocale;
- };
-
- //========================================================================================
- // STRUCT FW_ODITextFunctions
- //========================================================================================
-
- struct FW_ODITextFunctions
- {
- FW_TextParams_GetParamsProc fGetParams;
- FW_TextParams_IsCharacterStartProc fIsCharacter;
- FW_TextParams_GetBytePositionProc fGetBytePos;
- FW_TextParams_SetCapacityProc fSetCapacity;
- FW_TextParams_SetLengthProc fSetLength;
- FW_TextParams_SetLocaleProc fSetLocale;
- };
-
- //========================================================================================
- // ODIText Parameter Functions
- //========================================================================================
-
- void FW_TextParams_GetParams(ODIText *text,
- FW_ODITextParams* params,
- FW_PlatformError *error);
- // Given an ODIText, return the parameters for accessing the text data
-
- FW_Boolean FW_TextParams_IsCharacterStart(ODIText *text,
- FW_BytePosition knownCharacterStartPosition,
- FW_BytePosition positionToCheck,
- FW_PlatformError *error);
- // Checks the byte at positionToCheck to see if it starts a character.
- // For efficiency, pass into knownCharacterStartPosition the largest value less than
- // positionToCheck for which it is known that a character starts at that position.
- // If no such value is known, pass in 0 for knownCharacterPosition.
-
- FW_BytePosition FW_TextParams_GetBytePosition(ODIText *text,
- FW_CharacterPosition position,
- FW_PlatformError *error);
- // Given an ODIText and character position, return the byte position
-
- void FW_TextParams_SetCapacity(ODIText *text,
- long capacity,
- FW_Boolean deletePrevBuffer,
- FW_ODITextParams* params,
- FW_PlatformError *error);
- // Ensure the capacity for text bytes is at least capacity, return the new text parameters
-
- void FW_TextParams_SetLength(ODIText *text,
- long length,
- FW_ODITextParams* params,
- FW_PlatformError *error);
- // Update the length field to reflect the new number of text bytes
-
- void FW_TextParams_SetLocale(ODIText *text,
- FW_Locale locale,
- FW_ODITextParams* params,
- FW_PlatformError *error);
- // Modify the locale field to reflect the new locale.
- // Any bytes in the string are NOT reinterpreted; it's up to the caller to only
- // change the locale at acceptable times (such as when the string is empty).
-
-
- FW_EXTERN_C_END
-
- // For CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import off
- #elif defined(FW_ODFLIB)
- #pragma export off
- #endif
-
- #endif
-
-