LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
formattedtext.h
Go to the documentation of this file.
1 // Copyright 2015 Trimble Navigation Ltd. All rights reserved.
2 // This file is intended for public distribution.
3
4 #ifndef LAYOUT_MODEL_FORMATTED_TEXT_H_
5 #define LAYOUT_MODEL_FORMATTED_TEXT_H_
6
7 #include <LayOutAPI/common.h>
8 #include <LayOutAPI/geometry/geometry.h>
9 #include <LayOutAPI/model/defs.h>
10
16 #ifdef __cplusplus
17 extern "C" {
18 #endif // __cplusplus
19
25 typedef enum {
26 LOFormattedTextGrowMode_Unbounded =
27 0,
28
29 LOFormattedTextGrowMode_Bounded,
30
31
32
33 LONumFormattedTextGrowModes
34 } LOFormattedTextGrowMode;
35
42 typedef enum {
43 LOFormattedTextAnchorType_TopLeft,
44 LOFormattedTextAnchorType_CenterLeft,
45 LOFormattedTextAnchorType_BottomLeft,
46 LOFormattedTextAnchorType_TopRight,
47 LOFormattedTextAnchorType_CenterRight,
48 LOFormattedTextAnchorType_BottomRight,
49 LOFormattedTextAnchorType_TopCenter,
50 LOFormattedTextAnchorType_CenterCenter,
51 LOFormattedTextAnchorType_BottomCenter,
52 LONumFormattedTextAnchorTypes
53 } LOFormattedTextAnchorType;
54
71 LO_RESULT LOFormattedTextCreateAtPoint(
72 LOFormattedTextRef* text, const LOPoint2D* anchor_point, LOFormattedTextAnchorType anchor_type,
73 const char* plain_text);
74
89 LO_RESULT LOFormattedTextCreateWithBounds(
90 LOFormattedTextRef* text, const LOAxisAlignedRect2D* bounds, const char* plain_text);
91
110 LO_RESULT LOFormattedTextCreateAtPointFromFile(
111 LOFormattedTextRef* text, const LOPoint2D* anchor_point, LOFormattedTextAnchorType anchor_type,
112 const char* path);
113
130 LO_RESULT LOFormattedTextCreateWithBoundsFromFile(
131 LOFormattedTextRef* text, const char* path, const LOAxisAlignedRect2D* bounds);
132
140 LO_RESULT LOFormattedTextAddReference(LOFormattedTextRef text);
141
142 /*
143 @brief Releases a formatted text object. The object will be invalidated if
144 releasing the last reference.
145 @param[in] text The formatted text object.
146 @return
147 - \ref SU_ERROR_NONE on success
148 - \ref SU_ERROR_NULL_POINTER_INPUT if text is NULL
149 - \ref SU_ERROR_INVALID_INPUT if *text does not refer to a valid object
150 */
151 LO_RESULT LOFormattedTextRelease(LOFormattedTextRef* text);
152
162 LO_EXPORT LOFormattedTextRef LOFormattedTextFromEntity(LOEntityRef entity);
163
172 LO_EXPORT LOEntityRef LOFormattedTextToEntity(LOFormattedTextRef text);
173
193 LO_RESULT LOFormattedTextGetRTF(
194 LOFormattedTextRef text, SUStringRef* rtf_text, LOPageRef page_for_autotext);
195
208 LO_RESULT LOFormattedTextSetRTF(LOFormattedTextRef text, const char* rtf_text);
209
230 LO_RESULT LOFormattedTextGetDisplayText(
231 LOFormattedTextRef text, SUStringRef* display_text, LOPageRef page_for_autotext);
232
242 LO_RESULT LOFormattedTextGetPlainTextLength(LOFormattedTextRef text, size_t* length);
243
254 LO_RESULT LOFormattedTextGetPlainText(LOFormattedTextRef text, SUStringRef* plain_text);
255
268 LO_RESULT LOFormattedTextSetPlainText(LOFormattedTextRef text, const char* plain_text);
269
285 LO_RESULT LOFormattedTextSetTextWithStyle(
286 LOFormattedTextRef text, const char* plain_text, LOStyleRef style);
287
303 LO_RESULT LOFormattedTextAppendTextWithStyle(
304 LOFormattedTextRef text, const char* plain_text, LOStyleRef style);
305
320 LO_RESULT LOFormattedTextGetStyleAtCharacter(
321 LOFormattedTextRef text, size_t index, LOStyleRef style);
322
343 LO_RESULT LOFormattedTextGetStyleRunAtCharacter(
344 LOFormattedTextRef text, size_t index, size_t length, LOStyleRef style);
345
367 LO_RESULT LOFormattedTextSetStyleForRange(
368 LOFormattedTextRef text, LOStyleRef style, size_t range_begin, size_t range_length);
369
379 LO_RESULT LOFormattedTextGetGrowMode(LOFormattedTextRef text, LOFormattedTextGrowMode* mode);
380
392 LO_RESULT LOFormattedTextSetGrowMode(LOFormattedTextRef text, LOFormattedTextGrowMode mode);
393
394 #ifdef __cplusplus
395 } // end extern "C"
396 #endif // __cplusplus
397 #endif // LAYOUT_MODEL_FORMATTED_TEXT_H_