LayOut C API
|
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>
Go to the source code of this file.
Enumerations | |
enum | LOFormattedTextGrowMode { LOFormattedTextGrowMode_Unbounded = 0, LOFormattedTextGrowMode_Bounded, LONumFormattedTextGrowModes } |
Defines the different grow modes that are available for formatted text entities. More... | |
enum | LOFormattedTextAnchorType { LOFormattedTextAnchorType_TopLeft, LOFormattedTextAnchorType_CenterLeft, LOFormattedTextAnchorType_BottomLeft, LOFormattedTextAnchorType_TopRight, LOFormattedTextAnchorType_CenterRight, LOFormattedTextAnchorType_BottomRight, LOFormattedTextAnchorType_TopCenter, LOFormattedTextAnchorType_CenterCenter, LOFormattedTextAnchorType_BottomCenter, LONumFormattedTextAnchorTypes } |
Defines the different anchor types for a formatted text entity. The anchor type determines the point on a text entity's bounds that an anchor point refers to. More... | |
Functions | |
LO_RESULT | LOFormattedTextCreateAtPoint (LOFormattedTextRef *text, const LOPoint2D *anchor_point, LOFormattedTextAnchorType anchor_type, const char *plain_text) |
Creates a new unbounded text object at the given position. More... | |
LO_RESULT | LOFormattedTextCreateWithBounds (LOFormattedTextRef *text, const LOAxisAlignedRect2D *bounds, const char *plain_text) |
Creates a new bounded text object with the given bounds. More... | |
LO_RESULT | LOFormattedTextCreateAtPointFromFile (LOFormattedTextRef *text, const LOPoint2D *anchor_point, LOFormattedTextAnchorType anchor_type, const char *path) |
Creates a new unbounded text object at the given position whose contents are linked to the plain text or RTF file at the given path. More... | |
LO_RESULT | LOFormattedTextCreateWithBoundsFromFile (LOFormattedTextRef *text, const char *path, const LOAxisAlignedRect2D *bounds) |
Creates a new bounded text object with the given bounds whose contents are linked to the plain text or RTF file at the given path. More... | |
LO_RESULT | LOFormattedTextAddReference (LOFormattedTextRef text) |
Adds a reference to a formatted text object. More... | |
LO_RESULT | LOFormattedTextRelease (LOFormattedTextRef *text) |
LO_EXPORT LOFormattedTextRef | LOFormattedTextFromEntity (LOEntityRef entity) |
Converts from a LOEntityRef to a LOFormattedTextRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOFormattedTextRef. More... | |
LO_EXPORT LOEntityRef | LOFormattedTextToEntity (LOFormattedTextRef text) |
Converts from a LOFormattedTextRef to a LOEntityRef. This is essentially an upcast operation. More... | |
LO_RESULT | LOFormattedTextGetRTF (LOFormattedTextRef text, SUStringRef *rtf_text, LOPageRef page_for_autotext) |
Gets the raw RTF representation of a formatted text object. NOTE: Passing an invalid page will prevent an auto text tag from being substituted with its display representation. More... | |
LO_RESULT | LOFormattedTextSetRTF (LOFormattedTextRef text, const char *rtf_text) |
Sets the raw RTF representation of a formatted text object. More... | |
LO_RESULT | LOFormattedTextGetDisplayText (LOFormattedTextRef text, SUStringRef *display_text, LOPageRef page_for_autotext) |
Gets the display text representation of a formatted text object. NOTE: Passing an invalid page will prevent an auto text tag from being substituted with its display representation. More... | |
LO_RESULT | LOFormattedTextGetPlainTextLength (LOFormattedTextRef text, size_t *length) |
Gets the length of a formatted text object's plain text representation. More... | |
LO_RESULT | LOFormattedTextGetPlainText (LOFormattedTextRef text, SUStringRef *plain_text) |
Gets the plain text representation of a formatted text object. More... | |
LO_RESULT | LOFormattedTextSetPlainText (LOFormattedTextRef text, const char *plain_text) |
Sets the plain text representation of a formatted text object. More... | |
LO_RESULT | LOFormattedTextSetTextWithStyle (LOFormattedTextRef text, const char *plain_text, LOStyleRef style) |
Sets the plain text representation of a formatted text object and apply the given style to the text. More... | |
LO_RESULT | LOFormattedTextAppendTextWithStyle (LOFormattedTextRef text, const char *plain_text, LOStyleRef style) |
Appends the specified plain text to a formatted text object and apply the given style to the appended text. NOTE: this method does not support more than two different style runs in a single text string. More... | |
LO_RESULT | LOFormattedTextGetStyleAtCharacter (LOFormattedTextRef text, size_t index, LOStyleRef style) |
Gets the style of a formatted text object at the specified plain text character index. More... | |
LO_RESULT | LOFormattedTextGetStyleRunAtCharacter (LOFormattedTextRef text, size_t index, size_t length, LOStyleRef style) |
Gets the style starting at the specified plain text character index, and running through length characters. More... | |
LO_RESULT | LOFormattedTextSetStyleForRange (LOFormattedTextRef text, LOStyleRef style, size_t range_begin, size_t range_length) |
Sets the style for a range of characters. More... | |
LO_RESULT | LOFormattedTextGetGrowMode (LOFormattedTextRef text, LOFormattedTextGrowMode *mode) |
Gets the mode for how the text box sizes itself. More... | |
LO_RESULT | LOFormattedTextSetGrowMode (LOFormattedTextRef text, LOFormattedTextGrowMode mode) |
Sets the mode for how the text box sizes itself. More... | |
Defines the different anchor types for a formatted text entity. The anchor type determines the point on a text entity's bounds that an anchor point refers to.
Defines the different grow modes that are available for formatted text entities.
LO_RESULT LOFormattedTextAddReference | ( | LOFormattedTextRef | text | ) |
Adds a reference to a formatted text object.
[in] | text | The formatted text object. |
LO_RESULT LOFormattedTextAppendTextWithStyle | ( | LOFormattedTextRef | text, |
const char * | plain_text, | ||
LOStyleRef | style | ||
) |
Appends the specified plain text to a formatted text object and apply the given style to the appended text. NOTE: this method does not support more than two different style runs in a single text string.
[in] | text | The formatted text object. |
[in] | plain_text | The plain text to append. |
[in] | style | The style object. |
LO_RESULT LOFormattedTextCreateAtPoint | ( | LOFormattedTextRef * | text, |
const LOPoint2D * | anchor_point, | ||
LOFormattedTextAnchorType | anchor_type, | ||
const char * | plain_text | ||
) |
Creates a new unbounded text object at the given position.
[out] | text | The formatted text object. |
[in] | anchor_point | The anchor point for the text object's position. |
[in] | anchor_type | Defines which point of the text object is set by anchor_point. |
[in] | plain_text | The plain text to use for the formatted text object. |
LO_RESULT LOFormattedTextCreateAtPointFromFile | ( | LOFormattedTextRef * | text, |
const LOPoint2D * | anchor_point, | ||
LOFormattedTextAnchorType | anchor_type, | ||
const char * | path | ||
) |
Creates a new unbounded text object at the given position whose contents are linked to the plain text or RTF file at the given path.
[out] | text | The formatted text object. |
[in] | anchor_point | The anchor point for the text object's position. |
[in] | anchor_type | Defines which point of the text object is set by anchor_point. |
[in] | path | The path to the plain text or RTF file. |
LO_RESULT LOFormattedTextCreateWithBounds | ( | LOFormattedTextRef * | text, |
const LOAxisAlignedRect2D * | bounds, | ||
const char * | plain_text | ||
) |
Creates a new bounded text object with the given bounds.
[out] | text | The formatted text object. |
[in] | bounds | The text bounds. |
[in] | plain_text | The plain text to use for the formatted text object. |
LO_RESULT LOFormattedTextCreateWithBoundsFromFile | ( | LOFormattedTextRef * | text, |
const char * | path, | ||
const LOAxisAlignedRect2D * | bounds | ||
) |
Creates a new bounded text object with the given bounds whose contents are linked to the plain text or RTF file at the given path.
[out] | text | The formatted text object. |
[in] | path | The path to the file containing the text to use. |
[in] | bounds | The text bounds. |
LO_EXPORT LOFormattedTextRef LOFormattedTextFromEntity | ( | LOEntityRef | entity | ) |
Converts from a LOEntityRef to a LOFormattedTextRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOFormattedTextRef.
[in] | entity | The entity object. |
LO_RESULT LOFormattedTextGetDisplayText | ( | LOFormattedTextRef | text, |
SUStringRef * | display_text, | ||
LOPageRef | page_for_autotext | ||
) |
Gets the display text representation of a formatted text object. NOTE: Passing an invalid page will prevent an auto text tag from being substituted with its display representation.
[in] | text | The formatted text object. |
[out] | display_text | The plain text representation. |
[in] | page_for_autotext | The page that is currently being imported, exported, or displayed. This must be a valid object if auto text tags should be substituted with their display representations in the string that is returned. Otherwise, this object may be invalid. |
LO_RESULT LOFormattedTextGetGrowMode | ( | LOFormattedTextRef | text, |
LOFormattedTextGrowMode * | mode | ||
) |
Gets the mode for how the text box sizes itself.
[in] | text | The formatted text object. |
[in] | mode | The mode value. |
LO_RESULT LOFormattedTextGetPlainText | ( | LOFormattedTextRef | text, |
SUStringRef * | plain_text | ||
) |
Gets the plain text representation of a formatted text object.
[in] | text | The formatted text object. |
[out] | plain_text | The plain text representation. |
LO_RESULT LOFormattedTextGetPlainTextLength | ( | LOFormattedTextRef | text, |
size_t * | length | ||
) |
Gets the length of a formatted text object's plain text representation.
[in] | text | The formatted text object. |
[out] | length | The length of the plain text representation. |
LO_RESULT LOFormattedTextGetRTF | ( | LOFormattedTextRef | text, |
SUStringRef * | rtf_text, | ||
LOPageRef | page_for_autotext | ||
) |
Gets the raw RTF representation of a formatted text object. NOTE: Passing an invalid page will prevent an auto text tag from being substituted with its display representation.
[in] | text | The formatted text object. |
[out] | rtf_text | The RTF text string. |
[in] | page_for_autotext | The page that is currently being imported, exported, or displayed. This must be a valid object if auto text tags should be substituted with their display representations in the string that is returned. Otherwise, this object may be invalid. |
LO_RESULT LOFormattedTextGetStyleAtCharacter | ( | LOFormattedTextRef | text, |
size_t | index, | ||
LOStyleRef | style | ||
) |
Gets the style of a formatted text object at the specified plain text character index.
[in] | text | The formatted text object. |
[in] | index | The index of the character position to get the style of. Must be greater than or equal to 0, and less than the length returned by LOFormattedTextGetPlainTextLength. |
[out] | style | The style object. |
LO_RESULT LOFormattedTextGetStyleRunAtCharacter | ( | LOFormattedTextRef | text, |
size_t | index, | ||
size_t | length, | ||
LOStyleRef | style | ||
) |
Gets the style starting at the specified plain text character index, and running through length characters.
[in] | text | The formatted text object. |
[in] | index | The index of the character position to get the style of. Must be greater than or equal to 0, and less than the length returned by LOFormattedTextGetPlainTextLength. |
[in] | length | The number of characters to get the style of. index + length must be less than or equal to the length returned by LOFormattedTextGetPlainTextLength. |
[out] | style | The style object. |
LO_RESULT LOFormattedTextRelease | ( | LOFormattedTextRef * | text | ) |
LO_RESULT LOFormattedTextSetGrowMode | ( | LOFormattedTextRef | text, |
LOFormattedTextGrowMode | mode | ||
) |
Sets the mode for how the text box sizes itself.
[in] | text | The formatted text object. |
[in] | mode | The mode value. |
LO_RESULT LOFormattedTextSetPlainText | ( | LOFormattedTextRef | text, |
const char * | plain_text | ||
) |
Sets the plain text representation of a formatted text object.
[in] | text | The formatted text object. |
[in] | plain_text | The plain text representation. |
LO_RESULT LOFormattedTextSetRTF | ( | LOFormattedTextRef | text, |
const char * | rtf_text | ||
) |
Sets the raw RTF representation of a formatted text object.
[in] | text | The formatted text object. |
[in] | rtf_text | The RTF text string. |
LO_RESULT LOFormattedTextSetStyleForRange | ( | LOFormattedTextRef | text, |
LOStyleRef | style, | ||
size_t | range_begin, | ||
size_t | range_length | ||
) |
Sets the style for a range of characters.
[in] | text | The formatted text object. |
[in] | style | The style object. |
[in] | range_begin | The index of the first character to change the style of. Must be greater than or equal to 0, and less than the length returned by LOFormattedTextGetPlainTextLength. |
[in] | range_length | The number of characters to apply the style to. range_begin + range_length must be less than or equal to the length returned by LOFormattedTextGetPlainTextLength. |
LO_RESULT LOFormattedTextSetTextWithStyle | ( | LOFormattedTextRef | text, |
const char * | plain_text, | ||
LOStyleRef | style | ||
) |
Sets the plain text representation of a formatted text object and apply the given style to the text.
[in] | text | The formatted text object. |
[in] | plain_text | The plain text representation. |
[in] | style | The style object. |
LO_EXPORT LOEntityRef LOFormattedTextToEntity | ( | LOFormattedTextRef | text | ) |
Converts from a LOFormattedTextRef to a LOEntityRef. This is essentially an upcast operation.
[in] | text | The formatted text object. |