scriptup 2024.0.5 → 2024.0.7

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 (58) 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 +8 -3
  7. data/ext/extconf.rb +1 -1
  8. data/ext/material.c +4 -7
  9. data/ext/utils.h +4 -4
  10. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.dll +0 -0
  11. data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.lib +0 -0
  12. data/sketchup-sdk-win/binaries/layout/x64/LayOutControllers.dll +0 -0
  13. data/sketchup-sdk-win/binaries/layout/x64/LayOutModel.dll +0 -0
  14. data/sketchup-sdk-win/binaries/layout/x64/LayOutRTF.dll +0 -0
  15. data/sketchup-sdk-win/binaries/layout/x64/LayOutUtils.dll +0 -0
  16. data/sketchup-sdk-win/binaries/layout/x64/SketchUpCommonPreferences.dll +0 -0
  17. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.dll +0 -0
  18. data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.lib +0 -0
  19. data/sketchup-sdk-win/binaries/layout/x64/pdflib.dll +0 -0
  20. data/sketchup-sdk-win/headers/LayOutAPI/application/application.h +117 -0
  21. data/sketchup-sdk-win/headers/LayOutAPI/common.h +22 -0
  22. data/sketchup-sdk-win/headers/LayOutAPI/geometry/geometry.h +78 -0
  23. data/sketchup-sdk-win/headers/LayOutAPI/initialize.h +36 -0
  24. data/sketchup-sdk-win/headers/LayOutAPI/layout.h +49 -0
  25. data/sketchup-sdk-win/headers/LayOutAPI/model/angulardimension.h +468 -0
  26. data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinition.h +569 -0
  27. data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinitionlist.h +79 -0
  28. data/sketchup-sdk-win/headers/LayOutAPI/model/connectionpoint.h +107 -0
  29. data/sketchup-sdk-win/headers/LayOutAPI/model/defs.h +42 -0
  30. data/sketchup-sdk-win/headers/LayOutAPI/model/dictionary.h +120 -0
  31. data/sketchup-sdk-win/headers/LayOutAPI/model/document.h +864 -0
  32. data/sketchup-sdk-win/headers/LayOutAPI/model/documentexportoptions.h +59 -0
  33. data/sketchup-sdk-win/headers/LayOutAPI/model/ellipse.h +78 -0
  34. data/sketchup-sdk-win/headers/LayOutAPI/model/entity.h +330 -0
  35. data/sketchup-sdk-win/headers/LayOutAPI/model/entityiterator.h +49 -0
  36. data/sketchup-sdk-win/headers/LayOutAPI/model/entitylist.h +114 -0
  37. data/sketchup-sdk-win/headers/LayOutAPI/model/formattedtext.h +397 -0
  38. data/sketchup-sdk-win/headers/LayOutAPI/model/grid.h +251 -0
  39. data/sketchup-sdk-win/headers/LayOutAPI/model/group.h +243 -0
  40. data/sketchup-sdk-win/headers/LayOutAPI/model/image.h +146 -0
  41. data/sketchup-sdk-win/headers/LayOutAPI/model/imagerep.h +109 -0
  42. data/sketchup-sdk-win/headers/LayOutAPI/model/label.h +332 -0
  43. data/sketchup-sdk-win/headers/LayOutAPI/model/layer.h +207 -0
  44. data/sketchup-sdk-win/headers/LayOutAPI/model/layerinstance.h +117 -0
  45. data/sketchup-sdk-win/headers/LayOutAPI/model/layerlist.h +69 -0
  46. data/sketchup-sdk-win/headers/LayOutAPI/model/lineardimension.h +456 -0
  47. data/sketchup-sdk-win/headers/LayOutAPI/model/page.h +261 -0
  48. data/sketchup-sdk-win/headers/LayOutAPI/model/pageinfo.h +372 -0
  49. data/sketchup-sdk-win/headers/LayOutAPI/model/pagelist.h +81 -0
  50. data/sketchup-sdk-win/headers/LayOutAPI/model/path.h +464 -0
  51. data/sketchup-sdk-win/headers/LayOutAPI/model/rectangle.h +240 -0
  52. data/sketchup-sdk-win/headers/LayOutAPI/model/referenceentity.h +120 -0
  53. data/sketchup-sdk-win/headers/LayOutAPI/model/sketchupmodel.h +624 -0
  54. data/sketchup-sdk-win/headers/LayOutAPI/model/skpfilereference.h +94 -0
  55. data/sketchup-sdk-win/headers/LayOutAPI/model/style.h +1080 -0
  56. data/sketchup-sdk-win/headers/LayOutAPI/model/table.h +470 -0
  57. data/sketchup-sdk-win/headers/LayOutAPI/model/typed_value.h +156 -0
  58. metadata +51 -3
