scriptup 2024.0.4 → 2024.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/ext/attribute_dictionaries.c +1 -1
  3. data/ext/color.c +3 -3
  4. data/ext/component_definition.c +2 -2
  5. data/ext/definition_list.c +1 -1
  6. data/ext/entity.c +4 -3
  7. data/ext/material.c +4 -7
  8. data/ext/utils.h +4 -4
  9. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.dll +0 -0
  10. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.lib +0 -0
  11. data/sketchup-sdk-win/binaries/layout/x64/LayOutControllers.dll +0 -0
  12. data/sketchup-sdk-win/binaries/layout/x64/LayOutModel.dll +0 -0
  13. data/sketchup-sdk-win/binaries/layout/x64/LayOutRTF.dll +0 -0
  14. data/sketchup-sdk-win/binaries/layout/x64/LayOutUtils.dll +0 -0
  15. data/sketchup-sdk-win/binaries/layout/x64/SketchUpCommonPreferences.dll +0 -0
  16. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.dll +0 -0
  17. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.lib +0 -0
  18. data/sketchup-sdk-win/binaries/layout/x64/pdflib.dll +0 -0
  19. data/sketchup-sdk-win/headers/LayOutAPI/application/application.h +117 -0
  20. data/sketchup-sdk-win/headers/LayOutAPI/common.h +22 -0
  21. data/sketchup-sdk-win/headers/LayOutAPI/geometry/geometry.h +78 -0
  22. data/sketchup-sdk-win/headers/LayOutAPI/initialize.h +36 -0
  23. data/sketchup-sdk-win/headers/LayOutAPI/layout.h +49 -0
  24. data/sketchup-sdk-win/headers/LayOutAPI/model/angulardimension.h +468 -0
  25. data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinition.h +569 -0
  26. data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinitionlist.h +79 -0
  27. data/sketchup-sdk-win/headers/LayOutAPI/model/connectionpoint.h +107 -0
  28. data/sketchup-sdk-win/headers/LayOutAPI/model/defs.h +42 -0
  29. data/sketchup-sdk-win/headers/LayOutAPI/model/dictionary.h +120 -0
  30. data/sketchup-sdk-win/headers/LayOutAPI/model/document.h +864 -0
  31. data/sketchup-sdk-win/headers/LayOutAPI/model/documentexportoptions.h +59 -0
  32. data/sketchup-sdk-win/headers/LayOutAPI/model/ellipse.h +78 -0
  33. data/sketchup-sdk-win/headers/LayOutAPI/model/entity.h +330 -0
  34. data/sketchup-sdk-win/headers/LayOutAPI/model/entityiterator.h +49 -0
  35. data/sketchup-sdk-win/headers/LayOutAPI/model/entitylist.h +114 -0
  36. data/sketchup-sdk-win/headers/LayOutAPI/model/formattedtext.h +397 -0
  37. data/sketchup-sdk-win/headers/LayOutAPI/model/grid.h +251 -0
  38. data/sketchup-sdk-win/headers/LayOutAPI/model/group.h +243 -0
  39. data/sketchup-sdk-win/headers/LayOutAPI/model/image.h +146 -0
  40. data/sketchup-sdk-win/headers/LayOutAPI/model/imagerep.h +109 -0
  41. data/sketchup-sdk-win/headers/LayOutAPI/model/label.h +332 -0
  42. data/sketchup-sdk-win/headers/LayOutAPI/model/layer.h +207 -0
  43. data/sketchup-sdk-win/headers/LayOutAPI/model/layerinstance.h +117 -0
  44. data/sketchup-sdk-win/headers/LayOutAPI/model/layerlist.h +69 -0
  45. data/sketchup-sdk-win/headers/LayOutAPI/model/lineardimension.h +456 -0
  46. data/sketchup-sdk-win/headers/LayOutAPI/model/page.h +261 -0
  47. data/sketchup-sdk-win/headers/LayOutAPI/model/pageinfo.h +372 -0
  48. data/sketchup-sdk-win/headers/LayOutAPI/model/pagelist.h +81 -0
  49. data/sketchup-sdk-win/headers/LayOutAPI/model/path.h +464 -0
  50. data/sketchup-sdk-win/headers/LayOutAPI/model/rectangle.h +240 -0
  51. data/sketchup-sdk-win/headers/LayOutAPI/model/referenceentity.h +120 -0
  52. data/sketchup-sdk-win/headers/LayOutAPI/model/sketchupmodel.h +624 -0
  53. data/sketchup-sdk-win/headers/LayOutAPI/model/skpfilereference.h +94 -0
  54. data/sketchup-sdk-win/headers/LayOutAPI/model/style.h +1080 -0
  55. data/sketchup-sdk-win/headers/LayOutAPI/model/table.h +470 -0
  56. data/sketchup-sdk-win/headers/LayOutAPI/model/typed_value.h +156 -0
  57. metadata +50 -2
