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
document.h
Go to the documentation of this file.
1 // Copyright 2015-2023 Trimble Inc. All rights reserved.
2 // This file is intended for public distribution.
3
4 #ifndef LAYOUT_MODEL_DOCUMENT_H_
5 #define LAYOUT_MODEL_DOCUMENT_H_
6
7 #include <LayOutAPI/common.h>
8 #include <LayOutAPI/model/defs.h>
9 #include <LayOutAPI/model/imagerep.h>
10 #include <LayOutAPI/model/sketchupmodel.h>
11 #include <time.h>
12
23 typedef enum {
24 LODocumentVersion_1 = 1,
25 LODocumentVersion_2 = 2,
26 LODocumentVersion_3 = 3,
27 LODocumentVersion_2013 = 13,
28 LODocumentVersion_2014 = 14,
29 LODocumentVersion_2015 = 15,
30 LODocumentVersion_2016 = 16,
31 LODocumentVersion_2017 = 17,
32 LODocumentVersion_2018 = 18,
33 LODocumentVersion_2019 = 19,
34 LODocumentVersion_2020 = 20,
35 LODocumentVersion_2021 = 21,
36 LODocumentVersion_2022 = 22,
37 LODocumentVersion_2023 = 23,
38
39 LODocumentVersion_Current = LODocumentVersion_2023,
40
41 LONumDocumentVersions
42 } LODocumentVersion;
43
48 typedef enum {
49 LODocumentUnits_FractionalInches = 0,
50 LODocumentUnits_DecimalInches,
51 LODocumentUnits_DecimalFeet,
52 LODocumentUnits_DecimalMillimeters,
53 LODocumentUnits_DecimalCentimeters,
54 LODocumentUnits_DecimalMeters,
55 LODocumentUnits_DecimalPoints,
56
57 LONumDocumentUnits
58 } LODocumentUnits;
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63
73 LO_RESULT LODocumentCreateEmpty(LODocumentRef* document);
74
87 LO_RESULT LODocumentCreateFromFile(LODocumentRef* document, const char* path);
88
103 LO_RESULT LODocumentCreateFromTemplate(LODocumentRef* document, const char* path);
104
116 LO_RESULT LODocumentRelease(LODocumentRef* document);
117
126 LO_RESULT LODocumentAddReference(LODocumentRef document);
127
142 LO_RESULT LODocumentSaveToFile(LODocumentRef document, const char* path, LODocumentVersion version);
143
180 LO_RESULT LODocumentExportToPDF(
181 LODocumentRef document, const char* path, LODictionaryRef options_dict);
182
183
222 LO_RESULT LODocumentExportToImageSet(
223 LODocumentRef document, const char* export_path, const char* base_name,
224 LOImageRepOutputFormat format, LODictionaryRef options_dict);
225
239 LO_RESULT LODocumentGetFilePath(LODocumentRef document, SUStringRef* path);
240
250 LO_RESULT LODocumentGetNumberOfLayers(LODocumentRef document, size_t* num_layers);
251
266 LO_RESULT LODocumentGetLayerAtIndex(
267 LODocumentRef document, size_t index, LOLayerRef* layer_definition);
268
281 LO_RESULT LODocumentGetLayers(LODocumentRef document, LOLayerListRef layer_definitions);
282
293 LO_RESULT LODocumentGetActiveLayer(LODocumentRef document, LOLayerRef* layer_definition);
294
308 LO_RESULT LODocumentSetActiveLayer(LODocumentRef document, LOLayerRef layer_definition);
309
324 LO_RESULT LODocumentReorderLayer(
325 LODocumentRef document, LOLayerRef layer_definition, size_t new_index);
340 LO_RESULT LODocumentAddLayer(LODocumentRef document, bool shared, LOLayerRef* layer_definition);
341
369 LO_RESULT LODocumentRemoveLayer(
370 LODocumentRef document, LOLayerRef* layer_definition, bool delete_entities);
371
382 LO_RESULT LODocumentGetPageInfo(LODocumentRef document, LOPageInfoRef* page_info);
383
394 LO_RESULT LODocumentGetGrid(LODocumentRef document, LOGridRef* grid);
395
405 LO_RESULT LODocumentGetNumberOfPages(LODocumentRef document, size_t* num_pages);
406
419 LO_RESULT LODocumentGetPageAtIndex(LODocumentRef document, size_t index, LOPageRef* page);
420
430 LO_RESULT LODocumentGetPages(LODocumentRef document, LOPageListRef pages);
431
443 LO_RESULT LODocumentGetInitialPage(LODocumentRef document, LOPageRef* page);
444
457 LO_RESULT LODocumentSetInitialPage(LODocumentRef document, LOPageRef page);
458
470 LO_RESULT LODocumentAddPage(LODocumentRef document, LOPageRef* page);
471
486 LO_RESULT LODocumentRemovePage(LODocumentRef document, LOPageRef* page);
487
501 LO_RESULT LODocumentReorderPage(LODocumentRef document, LOPageRef page, size_t new_index);
502
524 LO_RESULT LODocumentAddEntity(
525 LODocumentRef document, LOEntityRef entity, LOLayerRef layer_definition, LOPageRef page);
526
546 LO_RESULT LODocumentAddEntityUsingIndexes(
547 LODocumentRef document, LOEntityRef entity, size_t layer_index, size_t page_index);
548
561 LO_RESULT LODocumentRemoveEntity(LODocumentRef document, LOEntityRef* entity);
562
574 LO_RESULT LODocumentGetNumberOfSharedEntities(LODocumentRef document, size_t* num_shared_entities);
575
590 LO_RESULT LODocumentGetSharedEntityAtIndex(
591 LODocumentRef document, size_t index, LOEntityRef* entity);
592
604 LO_RESULT LODocumentGetSharedEntities(LODocumentRef document, LOEntityListRef entity_list);
605
615 LO_RESULT LODocumentGetObjectSnap(LODocumentRef document, bool* object_snap);
616
625 LO_RESULT LODocumentSetObjectSnap(LODocumentRef document, bool object_snap);
626
636 LO_RESULT LODocumentGetGridSnap(LODocumentRef document, bool* grid_snap);
637
646 LO_RESULT LODocumentSetGridSnap(LODocumentRef document, bool grid_snap);
647
657 LO_RESULT LODocumentGetTimeCreated(LODocumentRef document, time_t* time_created);
658
668 LO_RESULT LODocumentGetTimeModified(LODocumentRef document, time_t* time_modified);
669
679 LO_RESULT LODocumentGetTimePublished(LODocumentRef document, time_t* time_published);
680
693 LO_RESULT LODocumentGetUnits(LODocumentRef document, LODocumentUnits* units, double* precision);
694
711 LO_RESULT LODocumentSetUnits(LODocumentRef document, LODocumentUnits units, double precision);
712
713
724 LO_RESULT LODocumentGetNumberOfAutoTextDefinitions(LODocumentRef document, size_t* size);
725
738 LO_RESULT LODocumentGetAutoTextDefinitionAtIndex(
739 LODocumentRef document, size_t index, LOAutoTextDefinitionRef* autotext);
740
754 LO_RESULT LODocumentGetAutoTextDefinitionByName(
755 LODocumentRef document, const char* name, LOAutoTextDefinitionRef* autotext);
756
768 LO_RESULT LODocumentGetAutoTextDefinitions(
769 LODocumentRef document, LOAutoTextDefinitionListRef autotexts);
770
786 LO_RESULT LODocumentAddAutoTextDefinition(
787 LODocumentRef document, int type, const char* name, LOAutoTextDefinitionRef* autotext);
788
804 LO_RESULT LODocumentRemoveAutoTextDefinition(
805 LODocumentRef document, LOAutoTextDefinitionRef* autotext, bool convert_tags_to_normal_text);
806
822 LO_RESULT LODocumentGetLengthFormatter(LODocumentRef document, SULengthFormatterRef* formatter);
823
824
839 LO_RESULT LODocumentGetRenderModeOverride(
840 LODocumentRef document, LOSketchUpModelRenderMode* render_mode);
841
858 LO_RESULT LODocumentSetRenderModeOverride(
859 LODocumentRef document, LOSketchUpModelRenderMode render_mode);
860
875 LO_RESULT LODocumentCreateAttributeDictionaryCopy(
876 LODocumentRef document, const char* dictionary_name, LODictionaryRef* dictionary);
877
893 LO_RESULT LODocumentSetAttribute(
894 LODocumentRef document, const char* dictionary_name, const char* key, LOTypedValueRef value_in);
895
912 LO_RESULT LODocumentGetAttribute(
913 LODocumentRef document, const char* dictionary_name, const char* key,
914 LOTypedValueRef value_out);
915
929 LO_RESULT LODocumentDeleteAttribute(
930 LODocumentRef document, const char* dictionary_name, const char* key);
931
932 #ifdef __cplusplus
933 } // extern "C" {
934 #endif
935
936 #endif // LAYOUT_MODEL_DOCUMENT_H_