@@ -0,0 +1,470 @@
1
+ // Copyright 2016 Trimble Navigation Ltd., All rights reserved.
2
+
3
+ #ifndef LAYOUT_MODEL_TABLE_H_
4
+ #define LAYOUT_MODEL_TABLE_H_
5
+
6
+ #include <LayOutAPI/common.h>
7
+ #include <LayOutAPI/geometry/geometry.h>
8
+ #include <LayOutAPI/model/defs.h>
9
+
10
+ /**
11
+ @struct LOTableRef
12
+ @brief References a table. A table is a series of rows and columns that holds data.
13
+ @since LayOut 2017, API 2.0
14
+ */
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif // __cplusplus
19
+
20
+ /**
21
+ @enum LOTableCellRotation
22
+ @brief Defines the rotation angle for table cells.
23
+ @since LayOut 2017, API 2.0
24
+ */
25
+ typedef enum {
26
+ LOTableCellRotation_0 = 0, ///< No rotation.
27
+ LOTableCellRotation_90, ///< Rotated 90 degrees counter-clockwise.
28
+ LOTableCellRotation_180, ///< Rotated 180 degrees (upside-down).
29
+ LOTableCellRotation_270 ///< Rotated 270 degrees counter-clockwise.
30
+ } LOTableCellRotation;
31
+
32
+ /**
33
+ @brief Creates a table with a specified size, and a specified number of rows and
34
+ columns.
35
+ @since LayOut 2017, API 2.0
36
+ @param[out] table The table object.
37
+ @param[in] bounds The starting dimensions of the table.
38
+ @param[in] rows The number of rows.
39
+ @param[in] columns The number of columns.
40
+ @return
41
+ - \ref SU_ERROR_NONE on success
42
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if table is NULL
43
+ - \ref SU_ERROR_OVERWRITE_VALID if *table already refers to a valid object
44
+ - \ref SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
45
+ - \ref SU_ERROR_OUT_OF_RANGE if bounds has a width or height of zero
46
+ - \ref SU_ERROR_OUT_OF_RANGE if rows is less than 1
47
+ - \ref SU_ERROR_OUT_OF_RANGE if columns is less than 1
48
+ */
49
+ LO_RESULT LOTableCreate(
50
+ LOTableRef* table, const LOAxisAlignedRect2D* bounds, size_t rows, size_t columns);
51
+ /**
52
+ @brief Gets a table from a given entity.
53
+ @since LayOut 2017, API 2.0
54
+ @param[in] entity The entity object.
55
+ @return
56
+ - The converted \ref LOTableRef if the downcast operation succeeds
57
+ - If not, the returned reference will be invalid
58
+ */
59
+ LO_EXPORT LOTableRef LOTableFromEntity(LOEntityRef entity);
60
+
61
+ /**
62
+ @brief Converts from a \ref LOTableRef to a \ref LOEntityRef.
63
+ This is essentially an upcast operation.
64
+ @since LayOut 2017, API 2.0
65
+ @param[in] table The table object.
66
+ @return
67
+ - The converted \ref LOEntityRef if table is a valid object
68
+ - If not, the returned reference will be invalid
69
+ */
70
+ LO_EXPORT LOEntityRef LOTableToEntity(LOTableRef table);
71
+
72
+ /**
73
+ @brief Creates the entities that represent the tabel in its exploded form and
74
+ adds them to a \ref LOEntityListRef. It is NOT necessary to explicitly
75
+ release these entities, since \ref LOEntityListRef itself adds a
76
+ reference to the entities and will release them when they are removed
77
+ from the list or when the list is released.
78
+ @since LayOut 2017, API 2.0
79
+ @param[in] table The table object.
80
+ @param[in] entity_list The entity list object to add the new entities to.
81
+ @return
82
+ - \ref SU_ERROR_NONE on success
83
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
84
+ - \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
85
+ */
86
+ LO_RESULT LOTableGetExplodedEntities(LOTableRef table, LOEntityListRef entity_list);
87
+
88
+ /**
89
+ @brief Releases a table object. The object will be invalidated if releasing the
90
+ last reference.
91
+ @since LayOut 2017, API 2.0
92
+ @param[in] table The table object.
93
+ @return
94
+ - \ref SU_ERROR_NONE on success
95
+ - \ref SU_ERROR_NULL_POINTER_INPUT if table is NULL
96
+ - \ref SU_ERROR_INVALID_INPUT if *table does not refer to a valid object
97
+ */
98
+ LO_RESULT LOTableRelease(LOTableRef* table);
99
+
100
+ /**
101
+ @brief Adds a reference to a table object.
102
+ @since LayOut 2017, API 2.0
103
+ @param[in] table The table object.
104
+ @return
105
+ - \ref SU_ERROR_NONE on success
106
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
107
+ */
108
+ LO_RESULT LOTableAddReference(LOTableRef table);
109
+
110
+ /**
111
+ @brief Gets the number of rows and columns in a table.
112
+ @since LayOut 2017, API 2.0
113
+ @param[in] table The table object.
114
+ @param[out] rows The number of rows.
115
+ @param[out] columns The number of columns.
116
+ @return
117
+ - \ref SU_ERROR_NONE on success
118
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
119
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if rows or columns are NULL
120
+ */
121
+ LO_RESULT LOTableGetDimensions(LOTableRef table, size_t* rows, size_t* columns);
122
+
123
+ /**
124
+ @brief Gets the height of a row, specified by index, in a table.
125
+ @since LayOut 2017, API 2.0
126
+ @param[in] table The table object.
127
+ @param[in] index The index of the row.
128
+ @param[out] height The height of the row.
129
+ @return
130
+ - \ref SU_ERROR_NONE on success
131
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
132
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if height is NULL
133
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
134
+ */
135
+ LO_RESULT LOTableGetRowHeight(LOTableRef table, size_t index, double* height);
136
+
137
+ /**
138
+ @brief Sets the height of a row, specified by index, in a table. There is a
139
+ minimum allowable row height specified by kMinimumRowHeight.
140
+ @since LayOut 2017, API 2.0
141
+ @param[in] table The table object.
142
+ @param[in] index The index of the row.
143
+ @param[out] height The height of the row.
144
+ @return
145
+ - \ref SU_ERROR_NONE on success
146
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
147
+ - \ref SU_ERROR_OUT_OF_RANGE if height is not a valid row height
148
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
149
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
150
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
151
+ */
152
+ LO_RESULT LOTableSetRowHeight(LOTableRef table, size_t index, double height);
153
+
154
+ /**
155
+ @brief Gets the width of a column, specified by index, in a table.
156
+ @since LayOut 2017, API 2.0
157
+ @param[in] table The table object.
158
+ @param[in] index The index of the row.
159
+ @param[out] width The height of the row.
160
+ @return
161
+ - \ref SU_ERROR_NONE on success
162
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
163
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if width is NULL
164
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
165
+ */
166
+ LO_RESULT LOTableGetColumnWidth(LOTableRef table, size_t index, double* width);
167
+ /**
168
+ @brief Sets the width of a column, specified by index, in a table. There is a
169
+ minimum allowable column width specified by kMinimumColumnWidth.
170
+ @since LayOut 2017, API 2.0
171
+ @param[in] table The table object.
172
+ @param[in] index The index of the column.
173
+ @param[out] width The width of the column.
174
+ @return
175
+ - \ref SU_ERROR_NONE on success
176
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
177
+ - \ref SU_ERROR_OUT_OF_RANGE if width is is not a valid column width
178
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
179
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
180
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
181
+ */
182
+ LO_RESULT LOTableSetColumnWidth(LOTableRef table, size_t index, double width);
183
+
184
+ /**
185
+ @brief Inserts a row at the specified index.
186
+ @since LayOut 2017, API 2.0
187
+ @param[in] table The table object.
188
+ @param[in] index The index of the row to be inserted at.
189
+ @return
190
+ - \ref SU_ERROR_NONE on success
191
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
192
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
193
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
194
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
195
+ */
196
+ LO_RESULT LOTableInsertRow(LOTableRef table, size_t index);
197
+
198
+ /**
199
+ @brief Removes a row at the specified index.
200
+ @since LayOut 2017, API 2.0
201
+ @param[in] table The table object.
202
+ @param[in] index The index of the row to be removed.
203
+ @return
204
+ - \ref SU_ERROR_NONE on success
205
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
206
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
207
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
208
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
209
+ */
210
+ LO_RESULT LOTableRemoveRow(LOTableRef table, size_t index);
211
+
212
+ /**
213
+ @brief Inserts a column at the specified index.
214
+ @since LayOut 2017, API 2.0
215
+ @param[in] table The table object.
216
+ @param[in] index The index of the column to be inserted at.
217
+ @return
218
+ - \ref SU_ERROR_NONE on success
219
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
220
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
221
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
222
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
223
+ */
224
+ LO_RESULT LOTableInsertColumn(LOTableRef table, size_t index);
225
+
226
+ /**
227
+ @brief Removes a column at the specified index.
228
+ @since LayOut 2017, API 2.0
229
+ @param[in] table The table object.
230
+ @param[in] index The index of the column to be removed.
231
+ @return
232
+ - \ref SU_ERROR_NONE on success
233
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
234
+ - \ref SU_ERROR_OUT_OF_RANGE if index is not a valid index for table
235
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
236
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
237
+ */
238
+ LO_RESULT LOTableRemoveColumn(LOTableRef table, size_t index);
239
+
240
+ /**
241
+ @brief Creates a copy of the formatted text entity for a table cell at the
242
+ specified row and column. Currently, this will always succeed. However,
243
+ future versions of LayOut may support other types of entities for table
244
+ cells, so you should not assume that this will succeed. If the specified
245
+ row and column is within a merged cell, then a copy of the merged cell's
246
+ text entity will be created.
247
+ @since LayOut 2017, API 2.0
248
+ @param[in] table The table object.
249
+ @param[in] row The cell's row.
250
+ @param[in] column The cell's column.
251
+ @param[out] text A copy of the cell's text entity.
252
+ @return
253
+ - \ref SU_ERROR_NONE on success
254
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
255
+ - \ref SU_ERROR_OUT_OF_RANGE if row or column are out of range for the table
256
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if entity is NULL
257
+ - \ref SU_ERROR_OVERWRITE_VALID if *entity already refers to a valid object
258
+ - \ref SU_ERROR_NO_DATA if the cell entity is not a formatted text entity
259
+ */
260
+ LO_RESULT LOTableCreateCellTextCopy(
261
+ LOTableRef table, size_t row, size_t column, LOFormattedTextRef* text);
262
+
263
+ /**
264
+ @brief Sets the text entity of a table cell from a \ref LOFormattedTextRef
265
+ object. Only the text content and fill style settings will be kept. The
266
+ bounds and other style settings are controlled by the table. If the
267
+ specified row and column is within a merged cell, then the merged cell
268
+ itself will be affected.
269
+ @since LayOut 2017, API 2.0
270
+ @param[in] table The table object.
271
+ @param[in] row The cell's row.
272
+ @param[in] column The cell's column.
273
+ @param[in] text The text object representing the table cell.
274
+ @return
275
+ - \ref SU_ERROR_NONE on success
276
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
277
+ - \ref SU_ERROR_OUT_OF_RANGE if row or column are out of range for the table
278
+ - \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
279
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
280
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
281
+ */
282
+ LO_RESULT LOTableSetCellText(LOTableRef table, size_t row, size_t column, LOFormattedTextRef text);
283
+
284
+ /**
285
+ @brief Gets the style of a table's border.
286
+ @since LayOut 2018, API 3.0
287
+ @param[in] table The table object.
288
+ @param[out] style The style object.
289
+ @return
290
+ - \ref SU_ERROR_NONE on success
291
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
292
+ - \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
293
+ */
294
+ LO_RESULT LOTableGetBorderStyle(LOTableRef table, LOStyleRef style);
295
+
296
+ /**
297
+ @brief Sets the style of a table's border. Only the stroke style setting can be
298
+ set via this method. Other style settings are controlled by the table.
299
+ @since LayOut 2018, API 3.0
300
+ @param[in] table The table object.
301
+ @param[in] style The style object.
302
+ @return
303
+ - \ref SU_ERROR_NONE on success
304
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
305
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
306
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
307
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
308
+ */
309
+ LO_RESULT LOTableSetBorderStyle(LOTableRef table, LOStyleRef style);
310
+
311
+ /**
312
+ @brief Gets the style of a table's inner row edge. The specified row must be
313
+ in the range of 0 to the number of rows minus two.
314
+ @since LayOut 2017, API 2.0
315
+ @param[in] table The table object.
316
+ @param[in] row The row whose edge style to get.
317
+ @param[out] style The style object.
318
+ @return
319
+ - \ref SU_ERROR_NONE on success
320
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
321
+ - \ref SU_ERROR_OUT_OF_RANGE if row is out of range for the table
322
+ - \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
323
+ */
324
+ LO_RESULT LOTableGetRowEdgeStyle(LOTableRef table, size_t row, LOStyleRef style);
325
+
326
+ /**
327
+ @brief Sets the style of a table's inner row edge. The specified row must be
328
+ in the range of 0 to the number of rows minus two. Only the stroke style
329
+ setting can be set via this method. Other style settings are controlled
330
+ by the table.
331
+ @since LayOut 2017, API 2.0
332
+ @param[in] table The table object.
333
+ @param[in] row The row whose edge style to set.
334
+ @param[in] style The style object.
335
+ @return
336
+ - \ref SU_ERROR_NONE on success
337
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
338
+ - \ref SU_ERROR_OUT_OF_RANGE if row is out of range for the table
339
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
340
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
341
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
342
+ */
343
+ LO_RESULT LOTableSetRowEdgeStyle(LOTableRef table, size_t row, LOStyleRef style);
344
+
345
+ /**
346
+ @brief Gets the style of a table's inner column edge. The specified column must
347
+ be in the range of 0 to the number of columns minus two.
348
+ @since LayOut 2017, API 2.0
349
+ @param[in] table The table object.
350
+ @param[in] column The column whose edge style to get.
351
+ @param[out] style The style object.
352
+ @return
353
+ - \ref SU_ERROR_NONE on success
354
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
355
+ - \ref SU_ERROR_OUT_OF_RANGE if column is out of range for the table
356
+ - \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
357
+ */
358
+ LO_RESULT LOTableGetColumnEdgeStyle(LOTableRef table, size_t column, LOStyleRef style);
359
+
360
+ /**
361
+ @brief Sets the style of a table's inner column edge. The specified column must
362
+ be in the range of 0 to the number of rows minus two. Only the stroke
363
+ style setting can be set via this method. Other style settings are
364
+ controlled by the table.
365
+ @since LayOut 2017, API 2.0
366
+ @param[in] table The table object.
367
+ @param[in] column The column whose edge style to set.
368
+ @param[in] style The style object.
369
+ @return
370
+ - \ref SU_ERROR_NONE on success
371
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
372
+ - \ref SU_ERROR_OUT_OF_RANGE if column is out of range for the table
373
+ - \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
374
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
375
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
376
+ */
377
+ LO_RESULT LOTableSetColumnEdgeStyle(LOTableRef table, size_t column, LOStyleRef style);
378
+
379
+ /**
380
+ @brief Gets the row and column span of a table cell. If the values returned by
381
+ both row_span and column_span are equal to 1, then it is a normal,
382
+ non-merged cell. If either of these values are greater than 1, then it
383
+ is a merged cell. If these values are both 0, then it is an unused cell
384
+ that resides within the inner portion of another merged cell.
385
+ @since LayOut 2017, API 2.0
386
+ @param[in] table The table object.
387
+ @param[in] row The row index.
388
+ @param[in] column The column index.
389
+ @param[out] row_span The number of rows that this cell spans.
390
+ @param[out] column_span The number of columns that this cell spans.
391
+ @return
392
+ - \ref SU_ERROR_NONE on success
393
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
394
+ - \ref SU_ERROR_OUT_OF_RANGE if row is out of range for the table
395
+ - \ref SU_ERROR_OUT_OF_RANGE if column is out of range for the table
396
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if row_span is NULL
397
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if column_span is NULL
398
+ */
399
+ LO_RESULT LOTableGetCellSpan(
400
+ LOTableRef table, size_t row, size_t column, size_t* row_span, size_t* column_span);
401
+
402
+ /**
403
+ @brief Merge a range of cells within a table. Only cells which are not already
404
+ merged can be merged.
405
+ @since LayOut 2017, API 2.0
406
+ @param[in] table The table object.
407
+ @param[in] start_row The start row index.
408
+ @param[in] start_column The start column index.
409
+ @param[out] end_row The end row index.
410
+ @param[out] end_column The end column index.
411
+ @return
412
+ - \ref SU_ERROR_NONE on success
413
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
414
+ - \ref SU_ERROR_OUT_OF_RANGE if any of the row or column indices are out of
415
+ range for the table
416
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
417
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
418
+ - \ref SU_ERROR_UNSUPPORTED if the specified range of cells only spans a single
419
+ cell
420
+ - \ref SU_ERROR_UNSUPPORTED if the specified range of cells contains a cell that
421
+ is already merged
422
+ */
423
+ LO_RESULT LOTableMergeCells(
424
+ LOTableRef table, size_t start_row, size_t start_column, size_t end_row, size_t end_column);
425
+
426
+ /**
427
+ @brief Gets the rotation of a table cell.
428
+ @since LayOut 2017, API 2.0
429
+ @param[in] table The table object.
430
+ @param[in] row The cell's row.
431
+ @param[in] column The cell's column.
432
+ @param[out] rotation The cell's rotation.
433
+ @return
434
+ - \ref SU_ERROR_NONE on success
435
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
436
+ - \ref SU_ERROR_OUT_OF_RANGE if row is out of range for the table
437
+ - \ref SU_ERROR_OUT_OF_RANGE if column is out of range for the table
438
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if rotation is NULL
439
+ - \ref SU_ERROR_NO_DATA if the specific cell is invalid due to residing within
440
+ a merged cell
441
+ */
442
+ LO_RESULT LOTableGetCellRotation(
443
+ LOTableRef table, size_t row, size_t column, LOTableCellRotation* rotation);
444
+
445
+ /**
446
+ @brief Sets the rotation of a table cell.
447
+ @since LayOut 2017, API 2.0
448
+ @param[in] table The table object.
449
+ @param[in] row The cell's row.
450
+ @param[in] column The cell's column.
451
+ @param[out] rotation The cell's rotation.
452
+ @return
453
+ - \ref SU_ERROR_NONE on success
454
+ - \ref SU_ERROR_INVALID_INPUT if table does not refer to a valid object
455
+ - \ref SU_ERROR_OUT_OF_RANGE if row is out of range for the table
456
+ - \ref SU_ERROR_OUT_OF_RANGE if column is out of range for the table
457
+ - \ref SU_ERROR_OUT_OF_RANGE if rotation is invalid
458
+ - \ref SU_ERROR_LAYER_LOCKED if the table is on a locked layer
459
+ - \ref SU_ERROR_ENTITY_LOCKED if table is locked
460
+ - \ref SU_ERROR_UNSUPPORTED if the specific cell is invalid due to residing
461
+ within a merged cell
462
+ */
463
+ LO_RESULT LOTableSetCellRotation(
464
+ LOTableRef table, size_t row, size_t column, LOTableCellRotation rotation);
465
+
466
+ #ifdef __cplusplus
467
+ } // end extern "C"
468
+ #endif // __cplusplus
469
+
470
+ #endif // LAYOUT_MODEL_TABLE_H_
@@ -0,0 +1,156 @@
1
+ // Copyright 2015 Trimble Navigation Ltd. All rights reserved.
2
+ // This file is intended for public distribution.
3
+
4
+ #ifndef LAYOUT_MODEL_TYPED_VALUE_H_
5
+ #define LAYOUT_MODEL_TYPED_VALUE_H_
6
+
7
+ #include <LayOutAPI/common.h>
8
+ #include <LayOutAPI/model/defs.h>
9
+
10
+ /**
11
+ @struct LOTypedValueRef
12
+ @brief References a variant object used to represent a value of an arbitrary
13
+ type.
14
+ */
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif // __cplusplus
19
+
20
+ /**
21
+ @enum LOTypedValueType
22
+ @brief Defines the set of types that a \ref LOTypedValueRef can represent.
23
+ */
24
+ typedef enum {
25
+ LOTypedValueType_Empty = 0,
26
+ LOTypedValueType_Bool,
27
+ LOTypedValueType_Int32,
28
+ LOTypedValueType_Double,
29
+ LOTypedValueType_String,
30
+ LONumTypedValueTypes
31
+ } LOTypedValueType;
32
+
33
+ /**
34
+ @brief Creates a new typed value object.
35
+ @param[out] typed_value The created typed value object.
36
+ @return
37
+ - \ref SU_ERROR_NONE on success
38
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if typed_value is NULL
39
+ - \ref SU_ERROR_OVERWRITE_VALID if *typed_value already refers to a valid object
40
+ */
41
+ LO_RESULT LOTypedValueCreate(LOTypedValueRef* typed_value);
42
+
43
+ /**
44
+ @brief Releases a typed value object. *typed_value will be set to invalid by
45
+ this function.
46
+ @param[in] typed_value The typed value object.
47
+ @return
48
+ - \ref SU_ERROR_NONE on success
49
+ - \ref SU_ERROR_NULL_POINTER_INPUT if typed_value is NULL
50
+ - \ref SU_ERROR_INVALID_INPUT if *typed_value references an invalid object
51
+ */
52
+ LO_RESULT LOTypedValueRelease(LOTypedValueRef* typed_value);
53
+
54
+ /**
55
+ @brief Gets the type of value stored by a typed value object.
56
+ @param[in] typed_value The typed value object.
57
+ @param[out] type The type of value stored by typed_value.
58
+ @return
59
+ - \ref SU_ERROR_NONE on success
60
+ - \ref SU_ERROR_INVALID_INPUT if type_value is not a valid object
61
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if type is NULL
62
+ */
63
+ LO_RESULT LOTypedValueGetType(LOTypedValueRef typed_value, LOTypedValueType* type);
64
+
65
+ /**
66
+ @brief Gets the boolean value of a typed value object.
67
+ @param[in] typed_value The typed value object.
68
+ @param[out] bool_value The boolean value.
69
+ @return
70
+ - \ref SU_ERROR_NONE on success
71
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
72
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if bool_value is NULL
73
+ - \ref SU_ERROR_NO_DATA if typed_value is not of the requested type
74
+ */
75
+ LO_RESULT LOTypedValueGetBool(LOTypedValueRef typed_value, bool* bool_value);
76
+
77
+ /**
78
+ @brief Sets the boolean value of a typed value object.
79
+ @param[in] typed_value The typed value object.
80
+ @param[in] bool_value The boolean value to set.
81
+ @return
82
+ - \ref SU_ERROR_NONE on success
83
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
84
+ */
85
+ LO_RESULT LOTypedValueSetBool(LOTypedValueRef typed_value, bool bool_value);
86
+
87
+ /**
88
+ @brief Gets the int32 value of a typed value object.
89
+ @param[in] typed_value The typed value object.
90
+ @param[out] int32_value The int32 value.
91
+ @return
92
+ - \ref SU_ERROR_NONE on success
93
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
94
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if int32_value is NULL
95
+ - \ref SU_ERROR_NO_DATA if typed_value is not of the requested type
96
+ */
97
+ LO_RESULT LOTypedValueGetInt32(LOTypedValueRef typed_value, int32_t* int32_value);
98
+
99
+ /**
100
+ @brief Sets the int32 value of a typed value object.
101
+ @param[in] typed_value The typed value object.
102
+ @param[in] int32_value The int32 value to set.
103
+ @return
104
+ - \ref SU_ERROR_NONE on success
105
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
106
+ */
107
+ LO_RESULT LOTypedValueSetInt32(LOTypedValueRef typed_value, int32_t int32_value);
108
+
109
+ /**
110
+ @brief Gets the double value of a typed value object.
111
+ @param[in] typed_value The typed value object.
112
+ @param[out] double_value The double value.
113
+ @return
114
+ - \ref SU_ERROR_NONE on success
115
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
116
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if double_value is NULL
117
+ - \ref SU_ERROR_NO_DATA if typed_value is not of the requested type
118
+ */
119
+ LO_RESULT LOTypedValueGetDouble(LOTypedValueRef typed_value, double* double_value);
120
+
121
+ /**
122
+ @brief Sets the double value of a typed value object.
123
+ @param[in] typed_value The typed value object.
124
+ @param[in] double_value The double value to set.
125
+ @return
126
+ - \ref SU_ERROR_NONE on success
127
+ - \ref SU_ERROR_INVALID_INPUT if typed_value is not a valid object
128
+ */
129
+ LO_RESULT LOTypedValueSetDouble(LOTypedValueRef typed_value, double double_value);
130
+
131
+ /**
132
+ @brief Gets a string value from the typed value object.
133
+ @since LayOut 2018, API 3.0
134
+ @return
135
+ - \ref SU_ERROR_NONE on success
136
+ - \ref SU_ERROR_INVALID_INPUT if typed_value does not refer to a valid object
137
+ - \ref SU_ERROR_NO_DATA if the typed value does not contain a string.
138
+ - \ref SU_ERROR_NULL_POINTER_OUTPUT if out_string is NULL
139
+ - \ref SU_ERROR_INVALID_OUTPUT if out_string does not refer to a valid object
140
+ */
141
+ LO_RESULT LOTypedValueGetString(LOTypedValueRef typed_value, SUStringRef* out_string);
142
+
143
+ /**
144
+ @brief Sets the value of typed_value to the given string.
145
+ @since LayOut 2018, API 3.0
146
+ @return
147
+ - \ref SU_ERROR_NONE on success
148
+ - \ref SU_ERROR_NULL_POINTER_INPUT if string is NULL
149
+ */
150
+ LO_RESULT LOTypedValueSetString(LOTypedValueRef typed_value, const char* string);
151
+
152
+ #ifdef __cplusplus
153
+ } // end extern "C"
154
+ #endif // __cplusplus
155
+
156
+ #endif // LAYOUT_MODEL_TYPED_VALUE_H_