@@ -0,0 +1,397 @@
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
+
11
+ /**
12
+ @struct LOFormattedTextRef
13
+ @brief References a formatted text entity.
14
+ */
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif // __cplusplus
19
+
20
+ /**
21
+ @enum LOFormattedTextGrowMode
22
+ @brief Defines the different grow modes that are available for formatted text
23
+ entities.
24
+ */
25
+ typedef enum {
26
+ LOFormattedTextGrowMode_Unbounded =
27
+ 0, ///< The text bounds will automatically adjust itself to the size of the current text, and
28
+ ///< lines will not wrap.
29
+ LOFormattedTextGrowMode_Bounded, ///< The text bounds is set explicitly. Lines that go beyond the
30
+ ///< right side of the bounds will wrap, and may not be visible
31
+ ///< if wrapping causes the text to go beyond the bottom of the
32
+ ///< bounds.
33
+ LONumFormattedTextGrowModes
34
+ } LOFormattedTextGrowMode;
35
+
36
+ /**
37
+ @enum LOFormattedTextAnchorType
38
+ @brief Defines the different anchor types for a formatted text entity. The
39
+ anchor type determines the point on a text entity's bounds that an
40
+ anchor point refers to.
41
+ */
42
+ typedef enum {
43
+ LOFormattedTextAnchorType_TopLeft, ///< Top-left corner of the text.
44
+ LOFormattedTextAnchorType_CenterLeft, ///< Center-left side of the text.
45
+ LOFormattedTextAnchorType_BottomLeft, ///< Bottom-left corner of the text.
46
+ LOFormattedTextAnchorType_TopRight, ///< Top-right corner of the text.
47
+ LOFormattedTextAnchorType_CenterRight, ///< Center-right side of the text.
48
+ LOFormattedTextAnchorType_BottomRight, ///< Bottom-right corner of the text.
49
+ LOFormattedTextAnchorType_TopCenter, ///< Top-centered text.
50
+ LOFormattedTextAnchorType_CenterCenter, ///< Centered text.
51
+ LOFormattedTextAnchorType_BottomCenter, ///< Bottom-centered text.
52
+ LONumFormattedTextAnchorTypes
53
+ } LOFormattedTextAnchorType;
54
+
55
+ /**
56
+ @brief Creates a new unbounded text object at the given position.
57
+ @param[out] text The formatted text object.
58
+ @param[in] anchor_point The anchor point for the text object's position.
59
+ @param[in] anchor_type Defines which point of the text object is set by
60
+ anchor_point.
61
+ @param[in] plain_text The plain text to use for the formatted text object.
62
+ @return
63
+ - \ref SU_ERROR_NONE on success
64
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
65
+ - \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
66
+ - \ref SU_ERROR_NULL_POINTER_INPUT if anchor_point is NULL
67
+ - \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
68
+ - \ref SU_ERROR_OUT_OF_RANGE if anchor_type is not a valid value
69
+ - \ref SU_ERROR_GENERIC if plain_text is an empty string
70
+ */
71
+ LO_RESULT LOFormattedTextCreateAtPoint(
72
+ LOFormattedTextRef* text, const LOPoint2D* anchor_point, LOFormattedTextAnchorType anchor_type,
73
+ const char* plain_text);
74
+
75
+ /**
76
+ @brief Creates a new bounded text object with the given bounds.
77
+ @param[out] text The formatted text object.
78
+ @param[in] bounds The text bounds.
79
+ @param[in] plain_text The plain text to use for the formatted text object.
80
+ @return
81
+ - \ref SU_ERROR_NONE on success
82
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
83
+ - \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
84
+ - \ref SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
85
+ - \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
86
+ - \ref SU_ERROR_GENERIC if plain_text is an empty string
87
+ - \ref SU_ERROR_OUT_OF_RANGE if bounds is zero sized
88
+ */
89
+ LO_RESULT LOFormattedTextCreateWithBounds(
90
+ LOFormattedTextRef* text, const LOAxisAlignedRect2D* bounds, const char* plain_text);
91
+
92
+ /**
93
+ @brief Creates a new unbounded text object at the given position whose contents
94
+ are linked to the plain text or RTF file at the given path.
95
+ @param[out] text The formatted text object.
96
+ @param[in] anchor_point The anchor point for the text object's position.
97
+ @param[in] anchor_type Defines which point of the text object is set by
98
+ anchor_point.
99
+ @param[in] path The path to the plain text or RTF file.
100
+ @return
101
+ - \ref SU_ERROR_NONE on success
102
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
103
+ - \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
104
+ - \ref SU_ERROR_NULL_POINTER_INPUT if path is NULL
105
+ - \ref SU_ERROR_NULL_POINTER_INPUT if anchor_point is NULL
106
+ - \ref SU_ERROR_OUT_OF_RANGE if anchor_type is not a valid value
107
+ - \ref SU_ERROR_GENERIC if the file referred to by path is empty
108
+ - \ref SU_ERROR_NO_DATA if the text file could not be found
109
+ */
110
+ LO_RESULT LOFormattedTextCreateAtPointFromFile(
111
+ LOFormattedTextRef* text, const LOPoint2D* anchor_point, LOFormattedTextAnchorType anchor_type,
112
+ const char* path);
113
+
114
+ /**
115
+ @brief Creates a new bounded text object with the given bounds whose
116
+ contents are linked to the plain text or RTF file at the given path.
117
+ @param[out] text The formatted text object.
118
+ @param[in] path The path to the file containing the text to use.
119
+ @param[in] bounds The text bounds.
120
+ @return
121
+ - \ref SU_ERROR_NONE on success
122
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
123
+ - \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
124
+ - \ref SU_ERROR_NULL_POINTER_INPUT if path is NULL
125
+ - \ref SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
126
+ - \ref SU_ERROR_OUT_OF_RANGE if bounds is zero sized
127
+ - \ref SU_ERROR_GENERIC if the text file is empty
128
+ - \ref SU_ERROR_NO_DATA if the text file could not be found
129
+ */
130
+ LO_RESULT LOFormattedTextCreateWithBoundsFromFile(
131
+ LOFormattedTextRef* text, const char* path, const LOAxisAlignedRect2D* bounds);
132
+
133
+ /**
134
+ @brief Adds a reference to a formatted text object.
135
+ @param[in] text The formatted text object.
136
+ @return
137
+ - \ref SU_ERROR_NONE on success
138
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
139
+ */
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
+
153
+ /**
154
+ @brief Converts from a \ref LOEntityRef to a \ref LOFormattedTextRef.
155
+ This is essentially a downcast operation so the given \ref LOEntityRef
156
+ must be convertible to a \ref LOFormattedTextRef.
157
+ @param[in] entity The entity object.
158
+ @return
159
+ - The converted \ref LOFormattedTextRef if the downcast operation succeeds
160
+ - If not, the returned reference will be invalid
161
+ */
162
+ LO_EXPORT LOFormattedTextRef LOFormattedTextFromEntity(LOEntityRef entity);
163
+
164
+ /**
165
+ @brief Converts from a \ref LOFormattedTextRef to a \ref LOEntityRef.
166
+ This is essentially an upcast operation.
167
+ @param[in] text The formatted text object.
168
+ @return
169
+ - The converted \ref LOEntityRef if model is a valid object
170
+ - If not, the returned reference will be invalid
171
+ */
172
+ LO_EXPORT LOEntityRef LOFormattedTextToEntity(LOFormattedTextRef text);
173
+
174
+ /**
175
+ @brief Gets the raw RTF representation of a formatted text object.
176
+ NOTE: Passing an invalid page will prevent an auto-text tag from being
177
+ substituted with its display representation.
178
+ @param[in] text The formatted text object.
179
+ @param[out] rtf_text The RTF text string.
180
+ @param[in] page_for_autotext The page that is currently being imported, exported,
181
+ or displayed. This must be a valid object if
182
+ auto-text tags should be substituted with their
183
+ display representations in the string that is
184
+ returned. Otherwise, this object may be invalid.
185
+ @return
186
+ - \ref SU_ERROR_NONE on success
187
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
188
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if rtf_text is NULL
189
+ - \ref SU_ERROR_INVALID_OUTPUT if *rtf_text does not refer to a valid object
190
+ - \ref SU_ERROR_GENERIC if page_for_autotext refers to a page in a different
191
+ document from rtf_text.
192
+ */
193
+ LO_RESULT LOFormattedTextGetRTF(
194
+ LOFormattedTextRef text, SUStringRef* rtf_text, LOPageRef page_for_autotext);
195
+
196
+ /**
197
+ @brief Sets the raw RTF representation of a formatted text object.
198
+ @param[in] text The formatted text object.
199
+ @param[in] rtf_text The RTF text string.
200
+ @return
201
+ - \ref SU_ERROR_NONE on success
202
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
203
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
204
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
205
+ - \ref SU_ERROR_NULL_POINTER_INPUT if rtf_text is NULL
206
+ - \ref SU_ERROR_GENERIC if rtf_text is an empty string
207
+ */
208
+ LO_RESULT LOFormattedTextSetRTF(LOFormattedTextRef text, const char* rtf_text);
209
+
210
+ /**
211
+ @brief Gets the display text representation of a formatted text object.
212
+ NOTE: Passing an invalid page will prevent an auto-text tag from being
213
+ substituted with its display representation.
214
+ @since LayOut 2018, API 3.0
215
+ @param[in] text The formatted text object.
216
+ @param[out] display_text The plain text representation.
217
+ @param[in] page_for_autotext The page that is currently being imported, exported,
218
+ or displayed. This must be a valid object if
219
+ auto-text tags should be substituted with their
220
+ display representations in the string that is
221
+ returned. Otherwise, this object may be invalid.
222
+ @return
223
+ - \ref SU_ERROR_NONE on success
224
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
225
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if display_text is NULL
226
+ - \ref SU_ERROR_INVALID_OUTPUT if *display_text does not refer to a valid object
227
+ - \ref SU_ERROR_GENERIC if page_for_autotext refers to a page in a different
228
+ document from display_text.
229
+ */
230
+ LO_RESULT LOFormattedTextGetDisplayText(
231
+ LOFormattedTextRef text, SUStringRef* display_text, LOPageRef page_for_autotext);
232
+
233
+ /**
234
+ @brief Gets the length of a formatted text object's plain text representation.
235
+ @param[in] text The formatted text object.
236
+ @param[out] length The length of the plain text representation.
237
+ @return
238
+ - \ref SU_ERROR_NONE on success
239
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
240
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if length is NULL
241
+ */
242
+ LO_RESULT LOFormattedTextGetPlainTextLength(LOFormattedTextRef text, size_t* length);
243
+
244
+ /**
245
+ @brief Gets the plain text representation of a formatted text object.
246
+ @param[in] text The formatted text object.
247
+ @param[out] plain_text The plain text representation.
248
+ @return
249
+ - \ref SU_ERROR_NONE on success
250
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
251
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if plain_text is NULL
252
+ - \ref SU_ERROR_INVALID_OUTPUT if *plain_text does not refer to a valid object
253
+ */
254
+ LO_RESULT LOFormattedTextGetPlainText(LOFormattedTextRef text, SUStringRef* plain_text);
255
+
256
+ /**
257
+ @brief Sets the plain text representation of a formatted text object.
258
+ @param[in] text The formatted text object.
259
+ @param[in] plain_text The plain text representation.
260
+ @return
261
+ - \ref SU_ERROR_NONE on success
262
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
263
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
264
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
265
+ - \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
266
+ - \ref SU_ERROR_GENERIC if plain_text is an empty string
267
+ */
268
+ LO_RESULT LOFormattedTextSetPlainText(LOFormattedTextRef text, const char* plain_text);
269
+
270
+ /**
271
+ @brief Sets the plain text representation of a formatted text object and apply
272
+ the given style to the text.
273
+ @param[in] text The formatted text object.
274
+ @param[in] plain_text The plain text representation.
275
+ @param[in] style The style object.
276
+ @return
277
+ - \ref SU_ERROR_NONE on success
278
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
279
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
280
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
281
+ - \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
282
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
283
+ - \ref SU_ERROR_GENERIC if plain_text is an empty string
284
+ */
285
+ LO_RESULT LOFormattedTextSetTextWithStyle(
286
+ LOFormattedTextRef text, const char* plain_text, LOStyleRef style);
287
+
288
+ /**
289
+ @brief Appends the specified plain text to a formatted text object and apply
290
+ the given style to the appended text.
291
+ @note This method does not support more than two different style runs in a single text string.
292
+ @param[in] text The formatted text object.
293
+ @param[in] plain_text The plain text to append.
294
+ @param[in] style The style object.
295
+ @return
296
+ - \ref SU_ERROR_NONE on success
297
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
298
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
299
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
300
+ - \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
301
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
302
+ */
303
+ LO_RESULT LOFormattedTextAppendTextWithStyle(
304
+ LOFormattedTextRef text, const char* plain_text, LOStyleRef style);
305
+
306
+ /**
307
+ @brief Gets the style of a formatted text object at the specified plain text
308
+ character index.
309
+ @param[in] text The formatted text object.
310
+ @param[in] index The index of the character position to get the style of. Must
311
+ be greater than or equal to 0, and less than the length
312
+ returned by \ref LOFormattedTextGetPlainTextLength.
313
+ @param[out] style The style object.
314
+ @return
315
+ - \ref SU_ERROR_NONE on success
316
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
317
+ - \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
318
+ - \ref SU_ERROR_OUT_OF_RANGE if index is out of range of the plain text length
319
+ */
320
+ LO_RESULT LOFormattedTextGetStyleAtCharacter(
321
+ LOFormattedTextRef text, size_t index, LOStyleRef style);
322
+
323
+ /**
324
+ @brief Gets the style starting at the specified plain text character index, and
325
+ running through length characters.
326
+ @param[in] text The formatted text object.
327
+ @param[in] index The index of the character position to get the style of. Must
328
+ be greater than or equal to 0, and less than the length
329
+ returned by \ref LOFormattedTextGetPlainTextLength.
330
+ @param[in] length The number of characters to get the style of.
331
+ index + length must be less than or equal to the
332
+ length returned by \ref LOFormattedTextGetPlainTextLength.
333
+ @param[out] style The style object.
334
+ @return
335
+ - \ref SU_ERROR_NONE on success
336
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
337
+ - \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
338
+ - \ref SU_ERROR_OUT_OF_RANGE if index is out of range of the plain
339
+ text length
340
+ - \ref SU_ERROR_OUT_OF_RANGE if the range specified by range_begin and
341
+ range_length is invalid for this text.
342
+ */
343
+ LO_RESULT LOFormattedTextGetStyleRunAtCharacter(
344
+ LOFormattedTextRef text, size_t index, size_t length, LOStyleRef style);
345
+
346
+ /**
347
+ @brief Sets the style for a range of characters.
348
+ @param[in] text The formatted text object.
349
+ @param[in] style The style object.
350
+ @param[in] range_begin The index of the first character to change the style
351
+ of. Must be greater than or equal to 0, and less than
352
+ the length returned by
353
+ \ref LOFormattedTextGetPlainTextLength.
354
+ @param[in] range_length The number of characters to apply the style to.
355
+ range_begin + range_length must be less than or equal
356
+ to the length returned by \ref
357
+ LOFormattedTextGetPlainTextLength.
358
+ @return
359
+ - \ref SU_ERROR_NONE on success
360
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
361
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
362
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
363
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
364
+ - \ref SU_ERROR_OUT_OF_RANGE if the range specified by range_begin and
365
+ range_length is invalid for this text.
366
+ */
367
+ LO_RESULT LOFormattedTextSetStyleForRange(
368
+ LOFormattedTextRef text, LOStyleRef style, size_t range_begin, size_t range_length);
369
+
370
+ /**
371
+ @brief Gets the mode for how the text box sizes itself.
372
+ @param[in] text The formatted text object.
373
+ @param[in] mode The mode value.
374
+ @return
375
+ - \ref SU_ERROR_NONE on success
376
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
377
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if mode is NULL
378
+ */
379
+ LO_RESULT LOFormattedTextGetGrowMode(LOFormattedTextRef text, LOFormattedTextGrowMode* mode);
380
+
381
+ /**
382
+ @brief Sets the mode for how the text box sizes itself.
383
+ @param[in] text The formatted text object.
384
+ @param[in] mode The mode value.
385
+ @return
386
+ - \ref SU_ERROR_NONE on success
387
+ - \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
388
+ - \ref SU_ERROR_LAYER_LOCKED if text is on a locked layer
389
+ - \ref SU_ERROR_ENTITY_LOCKED if text is locked
390
+ - \ref SU_ERROR_OUT_OF_RANGE if the value of mode is invalid
391
+ */
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_
@@ -0,0 +1,251 @@
1
+ // Copyright 2015-2020 Trimble Inc. All rights reserved.
2
+ // This file is intended for public distribution.
3
+
4
+ #ifndef LAYOUT_MODEL_GRID_H_
5
+ #define LAYOUT_MODEL_GRID_H_
6
+
7
+ #include <LayOutAPI/common.h>
8
+ #include <LayOutAPI/model/defs.h>
9
+
10
+ #include <SketchUpAPI/color.h>
11
+
12
+ /**
13
+ @struct LOGridRef
14
+ @brief References a document's grid settings.
15
+ */
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif // __cplusplus
20
+
21
+ /**
22
+ @brief Gets the major space size of the grid.
23
+ @param[in] grid The grid object.
24
+ @param[out] spacing The spacing of the major divisions of the grid.
25
+ @return
26
+ - \ref SU_ERROR_NONE on success
27
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
28
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if spacing is NULL
29
+ */
30
+ LO_RESULT LOGridGetMajorSpacing(LOGridRef grid, double* spacing);
31
+
32
+ /**
33
+ @brief Sets the gap between major grid lines for the grid.
34
+ @since LayOut 2020.1, API 5.1
35
+ @param[in] grid The grid object.
36
+ @param[in] spacing The number of minor grid lines to have between major
37
+ grid lines. Must be positive.
38
+ @return
39
+ - \ref SU_ERROR_NONE on success
40
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
41
+ - \ref SU_ERROR_OUT_OF_RANGE if divisions is less than zero
42
+ */
43
+ LO_RESULT LOGridSetMajorSpacing(LOGridRef grid, double spacing);
44
+
45
+ /**
46
+ @brief Gets the number of minor divisions of the grid.
47
+ @param[in] grid The grid object.
48
+ @param[out] divisions The minor division count.
49
+ @return
50
+ - \ref SU_ERROR_NONE on success
51
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
52
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if divisions is NULL
53
+ */
54
+ LO_RESULT LOGridGetMinorDivisions(LOGridRef grid, int* divisions);
55
+
56
+ /**
57
+ @brief Sets the number of minor divisions for the grid.
58
+ @since LayOut 2020.1, API 5.1
59
+ @param[in] grid The grid object.
60
+ @param[in] divisions The number of minor grid lines to have between major
61
+ grid lines. Must not be negative.
62
+ @return
63
+ - \ref SU_ERROR_NONE on success
64
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
65
+ - \ref SU_ERROR_OUT_OF_RANGE if divisions is less than zero
66
+ */
67
+ LO_RESULT LOGridSetMinorDivisions(LOGridRef grid, int divisions);
68
+
69
+ /**
70
+ @brief Gets the color for the major grid lines.
71
+ @param[in] grid The grid object.
72
+ @param[out] color The color of the major grid lines.
73
+ @return
74
+ - \ref SU_ERROR_NONE on success
75
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
76
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
77
+ */
78
+ LO_RESULT LOGridGetMajorColor(LOGridRef grid, SUColor* color);
79
+
80
+ /**
81
+ @brief Sets the color for the major grid lines.
82
+ @since LayOut 2020.1, API 5.1
83
+ @param[in] grid The grid object.
84
+ @param[in] color The new color for the major grid lines.
85
+ @return
86
+ - \ref SU_ERROR_NONE on success
87
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
88
+ */
89
+ LO_RESULT LOGridSetMajorColor(LOGridRef grid, SUColor color);
90
+
91
+ /**
92
+ @brief Gets the color for the minor grid lines.
93
+ @param[in] grid The grid object.
94
+ @param[out] color The color of the minor grid lines.
95
+ @return
96
+ - \ref SU_ERROR_NONE on success
97
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
98
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if color is NULL
99
+ */
100
+ LO_RESULT LOGridGetMinorColor(LOGridRef grid, SUColor* color);
101
+
102
+ /**
103
+ @brief Sets the color for the minor grid lines.
104
+ @since LayOut 2020.1, API 5.1
105
+ @param[in] grid The grid object.
106
+ @param[in] color The new color for the minor grid lines.
107
+ @return
108
+ - \ref SU_ERROR_NONE on success
109
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
110
+ */
111
+ LO_RESULT LOGridSetMinorColor(LOGridRef grid, SUColor color);
112
+
113
+ /**
114
+ @brief Gets whether or not the grid is visible.
115
+ @param[in] grid The grid object.
116
+ @param[out] show Whether or not the grid is visible.
117
+ @return
118
+ - \ref SU_ERROR_NONE on success
119
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
120
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if show is NULL
121
+ */
122
+ LO_RESULT LOGridGetShow(LOGridRef grid, bool* show);
123
+
124
+ /**
125
+ @brief Sets whether or not the grid is visible.
126
+ @since LayOut 2020.1, API 5.1
127
+ @param[in] grid The grid object.
128
+ @param[in] show Whether or not the grid is visible.
129
+ @return
130
+ - \ref SU_ERROR_NONE on success
131
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
132
+ */
133
+ LO_RESULT LOGridSetShow(LOGridRef grid, bool show);
134
+
135
+ /**
136
+ @brief Gets whether or not the major grid lines are visible.
137
+ @param[in] grid The grid object.
138
+ @param[out] show Whether or not the major grid lines are visible.
139
+ @return
140
+ - \ref SU_ERROR_NONE on success
141
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
142
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if show is NULL
143
+ */
144
+ LO_RESULT LOGridGetShowMajor(LOGridRef grid, bool* show);
145
+
146
+ /**
147
+ @brief Sets whether or not the major grid lines are visible.
148
+ @since LayOut 2020.1, API 5.1
149
+ @param[in] grid The grid object.
150
+ @param[in] show Whether or not the major grid lines are visible.
151
+ @return
152
+ - \ref SU_ERROR_NONE on success
153
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
154
+ */
155
+ LO_RESULT LOGridSetShowMajor(LOGridRef grid, bool show);
156
+
157
+ /**
158
+ @brief Gets whether or not the minor grid lines are visible.
159
+ @param[in] grid The grid object.
160
+ @param[out] show Whether or not the minor grid lines are visible.
161
+ @return
162
+ - \ref SU_ERROR_NONE on success
163
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
164
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if show is NULL
165
+ */
166
+ LO_RESULT LOGridGetShowMinor(LOGridRef grid, bool* show);
167
+
168
+ /**
169
+ @brief Sets whether or not the minor grid lines are visible.
170
+ @since LayOut 2020.1, API 5.1
171
+ @param[in] grid The grid object.
172
+ @param[in] show Whether or not the minor grid lines are visible.
173
+ @return
174
+ - \ref SU_ERROR_NONE on success
175
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
176
+ */
177
+ LO_RESULT LOGridSetShowMinor(LOGridRef grid, bool show);
178
+
179
+ /**
180
+ @brief Gets whether or not the grid will be printed.
181
+ @param[in] grid The grid object.
182
+ @param[out] print Whether or not the grid will be printed.
183
+ @return
184
+ - \ref SU_ERROR_NONE on success
185
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
186
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if print is NULL
187
+ */
188
+ LO_RESULT LOGridGetPrint(LOGridRef grid, bool* print);
189
+
190
+ /**
191
+ @brief Sets whether or not the grid is will be printed.
192
+ @since LayOut 2020.1, API 5.1
193
+ @param[in] grid The grid object.
194
+ @param[in] print Whether or not the grid will be printed.
195
+ @return
196
+ - \ref SU_ERROR_NONE on success
197
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
198
+ */
199
+ LO_RESULT LOGridSetPrint(LOGridRef grid, bool print);
200
+
201
+ /**
202
+ @brief Gets whether or not the grid is drawn on top of entities.
203
+ @since LayOut 2020.1, API 5.1
204
+ @param[in] grid The grid object.
205
+ @param[out] in_front Whether or not the grid is on top of entities.
206
+ @return
207
+ - \ref SU_ERROR_NONE on success
208
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
209
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if in_front is NULL
210
+ */
211
+ LO_RESULT LOGridGetInFront(LOGridRef grid, bool* in_front);
212
+
213
+ /**
214
+ @brief Sets whether or not the grid is drawn on top of entities.
215
+ @since LayOut 2020.1, API 5.1
216
+ @param[in] grid The grid object.
217
+ @param[in] in_front Whether or not the grid is on top of entities.
218
+ @return
219
+ - \ref SU_ERROR_NONE on success
220
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
221
+ */
222
+ LO_RESULT LOGridSetInFront(LOGridRef grid, bool in_front);
223
+
224
+ /**
225
+ @brief Gets whether or not the grid is clipped to the paper margins.
226
+ @since LayOut 2020.1, API 5.1
227
+ @param[in] grid The grid object.
228
+ @param[out] clip Whether or not the grid is on top of entities.
229
+ @return
230
+ - \ref SU_ERROR_NONE on success
231
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
232
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if clipped is NULL
233
+ */
234
+ LO_RESULT LOGridGetClipToMargins(LOGridRef grid, bool* clip);
235
+
236
+ /**
237
+ @brief Sets whether or not the grid is clipped to the paper margins.
238
+ @since LayOut 2020.1, API 5.1
239
+ @param[in] grid The grid object.
240
+ @param[in] clip Whether or not the grid is clipped to the paper margins.
241
+ @return
242
+ - \ref SU_ERROR_NONE on success
243
+ - \ref SU_ERROR_INVALID_INPUT if grid does not refer to a valid object
244
+ */
245
+ LO_RESULT LOGridSetClipToMargins(LOGridRef grid, bool clip);
246
+
247
+ #ifdef __cplusplus
248
+ }
249
+ #endif // __cplusplus
250
+
251
+ #endif // LAYOUT_MODEL_GRID_H_