react-native-nitro-xlsx 0.2.5 → 0.2.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.
- package/NitroXlsx.podspec +26 -27
- package/Package.swift +31 -10
- package/README.md +1 -1
- package/android/CMakeLists.txt +20 -27
- package/package.json +2 -2
- package/scripts/run-cpp-tests.sh +1 -1
- package/thirdparty/OpenXLSX/.clang-format +118 -0
- package/thirdparty/OpenXLSX/.clang-tidy +28 -0
- package/thirdparty/OpenXLSX/.gitignore +130 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_before_XMLNode_wrappers +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_and_stripping +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_char_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespaced_name_disabled +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-11-benchmarks_post-XLCellIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-14-benchmarks_post-default-row-column-style-support +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-09-02-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-19-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-30-benchmarks-post-XLSharedStrings-by-ref +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-09-benchmarks-post-conditionalFormatsAndSheetProtection +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-10-benchmarks-post-XLCellValue-bugfix +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-31-benchmarks-post-XLComments-implementation +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-02-02-benchmarks-post-XLRowIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-07-20-benchmarks-after-hiding-pugixml-internals +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-08-29-benchmarks-after-code-review-with-libzip +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/Benchmark.cpp +249 -0
- package/thirdparty/OpenXLSX/Benchmarks/CMakeLists.txt +19 -0
- package/thirdparty/OpenXLSX/CMakeLists.txt +466 -0
- package/thirdparty/OpenXLSX/Documentation/CMakeLists.txt +31 -0
- package/thirdparty/OpenXLSX/Documentation/Doxyfile.in +2471 -0
- package/thirdparty/OpenXLSX/Documentation/DoxygenLayout.xml +194 -0
- package/thirdparty/OpenXLSX/Documentation/customdoxygen.css +1355 -0
- package/thirdparty/OpenXLSX/Examples/CMakeLists.txt +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo1.cpp +279 -0
- package/thirdparty/OpenXLSX/Examples/Demo10.cpp +545 -0
- package/thirdparty/OpenXLSX/Examples/Demo1A.cpp +137 -0
- package/thirdparty/OpenXLSX/Examples/Demo2.cpp +65 -0
- package/thirdparty/OpenXLSX/Examples/Demo3.cpp +89 -0
- package/thirdparty/OpenXLSX/Examples/Demo4.cpp +86 -0
- package/thirdparty/OpenXLSX/Examples/Demo5.cpp +77 -0
- package/thirdparty/OpenXLSX/Examples/Demo6.cpp +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo7.cpp +79 -0
- package/thirdparty/OpenXLSX/Examples/Demo8.cpp +117 -0
- package/thirdparty/OpenXLSX/Examples/Demo9.cpp +363 -0
- package/thirdparty/OpenXLSX/Examples/cmake/FindLIBZIP.cmake +61 -0
- package/thirdparty/OpenXLSX/Examples/external/CustomZip/CustomZip.hpp +256 -0
- package/thirdparty/OpenXLSX/LICENSE.md +29 -0
- package/thirdparty/OpenXLSX/Makefile.GNU +530 -0
- package/thirdparty/OpenXLSX/Notes/TBDs.txt +16 -0
- package/thirdparty/OpenXLSX/Notes/confirmed-TBCs.txt +8 -0
- package/thirdparty/OpenXLSX/Notes/styles-missing-support.xml +12 -0
- package/thirdparty/OpenXLSX/Notes/todo-list.txt +108 -0
- package/thirdparty/OpenXLSX/OpenXLSX/CMakeLists.txt +631 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSX.hpp +63 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSXConfig.cmake +11 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/bundle_static_library.cmake +198 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/patch_pkg_config.cmake +69 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCell.cpp +340 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellIterator.cpp +427 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellRange.cpp +221 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellReference.cpp +408 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellValue.cpp +519 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColor.cpp +202 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColumn.cpp +141 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLComments.cpp +637 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLContentTypes.cpp +329 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDateTime.cpp +269 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDocument.cpp +1678 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDrawing.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLFormula.cpp +201 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLMergeCells.cpp +357 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLProperties.cpp +810 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRelationships.cpp +529 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRow.cpp +918 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRowData.cpp +508 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSharedStrings.cpp +220 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSheet.cpp +1970 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLStyles.cpp +3014 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLTables.cpp +125 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLWorkbook.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlData.cpp +247 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlFile.cpp +160 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlParser.cpp +261 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLZipArchive.cpp +266 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/utilities/XLUtilities.hpp +478 -0
- package/thirdparty/OpenXLSX/README.md +1279 -0
- package/thirdparty/OpenXLSX/Scripts/cmake-cleanup.sh +102 -0
- package/thirdparty/OpenXLSX/Scripts/compile.sh +23 -0
- package/thirdparty/OpenXLSX/Scripts/demos-cleanup.sh +25 -0
- package/thirdparty/OpenXLSX/Scripts/demos-run-all.sh +60 -0
- package/thirdparty/OpenXLSX/Scripts/guarded-xml-format.sh +47 -0
- package/thirdparty/OpenXLSX/Scripts/make-gnu.sh +11 -0
- package/thirdparty/OpenXLSX/Scripts/uninstall-manifest.sh +48 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format-all.sh +19 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format.sh +38 -0
- package/thirdparty/OpenXLSX/Tests/CMakeLists.txt +37 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch.hpp +17799 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_automake.hpp +68 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_sonarqube.hpp +182 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_tap.hpp +278 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_teamcity.hpp +212 -0
- package/thirdparty/OpenXLSX/Tests/main.cpp +55 -0
- package/thirdparty/OpenXLSX/Tests/testXLCell.cpp +176 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellRange.cpp +180 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellReference.cpp +160 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValue.cpp +366 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValueProxy.cpp +255 -0
- package/thirdparty/OpenXLSX/Tests/testXLColor.cpp +75 -0
- package/thirdparty/OpenXLSX/Tests/testXLDateTime.cpp +229 -0
- package/thirdparty/OpenXLSX/Tests/testXLDocument.cpp +197 -0
- package/thirdparty/OpenXLSX/Tests/testXLFormula.cpp +131 -0
- package/thirdparty/OpenXLSX/Tests/testXLRow.cpp +597 -0
- package/thirdparty/OpenXLSX/Tests/testXLSheet.cpp +77 -0
- package/thirdparty/OpenXLSX/Tests/ziptest-with-libs.cpp +88 -0
- package/thirdparty/OpenXLSX/Tests/ziptest.cpp +735 -0
- package/thirdparty/OpenXLSX/cmake/get-git-HEAD-ID.cmake +45 -0
- package/thirdparty/OpenXLSX/cmake/libopenxlsxCPackOptions.cmake.in +20 -0
- package/thirdparty/OpenXLSX/cmake/manage_dependency.cmake +813 -0
- package/thirdparty/OpenXLSX/cmake/recursive_library_type_test.cmake +52 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-shared.hpp +42 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-static.hpp +42 -0
- package/thirdparty/OpenXLSX/vcpkg.json +24 -0
- package/thirdparty/README.md +42 -0
- package/thirdparty/miniz/.clang-format +47 -0
- package/thirdparty/miniz/.travis.yml +2 -0
- package/thirdparty/miniz/CMakeLists.txt +333 -0
- package/thirdparty/miniz/CMakePresets.json +31 -0
- package/thirdparty/miniz/ChangeLog.md +272 -0
- package/thirdparty/miniz/Config.cmake.in +1 -0
- package/thirdparty/miniz/LICENSE +22 -0
- package/thirdparty/miniz/amalgamate.sh +57 -0
- package/thirdparty/miniz/examples/example1.c +105 -0
- package/thirdparty/miniz/examples/example2.c +164 -0
- package/thirdparty/miniz/examples/example3.c +269 -0
- package/thirdparty/miniz/examples/example4.c +102 -0
- package/thirdparty/miniz/examples/example5.c +327 -0
- package/thirdparty/miniz/examples/example6.c +189 -0
- package/thirdparty/miniz/meson.build +21 -0
- package/thirdparty/miniz/miniz.c +646 -0
- package/thirdparty/miniz/miniz.h +615 -0
- package/thirdparty/miniz/miniz.pc.in +13 -0
- package/thirdparty/miniz/miniz_common.h +89 -0
- package/thirdparty/miniz/miniz_export.h +20 -0
- package/thirdparty/miniz/miniz_tdef.c +1602 -0
- package/thirdparty/miniz/miniz_tdef.h +199 -0
- package/thirdparty/miniz/miniz_tinfl.c +778 -0
- package/thirdparty/miniz/miniz_tinfl.h +150 -0
- package/thirdparty/miniz/miniz_zip.c +4895 -0
- package/thirdparty/miniz/miniz_zip.h +454 -0
- package/thirdparty/miniz/readme.md +46 -0
- package/thirdparty/miniz/test.sh +36 -0
- package/thirdparty/miniz/tests/add_in_place_fuzzer.c +87 -0
- package/thirdparty/miniz/tests/catch_amalgamated.cpp +10795 -0
- package/thirdparty/miniz/tests/catch_amalgamated.hpp +13143 -0
- package/thirdparty/miniz/tests/checksum_fuzzer.c +26 -0
- package/thirdparty/miniz/tests/compress_fuzzer.c +91 -0
- package/thirdparty/miniz/tests/flush_fuzzer.c +88 -0
- package/thirdparty/miniz/tests/fuzz_main.c +55 -0
- package/thirdparty/miniz/tests/large_fuzzer.c +133 -0
- package/thirdparty/miniz/tests/main.cpp +185 -0
- package/thirdparty/miniz/tests/miniz_tdefl_fuzzer.cc +115 -0
- package/thirdparty/miniz/tests/miniz_tester.cpp +1881 -0
- package/thirdparty/miniz/tests/miniz_zip_validate_fuzzer.cc +71 -0
- package/thirdparty/miniz/tests/miniz_zip_writer_fuzzer.cc +96 -0
- package/thirdparty/miniz/tests/ossfuzz.sh +48 -0
- package/thirdparty/miniz/tests/small_fuzzer.c +126 -0
- package/thirdparty/miniz/tests/timer.cpp +152 -0
- package/thirdparty/miniz/tests/timer.h +40 -0
- package/thirdparty/miniz/tests/uncompress2_fuzzer.c +21 -0
- package/thirdparty/miniz/tests/uncompress_fuzzer.c +30 -0
- package/thirdparty/miniz/tests/zip.dict +9 -0
- package/thirdparty/miniz/tests/zip_fuzzer.c +63 -0
- package/thirdparty/pugixml/.codecov.yml +7 -0
- package/thirdparty/pugixml/.gitattributes +1 -0
- package/thirdparty/pugixml/CMakeLists.txt +330 -0
- package/thirdparty/pugixml/LICENSE.md +24 -0
- package/thirdparty/pugixml/Makefile +98 -0
- package/thirdparty/pugixml/README.md +81 -0
- package/thirdparty/pugixml/SECURITY.md +9 -0
- package/thirdparty/pugixml/appveyor.yml +50 -0
- package/thirdparty/pugixml/docs/config.adoc +7 -0
- package/thirdparty/pugixml/docs/images/dom_tree.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch3.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch4.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link2.png +0 -0
- package/thirdparty/pugixml/docs/manual.adoc +3326 -0
- package/thirdparty/pugixml/docs/manual.html +6395 -0
- package/thirdparty/pugixml/docs/quickstart.adoc +287 -0
- package/thirdparty/pugixml/docs/quickstart.html +1107 -0
- package/thirdparty/pugixml/docs/samples/character.xml +8 -0
- package/thirdparty/pugixml/docs/samples/custom_memory_management.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/include.cpp +64 -0
- package/thirdparty/pugixml/docs/samples/load_error_handling.cpp +33 -0
- package/thirdparty/pugixml/docs/samples/load_file.cpp +16 -0
- package/thirdparty/pugixml/docs/samples/load_memory.cpp +66 -0
- package/thirdparty/pugixml/docs/samples/load_options.cpp +30 -0
- package/thirdparty/pugixml/docs/samples/load_stream.cpp +97 -0
- package/thirdparty/pugixml/docs/samples/modify_add.cpp +29 -0
- package/thirdparty/pugixml/docs/samples/modify_base.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/modify_remove.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_custom_writer.cpp +116 -0
- package/thirdparty/pugixml/docs/samples/save_declaration.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_file.cpp +17 -0
- package/thirdparty/pugixml/docs/samples/save_options.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/save_stream.cpp +18 -0
- package/thirdparty/pugixml/docs/samples/save_subtree.cpp +26 -0
- package/thirdparty/pugixml/docs/samples/text.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/transitions.xml +7 -0
- package/thirdparty/pugixml/docs/samples/traverse_base.cpp +51 -0
- package/thirdparty/pugixml/docs/samples/traverse_iter.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/traverse_predicate.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/traverse_rangefor.cpp +32 -0
- package/thirdparty/pugixml/docs/samples/traverse_walker.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/tree.xml +12 -0
- package/thirdparty/pugixml/docs/samples/weekly-shift_jis.xml +78 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-16.xml +0 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-8.xml +78 -0
- package/thirdparty/pugixml/docs/samples/xgconsole.xml +12 -0
- package/thirdparty/pugixml/docs/samples/xpath_error.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/xpath_query.cpp +36 -0
- package/thirdparty/pugixml/docs/samples/xpath_select.cpp +28 -0
- package/thirdparty/pugixml/docs/samples/xpath_variables.cpp +38 -0
- package/thirdparty/pugixml/readme.txt +50 -0
- package/thirdparty/pugixml/scripts/archive.py +54 -0
- package/thirdparty/pugixml/scripts/cocoapods_push.sh +4 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml.natvis +77 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml_compact.natvis +506 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml-propertiesui.xml +17 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml.targets +28 -0
- package/thirdparty/pugixml/scripts/nuget/pugixml.nuspec +20 -0
- package/thirdparty/pugixml/scripts/nuget_build.ps1 +60 -0
- package/thirdparty/pugixml/scripts/premake4.lua +92 -0
- package/thirdparty/pugixml/scripts/pugixml-config.cmake.in +12 -0
- package/thirdparty/pugixml/scripts/pugixml.pc.in +11 -0
- package/thirdparty/pugixml/scripts/pugixml.podspec +14 -0
- package/thirdparty/pugixml/scripts/pugixml.xcodeproj/project.pbxproj +212 -0
- package/thirdparty/pugixml/scripts/pugixml_airplay.mkf +13 -0
- package/thirdparty/pugixml/scripts/pugixml_codeblocks.cbp +44 -0
- package/thirdparty/pugixml/scripts/pugixml_codelite.project +56 -0
- package/thirdparty/pugixml/scripts/pugixml_dll.rc +45 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005_static.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008_static.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010_static.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013_static.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/sbom.cdx.json +47 -0
- package/thirdparty/pugixml/src/pugiconfig.hpp +81 -0
- package/thirdparty/pugixml/src/pugixml.cpp +13776 -0
- package/thirdparty/pugixml/src/pugixml.hpp +1604 -0
- package/thirdparty/pugixml/tests/allocator.cpp +175 -0
- package/thirdparty/pugixml/tests/allocator.hpp +10 -0
- package/thirdparty/pugixml/tests/autotest-appveyor.ps1 +93 -0
- package/thirdparty/pugixml/tests/cmake-appveyor.ps1 +57 -0
- package/thirdparty/pugixml/tests/data/empty.xml +0 -0
- package/thirdparty/pugixml/tests/data/large.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_latin1.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_utf8.xml +1 -0
- package/thirdparty/pugixml/tests/data/multiline.xml +3 -0
- package/thirdparty/pugixml/tests/data/small.xml +1 -0
- package/thirdparty/pugixml/tests/data/truncation.xml +19 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_bom.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_clean.xml +84 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_nodecl.xml +86 -0
- package/thirdparty/pugixml/tests/data//321/202/320/265/321/201/321/202.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/basic.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/doctype.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/refs.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/types.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf16.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf32.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/basic.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/functions.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/math.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/path.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/predicate.xpath +1 -0
- package/thirdparty/pugixml/tests/fuzz_parse.cpp +14 -0
- package/thirdparty/pugixml/tests/fuzz_parse.dict +72 -0
- package/thirdparty/pugixml/tests/fuzz_setup.sh +11 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.cpp +46 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.dict +72 -0
- package/thirdparty/pugixml/tests/helpers.hpp +114 -0
- package/thirdparty/pugixml/tests/main.cpp +218 -0
- package/thirdparty/pugixml/tests/test.cpp +220 -0
- package/thirdparty/pugixml/tests/test.hpp +175 -0
- package/thirdparty/pugixml/tests/test_compact.cpp +150 -0
- package/thirdparty/pugixml/tests/test_deprecated.cpp +25 -0
- package/thirdparty/pugixml/tests/test_document.cpp +1910 -0
- package/thirdparty/pugixml/tests/test_dom_modify.cpp +2122 -0
- package/thirdparty/pugixml/tests/test_dom_text.cpp +601 -0
- package/thirdparty/pugixml/tests/test_dom_traverse.cpp +1481 -0
- package/thirdparty/pugixml/tests/test_header_guard.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_only_1.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_only_2.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_string_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_iostream.cpp +5 -0
- package/thirdparty/pugixml/tests/test_memory.cpp +303 -0
- package/thirdparty/pugixml/tests/test_parse.cpp +1463 -0
- package/thirdparty/pugixml/tests/test_parse_doctype.cpp +366 -0
- package/thirdparty/pugixml/tests/test_unicode.cpp +152 -0
- package/thirdparty/pugixml/tests/test_version.cpp +5 -0
- package/thirdparty/pugixml/tests/test_write.cpp +757 -0
- package/thirdparty/pugixml/tests/test_xpath.cpp +833 -0
- package/thirdparty/pugixml/tests/test_xpath_api.cpp +646 -0
- package/thirdparty/pugixml/tests/test_xpath_functions.cpp +844 -0
- package/thirdparty/pugixml/tests/test_xpath_operators.cpp +566 -0
- package/thirdparty/pugixml/tests/test_xpath_parse.cpp +428 -0
- package/thirdparty/pugixml/tests/test_xpath_paths.cpp +787 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_abbrev_w3c.cpp +219 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_w3c.cpp +312 -0
- package/thirdparty/pugixml/tests/test_xpath_variables.cpp +683 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_1.cpp +411 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_2.cpp +417 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_3.cpp +321 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_4.cpp +300 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_5.cpp +295 -0
- package/thirdparty/pugixml/tests/writer_string.cpp +79 -0
- package/thirdparty/pugixml/tests/writer_string.hpp +27 -0
- package/scripts/prepare-openxlsx.js +0 -126
|
@@ -0,0 +1,2390 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
____ ____ ___ ____ ____ ____ ___
|
|
4
|
+
6MMMMb `MM( )M' `MM' 6MMMMb\`MM( )M'
|
|
5
|
+
8P Y8 `MM. d' MM 6M' ` `MM. d'
|
|
6
|
+
6M Mb __ ____ ____ ___ __ `MM. d' MM MM `MM. d'
|
|
7
|
+
MM MM `M6MMMMb 6MMMMb `MM 6MMb `MM. d' MM YM. `MM. d'
|
|
8
|
+
MM MM MM' `Mb 6M' `Mb MMM9 `Mb `MMd MM YMMMMb `MMd
|
|
9
|
+
MM MM MM MM MM MM MM' MM dMM. MM `Mb dMM.
|
|
10
|
+
MM MM MM MM MMMMMMMM MM MM d'`MM. MM MM d'`MM.
|
|
11
|
+
YM M9 MM MM MM MM MM d' `MM. MM MM d' `MM.
|
|
12
|
+
8b d8 MM. ,M9 YM d9 MM MM d' `MM. MM / L ,M9 d' `MM.
|
|
13
|
+
YMMMM9 MMYMMM9 YMMMM9 _MM_ _MM_M(_ _)MM_ _MMMMMMM MYMMMM9 _M(_ _)MM_
|
|
14
|
+
MM
|
|
15
|
+
MM
|
|
16
|
+
_MM_
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2018, Kenneth Troldal Balslev
|
|
19
|
+
|
|
20
|
+
All rights reserved.
|
|
21
|
+
|
|
22
|
+
Redistribution and use in source and binary forms, with or without
|
|
23
|
+
modification, are permitted provided that the following conditions are met:
|
|
24
|
+
- Redistributions of source code must retain the above copyright
|
|
25
|
+
notice, this list of conditions and the following disclaimer.
|
|
26
|
+
- Redistributions in binary form must reproduce the above copyright
|
|
27
|
+
notice, this list of conditions and the following disclaimer in the
|
|
28
|
+
documentation and/or other materials provided with the distribution.
|
|
29
|
+
- Neither the name of the author nor the
|
|
30
|
+
names of any contributors may be used to endorse or promote products
|
|
31
|
+
derived from this software without specific prior written permission.
|
|
32
|
+
|
|
33
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
34
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
35
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
36
|
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
37
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
38
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
39
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
40
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
41
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
42
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
43
|
+
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
#ifndef OPENXLSX_XLSTYLES_HPP
|
|
47
|
+
#define OPENXLSX_XLSTYLES_HPP
|
|
48
|
+
|
|
49
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
50
|
+
# pragma warning(push)
|
|
51
|
+
# pragma warning(disable : 4251)
|
|
52
|
+
# pragma warning(disable : 4275)
|
|
53
|
+
#endif // _MSC_VER
|
|
54
|
+
|
|
55
|
+
// ===== External Includes ===== //
|
|
56
|
+
#include <cstdint> // uint32_t etc
|
|
57
|
+
#include <string>
|
|
58
|
+
#include <string_view> // std::string_view
|
|
59
|
+
#include <vector>
|
|
60
|
+
|
|
61
|
+
// ===== OpenXLSX Includes ===== //
|
|
62
|
+
#include "OpenXLSX-Exports.hpp"
|
|
63
|
+
#include "XLColor.hpp"
|
|
64
|
+
#include "XLXmlFile.hpp"
|
|
65
|
+
#include "XLXmlParserForwardDeclarations.hpp"
|
|
66
|
+
|
|
67
|
+
namespace OpenXLSX
|
|
68
|
+
{
|
|
69
|
+
using namespace std::literals::string_view_literals; // enables sv suffix only
|
|
70
|
+
|
|
71
|
+
using XLStyleIndex = size_t; // custom data type for XLStyleIndex
|
|
72
|
+
|
|
73
|
+
constexpr const uint32_t XLInvalidUInt16 = 0xffff; // used to signal "value not defined" for uint16_t return types
|
|
74
|
+
constexpr const uint32_t XLInvalidUInt32 = 0xffffffff; // used to signal "value not defined" for uint32_t return types
|
|
75
|
+
constexpr const uint32_t XLDeleteProperty = XLInvalidUInt32; // when 0 or "" is not the same as "property does not exist", this value
|
|
76
|
+
// // can be passed to setter functions to delete the property from XML
|
|
77
|
+
// // currently supported in: XLDataBarColor::setTheme
|
|
78
|
+
|
|
79
|
+
constexpr const bool XLPermitXfID = true; // use with XLCellFormat constructor to enable xfId() getter and setXfId() setter
|
|
80
|
+
|
|
81
|
+
constexpr const bool XLCreateIfMissing = true; // use with XLCellFormat::alignment(XLCreateIfMissing)
|
|
82
|
+
constexpr const bool XLDoNotCreate = false; // use with XLCellFormat::alignment(XLDoNotCreate)
|
|
83
|
+
|
|
84
|
+
constexpr const bool XLForceFillType = true;
|
|
85
|
+
|
|
86
|
+
constexpr const char * XLDefaultStylesPrefix = "\n\t"; // indentation to use for newly created root level style node tags
|
|
87
|
+
constexpr const char * XLDefaultStyleEntriesPrefix = "\n\t\t"; // indentation to use for newly created style entry nodes
|
|
88
|
+
|
|
89
|
+
constexpr const XLStyleIndex XLDefaultCellFormat = 0; // default cell format index in xl/styles.xml:<styleSheet>:<cellXfs>
|
|
90
|
+
|
|
91
|
+
// ===== As pugixml attributes are not guaranteed to support value range of XLStyleIndex, use 32 bit unsigned int
|
|
92
|
+
constexpr const XLStyleIndex XLInvalidStyleIndex = XLInvalidUInt32; // as a function return value, indicates no valid index
|
|
93
|
+
|
|
94
|
+
constexpr const uint32_t XLDefaultFontSize = 12; //
|
|
95
|
+
constexpr const char * XLDefaultFontColor = "ff000000"; // default font color
|
|
96
|
+
constexpr const char * XLDefaultFontColorTheme = ""; // TBD what this means / how it is used
|
|
97
|
+
constexpr const char * XLDefaultFontName = "Arial"; //
|
|
98
|
+
constexpr const uint32_t XLDefaultFontFamily = 0; // TBD what this means / how it is used
|
|
99
|
+
constexpr const uint32_t XLDefaultFontCharset = 1; // TBD what this means / how it is used
|
|
100
|
+
|
|
101
|
+
constexpr const char * XLDefaultLineStyle = ""; // empty string = line not set
|
|
102
|
+
|
|
103
|
+
// forward declarations of all classes in this header
|
|
104
|
+
class XLNumberFormat;
|
|
105
|
+
class XLNumberFormats;
|
|
106
|
+
class XLFont;
|
|
107
|
+
class XLFonts;
|
|
108
|
+
class XLFill;
|
|
109
|
+
class XLFills;
|
|
110
|
+
class XLLine;
|
|
111
|
+
class XLBorder;
|
|
112
|
+
class XLBorders;
|
|
113
|
+
class XLAlignment;
|
|
114
|
+
class XLCellFormat;
|
|
115
|
+
class XLCellFormats;
|
|
116
|
+
class XLCellStyle;
|
|
117
|
+
class XLCellStyles;
|
|
118
|
+
class XLStyles;
|
|
119
|
+
|
|
120
|
+
enum XLUnderlineStyle : uint8_t {
|
|
121
|
+
XLUnderlineNone = 0,
|
|
122
|
+
XLUnderlineSingle = 1,
|
|
123
|
+
XLUnderlineDouble = 2,
|
|
124
|
+
XLUnderlineInvalid = 255
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
enum XLFontSchemeStyle : uint8_t {
|
|
128
|
+
XLFontSchemeNone = 0, // <scheme val="none"/>
|
|
129
|
+
XLFontSchemeMajor = 1, // <scheme val="major"/>
|
|
130
|
+
XLFontSchemeMinor = 2, // <scheme val="minor"/>
|
|
131
|
+
XLFontSchemeInvalid = 255 // all other values
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
enum XLVerticalAlignRunStyle : uint8_t {
|
|
135
|
+
XLBaseline = 0, // <vertAlign val="baseline"/>
|
|
136
|
+
XLSubscript = 1, // <vertAlign val="subscript"/>
|
|
137
|
+
XLSuperscript = 2, // <vertAlign val="superscript"/>
|
|
138
|
+
XLVerticalAlignRunInvalid = 255
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
enum XLFillType : uint8_t {
|
|
142
|
+
XLGradientFill = 0, // <gradientFill />
|
|
143
|
+
XLPatternFill = 1, // <patternFill />
|
|
144
|
+
XLFillTypeInvalid = 255, // any child of <fill> that is not one of the above
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
enum XLGradientType : uint8_t {
|
|
148
|
+
XLGradientLinear = 0,
|
|
149
|
+
XLGradientPath = 1,
|
|
150
|
+
XLGradientTypeInvalid = 255
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
enum XLPatternType: uint8_t {
|
|
154
|
+
XLPatternNone = 0, // "none"
|
|
155
|
+
XLPatternSolid = 1, // "solid"
|
|
156
|
+
XLPatternMediumGray = 2, // "mediumGray"
|
|
157
|
+
XLPatternDarkGray = 3, // "darkGray"
|
|
158
|
+
XLPatternLightGray = 4, // "lightGray"
|
|
159
|
+
XLPatternDarkHorizontal = 5, // "darkHorizontal"
|
|
160
|
+
XLPatternDarkVertical = 6, // "darkVertical"
|
|
161
|
+
XLPatternDarkDown = 7, // "darkDown"
|
|
162
|
+
XLPatternDarkUp = 8, // "darkUp"
|
|
163
|
+
XLPatternDarkGrid = 9, // "darkGrid"
|
|
164
|
+
XLPatternDarkTrellis = 10, // "darkTrellis"
|
|
165
|
+
XLPatternLightHorizontal = 11, // "lightHorizontal"
|
|
166
|
+
XLPatternLightVertical = 12, // "lightVertical"
|
|
167
|
+
XLPatternLightDown = 13, // "lightDown"
|
|
168
|
+
XLPatternLightUp = 14, // "lightUp"
|
|
169
|
+
XLPatternLightGrid = 15, // "lightGrid"
|
|
170
|
+
XLPatternLightTrellis = 16, // "lightTrellis"
|
|
171
|
+
XLPatternGray125 = 17, // "gray125"
|
|
172
|
+
XLPatternGray0625 = 18, // "gray0625"
|
|
173
|
+
XLPatternTypeInvalid = 255 // any patternType that is not one of the above
|
|
174
|
+
};
|
|
175
|
+
constexpr const XLFillType XLDefaultFillType = XLPatternFill; // node name for the pattern description is derived from this
|
|
176
|
+
constexpr const XLPatternType XLDefaultPatternType = XLPatternNone; // attribute patternType default value: no fill
|
|
177
|
+
constexpr const char* XLDefaultPatternFgColor = "ffffffff"; // child node fgcolor attribute rgb value
|
|
178
|
+
constexpr const char* XLDefaultPatternBgColor = "ff000000"; // child node bgcolor attribute rgb value
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
enum XLLineType: uint8_t {
|
|
182
|
+
XLLineLeft = 0,
|
|
183
|
+
XLLineRight = 1,
|
|
184
|
+
XLLineTop = 2,
|
|
185
|
+
XLLineBottom = 3,
|
|
186
|
+
XLLineDiagonal = 4,
|
|
187
|
+
XLLineVertical = 5,
|
|
188
|
+
XLLineHorizontal = 6,
|
|
189
|
+
XLLineInvalid = 255
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
enum XLLineStyle : uint8_t {
|
|
193
|
+
XLLineStyleNone = 0,
|
|
194
|
+
XLLineStyleThin = 1,
|
|
195
|
+
XLLineStyleMedium = 2,
|
|
196
|
+
XLLineStyleDashed = 3,
|
|
197
|
+
XLLineStyleDotted = 4,
|
|
198
|
+
XLLineStyleThick = 5,
|
|
199
|
+
XLLineStyleDouble = 6,
|
|
200
|
+
XLLineStyleHair = 7,
|
|
201
|
+
XLLineStyleMediumDashed = 8,
|
|
202
|
+
XLLineStyleDashDot = 9,
|
|
203
|
+
XLLineStyleMediumDashDot = 10,
|
|
204
|
+
XLLineStyleDashDotDot = 11,
|
|
205
|
+
XLLineStyleMediumDashDotDot = 12,
|
|
206
|
+
XLLineStyleSlantDashDot = 13,
|
|
207
|
+
XLLineStyleInvalid = 255
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
enum XLAlignmentStyle : uint8_t {
|
|
211
|
+
XLAlignGeneral = 0, // value="general", horizontal only
|
|
212
|
+
XLAlignLeft = 1, // value="left", horizontal only
|
|
213
|
+
XLAlignRight = 2, // value="right", horizontal only
|
|
214
|
+
XLAlignCenter = 3, // value="center", both
|
|
215
|
+
XLAlignTop = 4, // value="top", vertical only
|
|
216
|
+
XLAlignBottom = 5, // value="bottom", vertical only
|
|
217
|
+
XLAlignFill = 6, // value="fill", horizontal only
|
|
218
|
+
XLAlignJustify = 7, // value="justify", both
|
|
219
|
+
XLAlignCenterContinuous = 8, // value="centerContinuous", horizontal only
|
|
220
|
+
XLAlignDistributed = 9, // value="distributed", both
|
|
221
|
+
XLAlignInvalid = 255 // all other values
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
enum XLReadingOrder : uint32_t {
|
|
225
|
+
XLReadingOrderContextual = 0,
|
|
226
|
+
XLReadingOrderLeftToRight = 1,
|
|
227
|
+
XLReadingOrderRightToLeft = 2
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// ================================================================================
|
|
231
|
+
// XLNumberFormats Class
|
|
232
|
+
// ================================================================================
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @brief An encapsulation of a number format (numFmt) item
|
|
236
|
+
*/
|
|
237
|
+
class OPENXLSX_EXPORT XLNumberFormat
|
|
238
|
+
{
|
|
239
|
+
friend class XLNumberFormats; // for access to m_numberFormatNode in XLNumberFormats::create
|
|
240
|
+
public: // ---------- Public Member Functions ---------- //
|
|
241
|
+
/**
|
|
242
|
+
* @brief
|
|
243
|
+
*/
|
|
244
|
+
XLNumberFormat();
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
248
|
+
* @param node An XMLNode object with the styles item. If no input is provided, a null node is used.
|
|
249
|
+
*/
|
|
250
|
+
explicit XLNumberFormat(const XMLNode& node);
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @brief Copy Constructor.
|
|
254
|
+
* @param other Object to be copied.
|
|
255
|
+
*/
|
|
256
|
+
XLNumberFormat(const XLNumberFormat& other);
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @brief Move Constructor.
|
|
260
|
+
* @param other Object to be moved.
|
|
261
|
+
*/
|
|
262
|
+
XLNumberFormat(XLNumberFormat&& other) noexcept;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @brief
|
|
266
|
+
*/
|
|
267
|
+
~XLNumberFormat();
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @brief Copy assignment operator.
|
|
271
|
+
* @param other Right hand side of assignment operation.
|
|
272
|
+
* @return A reference to the lhs object.
|
|
273
|
+
*/
|
|
274
|
+
XLNumberFormat& operator=(const XLNumberFormat& other);
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @brief Move assignment operator.
|
|
278
|
+
* @param other Right hand side of assignment operation.
|
|
279
|
+
* @return A reference to lhs object.
|
|
280
|
+
*/
|
|
281
|
+
XLNumberFormat& operator=(XLNumberFormat&& other) noexcept;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @brief Get the id of the number format
|
|
285
|
+
* @return The id for this number format
|
|
286
|
+
*/
|
|
287
|
+
uint32_t numberFormatId() const;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @brief Get the code of the number format
|
|
291
|
+
* @return The format code for this number format
|
|
292
|
+
*/
|
|
293
|
+
std::string formatCode() const;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @brief Setter functions for style parameters
|
|
297
|
+
* @param value that shall be set
|
|
298
|
+
* @return true for success, false for failure
|
|
299
|
+
*/
|
|
300
|
+
bool setNumberFormatId(uint32_t newNumberFormatId);
|
|
301
|
+
bool setFormatCode(std::string newFormatCode);
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @brief Return a string summary of the number format
|
|
305
|
+
* @return string with info about the number format object
|
|
306
|
+
*/
|
|
307
|
+
std::string summary() const;
|
|
308
|
+
|
|
309
|
+
private: // ---------- Private Member Variables ---------- //
|
|
310
|
+
std::unique_ptr<XMLNode> m_numberFormatNode; /**< An XMLNode object with the number format item */
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @brief An encapsulation of the XLSX number formats (numFmts)
|
|
316
|
+
*/
|
|
317
|
+
class OPENXLSX_EXPORT XLNumberFormats
|
|
318
|
+
{
|
|
319
|
+
public: // ---------- Public Member Functions ---------- //
|
|
320
|
+
/**
|
|
321
|
+
* @brief
|
|
322
|
+
*/
|
|
323
|
+
XLNumberFormats();
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
327
|
+
* @param node An XMLNode object with the styles item. If no input is provided, a null node is used.
|
|
328
|
+
*/
|
|
329
|
+
explicit XLNumberFormats(const XMLNode& node);
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @brief Copy Constructor.
|
|
333
|
+
* @param other Object to be copied.
|
|
334
|
+
*/
|
|
335
|
+
XLNumberFormats(const XLNumberFormats& other);
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @brief Move Constructor.
|
|
339
|
+
* @param other Object to be moved.
|
|
340
|
+
*/
|
|
341
|
+
XLNumberFormats(XLNumberFormats&& other);
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @brief
|
|
345
|
+
*/
|
|
346
|
+
~XLNumberFormats();
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @brief Copy assignment operator.
|
|
350
|
+
* @param other Right hand side of assignment operation.
|
|
351
|
+
* @return A reference to the lhs object.
|
|
352
|
+
*/
|
|
353
|
+
XLNumberFormats& operator=(const XLNumberFormats& other);
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @brief Move assignment operator.
|
|
357
|
+
* @param other Right hand side of assignment operation.
|
|
358
|
+
* @return A reference to lhs object.
|
|
359
|
+
*/
|
|
360
|
+
XLNumberFormats& operator=(XLNumberFormats&& other) noexcept;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @brief Get the count of number formats
|
|
364
|
+
* @return The amount of entries in the number formats
|
|
365
|
+
*/
|
|
366
|
+
size_t count() const;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @brief Get the number format identified by index
|
|
370
|
+
* @param index an array index within XLStyles::numberFormats()
|
|
371
|
+
* @return An XLNumberFormat object
|
|
372
|
+
* @throw XLException when index is out of m_numberFormats range
|
|
373
|
+
*/
|
|
374
|
+
XLNumberFormat numberFormatByIndex(XLStyleIndex index) const;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* @brief Operator overload: allow [] as shortcut access to numberFormatByIndex
|
|
378
|
+
*/
|
|
379
|
+
XLNumberFormat operator[](XLStyleIndex index) const { return numberFormatByIndex(index); }
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @brief Get the number format identified by numberFormatId
|
|
383
|
+
* @param numberFormatId a numFmtId reference to a number format
|
|
384
|
+
* @return An XLNumberFormat object
|
|
385
|
+
* @throw XLException if no match for numberFormatId is found within m_numberFormats
|
|
386
|
+
*/
|
|
387
|
+
XLNumberFormat numberFormatById(uint32_t numberFormatId) const;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @brief Get the numFmtId from the number format identified by index
|
|
391
|
+
* @param index an array index within XLStyles::numberFormats()
|
|
392
|
+
* @return the uint32_t numFmtId corresponding to index
|
|
393
|
+
* @throw XLException when index is out of m_numberFormats range
|
|
394
|
+
*/
|
|
395
|
+
uint32_t numberFormatIdFromIndex(XLStyleIndex index) const;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @brief Append a new XLNumberFormat, based on copyFrom, and return its index in numFmts node
|
|
399
|
+
* @param copyFrom Can provide an XLNumberFormat to use as template for the new style
|
|
400
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
401
|
+
* @returns The index of the new style as used by operator[]
|
|
402
|
+
* @todo: TBD assign a unique, non-reserved uint32_t numFmtId. Alternatively, the user should configure it manually via setNumberFormatId
|
|
403
|
+
* @todo: TBD implement a "getFreeNumberFormatId()" method that skips reserved identifiers and iterates over m_numberFormats to avoid
|
|
404
|
+
* all existing number format Ids.
|
|
405
|
+
*/
|
|
406
|
+
XLStyleIndex create(XLNumberFormat copyFrom = XLNumberFormat{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
private: // ---------- Private Member Variables ---------- //
|
|
410
|
+
std::unique_ptr<XMLNode> m_numberFormatsNode; /**< An XMLNode object with the number formats item */
|
|
411
|
+
std::vector<XLNumberFormat> m_numberFormats;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
// ================================================================================
|
|
416
|
+
// XLFonts Class
|
|
417
|
+
// ================================================================================
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @brief An encapsulation of a font item
|
|
421
|
+
*/
|
|
422
|
+
class OPENXLSX_EXPORT XLFont
|
|
423
|
+
{
|
|
424
|
+
friend class XLFonts; // for access to m_fontNode in XLFonts::create
|
|
425
|
+
public: // ---------- Public Member Functions ---------- //
|
|
426
|
+
/**
|
|
427
|
+
* @brief
|
|
428
|
+
*/
|
|
429
|
+
XLFont();
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
433
|
+
* @param node An XMLNode object with the fonts XMLNode. If no input is provided, a null node is used.
|
|
434
|
+
*/
|
|
435
|
+
explicit XLFont(const XMLNode& node);
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* @brief Copy Constructor.
|
|
439
|
+
* @param other Object to be copied.
|
|
440
|
+
*/
|
|
441
|
+
XLFont(const XLFont& other);
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* @brief Move Constructor.
|
|
445
|
+
* @param other Object to be moved.
|
|
446
|
+
*/
|
|
447
|
+
XLFont(XLFont&& other) noexcept;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* @brief
|
|
451
|
+
*/
|
|
452
|
+
~XLFont();
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* @brief Copy assignment operator.
|
|
456
|
+
* @param other Right hand side of assignment operation.
|
|
457
|
+
* @return A reference to the lhs object.
|
|
458
|
+
*/
|
|
459
|
+
XLFont& operator=(const XLFont& other);
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* @brief Move assignment operator.
|
|
463
|
+
* @param other Right hand side of assignment operation.
|
|
464
|
+
* @return A reference to lhs object.
|
|
465
|
+
*/
|
|
466
|
+
XLFont& operator=(XLFont&& other) noexcept;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* @brief Get the font name
|
|
470
|
+
* @return The font name
|
|
471
|
+
*/
|
|
472
|
+
std::string fontName() const;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @brief Get the font charset
|
|
476
|
+
* @return The font charset id
|
|
477
|
+
*/
|
|
478
|
+
size_t fontCharset() const;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @brief Get the font family
|
|
482
|
+
* @return The font family id
|
|
483
|
+
*/
|
|
484
|
+
size_t fontFamily() const;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* @brief Get the font size
|
|
488
|
+
* @return The font size
|
|
489
|
+
*/
|
|
490
|
+
size_t fontSize() const;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* @brief Get the font color
|
|
494
|
+
* @return The font color
|
|
495
|
+
*/
|
|
496
|
+
XLColor fontColor() const;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* @brief Get the font bold status
|
|
500
|
+
* @return true = bold, false = not bold
|
|
501
|
+
*/
|
|
502
|
+
bool bold() const;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* @brief Get the font italic (cursive) status
|
|
506
|
+
* @return true = italic, false = not italice
|
|
507
|
+
*/
|
|
508
|
+
bool italic() const;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* @brief Get the font strikethrough status
|
|
512
|
+
* @return true = strikethrough, false = no strikethrough
|
|
513
|
+
*/
|
|
514
|
+
bool strikethrough() const;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* @brief Get the font underline status
|
|
518
|
+
* @return An XLUnderlineStyle value
|
|
519
|
+
*/
|
|
520
|
+
XLUnderlineStyle underline() const;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* @brief get the font scheme: none, major or minor
|
|
524
|
+
* @return An XLFontSchemeStyle
|
|
525
|
+
*/
|
|
526
|
+
XLFontSchemeStyle scheme() const;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* @brief get the font vertical alignment run style: baseline, subscript or superscript
|
|
530
|
+
* @return An XLVerticalAlignRunStyle
|
|
531
|
+
*/
|
|
532
|
+
XLVerticalAlignRunStyle vertAlign() const;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* @brief Get the outline status
|
|
536
|
+
* @return a TBD bool
|
|
537
|
+
* @todo need to find a use case for this
|
|
538
|
+
*/
|
|
539
|
+
bool outline() const;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* @brief Get the shadow status
|
|
543
|
+
* @return a TBD bool
|
|
544
|
+
* @todo need to find a use case for this
|
|
545
|
+
*/
|
|
546
|
+
bool shadow() const;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* @brief Get the condense status
|
|
550
|
+
* @return a TBD bool
|
|
551
|
+
* @todo need to find a use case for this
|
|
552
|
+
*/
|
|
553
|
+
bool condense() const;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* @brief Get the extend status
|
|
557
|
+
* @return a TBD bool
|
|
558
|
+
* @todo need to find a use case for this
|
|
559
|
+
*/
|
|
560
|
+
bool extend() const;
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @brief Setter functions for style parameters
|
|
565
|
+
* @param value that shall be set
|
|
566
|
+
* @return true for success, false for failure
|
|
567
|
+
*/
|
|
568
|
+
bool setFontName(std::string newName);
|
|
569
|
+
bool setFontCharset(size_t newCharset);
|
|
570
|
+
bool setFontFamily(size_t newFamily);
|
|
571
|
+
bool setFontSize(size_t newSize);
|
|
572
|
+
bool setFontColor(XLColor newColor);
|
|
573
|
+
bool setBold(bool set = true);
|
|
574
|
+
bool setItalic(bool set = true);
|
|
575
|
+
bool setStrikethrough(bool set = true);
|
|
576
|
+
bool setUnderline(XLUnderlineStyle style = XLUnderlineSingle);
|
|
577
|
+
bool setScheme(XLFontSchemeStyle newScheme);
|
|
578
|
+
bool setVertAlign(XLVerticalAlignRunStyle newVertAlign);
|
|
579
|
+
bool setOutline(bool set = true);
|
|
580
|
+
bool setShadow(bool set = true);
|
|
581
|
+
bool setCondense(bool set = true);
|
|
582
|
+
bool setExtend(bool set = true);
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @brief Return a string summary of the font properties
|
|
586
|
+
* @return string with info about the font object
|
|
587
|
+
*/
|
|
588
|
+
std::string summary() const;
|
|
589
|
+
|
|
590
|
+
private: // ---------- Private Member Variables ---------- //
|
|
591
|
+
std::unique_ptr<XMLNode> m_fontNode; /**< An XMLNode object with the font item */
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* @brief An encapsulation of the XLSX fonts
|
|
597
|
+
*/
|
|
598
|
+
class OPENXLSX_EXPORT XLFonts
|
|
599
|
+
{
|
|
600
|
+
public: // ---------- Public Member Functions ---------- //
|
|
601
|
+
/**
|
|
602
|
+
* @brief
|
|
603
|
+
*/
|
|
604
|
+
XLFonts();
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
608
|
+
* @param node An XMLNode object with the styles item. If no input is provided, a null node is used.
|
|
609
|
+
*/
|
|
610
|
+
explicit XLFonts(const XMLNode& node);
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* @brief Copy Constructor.
|
|
614
|
+
* @param other Object to be copied.
|
|
615
|
+
*/
|
|
616
|
+
XLFonts(const XLFonts& other);
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* @brief Move Constructor.
|
|
620
|
+
* @param other Object to be moved.
|
|
621
|
+
*/
|
|
622
|
+
XLFonts(XLFonts&& other);
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* @brief
|
|
626
|
+
*/
|
|
627
|
+
~XLFonts();
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* @brief Copy assignment operator.
|
|
631
|
+
* @param other Right hand side of assignment operation.
|
|
632
|
+
* @return A reference to the lhs object.
|
|
633
|
+
*/
|
|
634
|
+
XLFonts& operator=(const XLFonts& other);
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* @brief Move assignment operator.
|
|
638
|
+
* @param other Right hand side of assignment operation.
|
|
639
|
+
* @return A reference to lhs object.
|
|
640
|
+
*/
|
|
641
|
+
XLFonts& operator=(XLFonts&& other) noexcept;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* @brief Get the count of fonts
|
|
645
|
+
* @return The amount of font entries
|
|
646
|
+
*/
|
|
647
|
+
size_t count() const;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @brief Get the font identified by index
|
|
651
|
+
* @param index The index within the XML sequence
|
|
652
|
+
* @return An XLFont object
|
|
653
|
+
*/
|
|
654
|
+
XLFont fontByIndex(XLStyleIndex index) const;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* @brief Operator overload: allow [] as shortcut access to fontByIndex
|
|
658
|
+
* @param index The index within the XML sequence
|
|
659
|
+
* @return An XLFont object
|
|
660
|
+
*/
|
|
661
|
+
XLFont operator[](XLStyleIndex index) const { return fontByIndex(index); }
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* @brief Append a new XLFont, based on copyFrom, and return its index in fonts node
|
|
665
|
+
* @param copyFrom Can provide an XLFont to use as template for the new style
|
|
666
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
667
|
+
* @returns The index of the new style as used by operator[]
|
|
668
|
+
*/
|
|
669
|
+
XLStyleIndex create(XLFont copyFrom = XLFont{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
670
|
+
|
|
671
|
+
private: // ---------- Private Member Variables ---------- //
|
|
672
|
+
std::unique_ptr<XMLNode> m_fontsNode; /**< An XMLNode object with the fonts item */
|
|
673
|
+
std::vector<XLFont> m_fonts;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
// ================================================================================
|
|
678
|
+
// XLDataBarColor Class
|
|
679
|
+
// ================================================================================
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* @brief An encapsulation of an XLSX Data Bar Color (CT_Color) item
|
|
683
|
+
*/
|
|
684
|
+
class OPENXLSX_EXPORT XLDataBarColor
|
|
685
|
+
{
|
|
686
|
+
public:
|
|
687
|
+
/**
|
|
688
|
+
* @brief
|
|
689
|
+
*/
|
|
690
|
+
XLDataBarColor();
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @brief Constructor. New items should only be created through an XLGradientStop or XLLine object.
|
|
694
|
+
* @param node An XMLNode object with a data bar color XMLNode. If no input is provided, a null node is used.
|
|
695
|
+
*/
|
|
696
|
+
explicit XLDataBarColor(const XMLNode& node);
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* @brief Copy Constructor.
|
|
700
|
+
* @param other Object to be copied.
|
|
701
|
+
*/
|
|
702
|
+
XLDataBarColor(const XLDataBarColor& other);
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* @brief Move Constructor.
|
|
706
|
+
* @param other Object to be moved.
|
|
707
|
+
*/
|
|
708
|
+
XLDataBarColor(XLDataBarColor&& other) noexcept;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* @brief
|
|
712
|
+
*/
|
|
713
|
+
~XLDataBarColor();
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* @brief Copy assignment operator.
|
|
717
|
+
* @param other Right hand side of assignment operation.
|
|
718
|
+
* @return A reference to the lhs object.
|
|
719
|
+
*/
|
|
720
|
+
XLDataBarColor& operator=(const XLDataBarColor& other);
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* @brief Move assignment operator.
|
|
724
|
+
* @param other Right hand side of assignment operation.
|
|
725
|
+
* @return A reference to lhs object.
|
|
726
|
+
*/
|
|
727
|
+
XLDataBarColor& operator=(XLDataBarColor&& other) noexcept;
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* @brief Get the line color from the rgb attribute
|
|
731
|
+
* @return An XLColor object
|
|
732
|
+
*/
|
|
733
|
+
XLColor rgb() const;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* @brief Get the line color tint
|
|
737
|
+
* @return A double value as stored in the "tint" attribute (should be between [-1.0;+1.0]), 0.0 if attribute does not exist
|
|
738
|
+
*/
|
|
739
|
+
double tint() const;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* @brief currently unsupported getter stubs
|
|
743
|
+
*/
|
|
744
|
+
bool automatic() const; // <color auto="true" />
|
|
745
|
+
uint32_t indexed() const; // <color indexed="1" />
|
|
746
|
+
uint32_t theme() const; // <color theme="1" />
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* @brief Setter functions for data bar color parameters
|
|
750
|
+
* @param value that shall be set
|
|
751
|
+
* @return true for success, false for failure
|
|
752
|
+
*/
|
|
753
|
+
bool setRgb (XLColor newColor);
|
|
754
|
+
bool set (XLColor newColor) { return setRgb(newColor); } // alias for setRgb
|
|
755
|
+
bool setTint (double newTint);
|
|
756
|
+
bool setAutomatic(bool set = true);
|
|
757
|
+
bool setIndexed (uint32_t newIndex);
|
|
758
|
+
bool setTheme (uint32_t newTheme);
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* @brief Return a string summary of the color properties
|
|
762
|
+
* @return string with info about the color object
|
|
763
|
+
*/
|
|
764
|
+
std::string summary() const;
|
|
765
|
+
|
|
766
|
+
private: // ---------- Private Member Variables ---------- //
|
|
767
|
+
std::unique_ptr<XMLNode> m_colorNode; /**< An XMLNode object with the color item */
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
// ================================================================================
|
|
772
|
+
// XLFills Class
|
|
773
|
+
// ================================================================================
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* @brief An encapsulation of an fill::gradientFill::stop item
|
|
777
|
+
*/
|
|
778
|
+
class OPENXLSX_EXPORT XLGradientStop
|
|
779
|
+
{
|
|
780
|
+
friend class XLGradientStops; // for access to m_stopNode in XLGradientStops::create
|
|
781
|
+
public: // ---------- Public Member Functions ----------- //
|
|
782
|
+
/**
|
|
783
|
+
* @brief
|
|
784
|
+
*/
|
|
785
|
+
XLGradientStop();
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* @brief Constructor. New items should only be created through an XLGradientStops object.
|
|
789
|
+
* @param node An XMLNode object with the gradient stop XMLNode. If no input is provided, a null node is used.
|
|
790
|
+
*/
|
|
791
|
+
explicit XLGradientStop(const XMLNode& node);
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* @brief Copy Constructor.
|
|
795
|
+
* @param other Object to be copied.
|
|
796
|
+
*/
|
|
797
|
+
XLGradientStop(const XLGradientStop& other);
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* @brief Move Constructor.
|
|
801
|
+
* @param other Object to be moved.
|
|
802
|
+
*/
|
|
803
|
+
XLGradientStop(XLGradientStop&& other) noexcept;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* @brief
|
|
807
|
+
*/
|
|
808
|
+
~XLGradientStop();
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* @brief Copy assignment operator.
|
|
812
|
+
* @param other Right hand side of assignment operation.
|
|
813
|
+
* @return A reference to the lhs object.
|
|
814
|
+
*/
|
|
815
|
+
XLGradientStop& operator=(const XLGradientStop& other);
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* @brief Move assignment operator.
|
|
819
|
+
* @param other Right hand side of assignment operation.
|
|
820
|
+
* @return A reference to lhs object.
|
|
821
|
+
*/
|
|
822
|
+
XLGradientStop& operator=(XLGradientStop&& other) noexcept;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* @brief Getter functions
|
|
826
|
+
* @return The requested gradient stop property
|
|
827
|
+
*/
|
|
828
|
+
XLDataBarColor color() const; // <stop><color /></stop>
|
|
829
|
+
double position() const; // <stop position="1.2" />
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* @brief Setter functions
|
|
833
|
+
* @param value that shall be set
|
|
834
|
+
* @return true for success, false for failure
|
|
835
|
+
* @note for color setters, use the color() getter with the XLDataBarColor setter functions
|
|
836
|
+
*/
|
|
837
|
+
bool setPosition(double newPosition);
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* @brief Return a string summary of the stop properties
|
|
841
|
+
* @return string with info about the stop object
|
|
842
|
+
*/
|
|
843
|
+
std::string summary() const;
|
|
844
|
+
|
|
845
|
+
private: // ---------- Private Member Variables ---------- //
|
|
846
|
+
std::unique_ptr<XMLNode> m_stopNode; /**< An XMLNode object with the stop item */
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* @brief An encapsulation of an array of fill::gradientFill::stop items
|
|
851
|
+
*/
|
|
852
|
+
class OPENXLSX_EXPORT XLGradientStops
|
|
853
|
+
{
|
|
854
|
+
public: // ---------- Public Member Functions ---------- //
|
|
855
|
+
/**
|
|
856
|
+
* @brief
|
|
857
|
+
*/
|
|
858
|
+
XLGradientStops();
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* @brief Constructor. New items should only be created through an XLFill object.
|
|
862
|
+
* @param node An XMLNode object with the gradientFill item. If no input is provided, a null node is used.
|
|
863
|
+
*/
|
|
864
|
+
explicit XLGradientStops(const XMLNode& node);
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* @brief Copy Constructor.
|
|
868
|
+
* @param other Object to be copied.
|
|
869
|
+
*/
|
|
870
|
+
XLGradientStops(const XLGradientStops& other);
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* @brief Move Constructor.
|
|
874
|
+
* @param other Object to be moved.
|
|
875
|
+
*/
|
|
876
|
+
XLGradientStops(XLGradientStops&& other);
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* @brief
|
|
880
|
+
*/
|
|
881
|
+
~XLGradientStops();
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* @brief Copy assignment operator.
|
|
885
|
+
* @param other Right hand side of assignment operation.
|
|
886
|
+
* @return A reference to the lhs object.
|
|
887
|
+
*/
|
|
888
|
+
XLGradientStops& operator=(const XLGradientStops& other);
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* @brief Move assignment operator.
|
|
892
|
+
* @param other Right hand side of assignment operation.
|
|
893
|
+
* @return A reference to lhs object.
|
|
894
|
+
*/
|
|
895
|
+
XLGradientStops& operator=(XLGradientStops&& other) noexcept;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* @brief Get the count of gradient stops
|
|
899
|
+
* @return The amount of stop entries
|
|
900
|
+
*/
|
|
901
|
+
size_t count() const;
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* @brief Get the gradient stop entry identified by index
|
|
905
|
+
* @param index The index within the XML sequence
|
|
906
|
+
* @return An XLGradientStop object
|
|
907
|
+
*/
|
|
908
|
+
XLGradientStop stopByIndex(XLStyleIndex index) const;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* @brief Operator overload: allow [] as shortcut access to stopByIndex
|
|
912
|
+
* @param index The index within the XML sequence
|
|
913
|
+
* @return An XLGradientStop object
|
|
914
|
+
*/
|
|
915
|
+
XLGradientStop operator[](XLStyleIndex index) const { return stopByIndex(index); }
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* @brief Append a new XLGradientStop, based on copyFrom, and return its index in fills node
|
|
919
|
+
* @param copyFrom Can provide an XLGradientStop to use as template for the new style
|
|
920
|
+
* @param stopEntriesPrefix Prefix the newly created stop XMLNode with this pugi::node_pcdata text
|
|
921
|
+
* @returns The index of the new style as used by operator[]
|
|
922
|
+
*/
|
|
923
|
+
XLStyleIndex create(XLGradientStop copyFrom = XLGradientStop{}, std::string styleEntriesPrefix = "");
|
|
924
|
+
|
|
925
|
+
std::string summary() const;
|
|
926
|
+
|
|
927
|
+
private:
|
|
928
|
+
std::unique_ptr<XMLNode> m_gradientNode; /**< An XMLNode object with the gradientFill item */
|
|
929
|
+
std::vector<XLGradientStop> m_gradientStops;
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* @brief An encapsulation of a fill item
|
|
934
|
+
*/
|
|
935
|
+
class OPENXLSX_EXPORT XLFill
|
|
936
|
+
{
|
|
937
|
+
friend class XLFills; // for access to m_fillNode in XLFills::create
|
|
938
|
+
public: // ---------- Public Member Functions ----------- //
|
|
939
|
+
/**
|
|
940
|
+
* @brief
|
|
941
|
+
*/
|
|
942
|
+
XLFill();
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
946
|
+
* @param node An XMLNode object with the fill XMLNode. If no input is provided, a null node is used.
|
|
947
|
+
*/
|
|
948
|
+
explicit XLFill(const XMLNode& node);
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* @brief Copy Constructor.
|
|
952
|
+
* @param other Object to be copied.
|
|
953
|
+
*/
|
|
954
|
+
XLFill(const XLFill& other);
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* @brief Move Constructor.
|
|
958
|
+
* @param other Object to be moved.
|
|
959
|
+
*/
|
|
960
|
+
XLFill(XLFill&& other) noexcept;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* @brief
|
|
964
|
+
*/
|
|
965
|
+
~XLFill();
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* @brief Copy assignment operator.
|
|
969
|
+
* @param other Right hand side of assignment operation.
|
|
970
|
+
* @return A reference to the lhs object.
|
|
971
|
+
*/
|
|
972
|
+
XLFill& operator=(const XLFill& other);
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* @brief Move assignment operator.
|
|
976
|
+
* @param other Right hand side of assignment operation.
|
|
977
|
+
* @return A reference to lhs object.
|
|
978
|
+
*/
|
|
979
|
+
XLFill& operator=(XLFill&& other) noexcept;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* @brief Get the name of the element describing a fill
|
|
983
|
+
* @return The XLFillType derived from the name of the first child element of the fill node
|
|
984
|
+
*/
|
|
985
|
+
XLFillType fillType() const;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* @brief Create & set the base XML element describing the fill
|
|
989
|
+
* @param newFillType that shall be set
|
|
990
|
+
* @param force erase an existing fillType() if not equal newFillType
|
|
991
|
+
* @return true for success, false for failure
|
|
992
|
+
*/
|
|
993
|
+
bool setFillType(XLFillType newFillType, bool force = false);
|
|
994
|
+
|
|
995
|
+
private: // ---------- Switch to private context for two Methods --------- //
|
|
996
|
+
/**
|
|
997
|
+
* @brief Throw XLException if fillType() matches typeToThrowOn
|
|
998
|
+
* @param typeToThrowOn throw on this
|
|
999
|
+
* @param functionName include this (calling function name) in the exception
|
|
1000
|
+
*/
|
|
1001
|
+
void throwOnFillType(XLFillType typeToThrowOn, const char *functionName) const;
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* @brief Fetch a valid first element child of m_fillNode. Create with default if needed
|
|
1005
|
+
* @param fillTypeIfEmpty if no conflicting fill type exists, create a node with this fill type
|
|
1006
|
+
* @param functionName include this (calling function name) in a potential exception
|
|
1007
|
+
* @return An XMLNode containing a fill description
|
|
1008
|
+
* @throw XLException if fillTypeIfEmpty is in conflict with a current fillType()
|
|
1009
|
+
*/
|
|
1010
|
+
XMLNode getValidFillDescription(XLFillType fillTypeIfEmpty, const char *functionName);
|
|
1011
|
+
|
|
1012
|
+
public: // ---------- Switch back to public context ---------------------- //
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* @brief Getter functions for gradientFill - will throwOnFillType(XLPatternFill, __func__)
|
|
1016
|
+
* @return The requested gradientFill property
|
|
1017
|
+
*/
|
|
1018
|
+
XLGradientType gradientType(); // <gradientFill type="path" />
|
|
1019
|
+
double degree();
|
|
1020
|
+
double left();
|
|
1021
|
+
double right();
|
|
1022
|
+
double top();
|
|
1023
|
+
double bottom();
|
|
1024
|
+
XLGradientStops stops();
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* @brief Getter functions for patternFill - will throwOnFillType(XLGradientFill, __func__)
|
|
1028
|
+
* @return The requested patternFill property
|
|
1029
|
+
*/
|
|
1030
|
+
XLPatternType patternType();
|
|
1031
|
+
XLColor color();
|
|
1032
|
+
XLColor backgroundColor();
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* @brief Setter functions for gradientFill - will throwOnFillType(XLPatternFill, __func__)
|
|
1036
|
+
* @param value that shall be set
|
|
1037
|
+
* @return true for success, false for failure
|
|
1038
|
+
* @note for gradient stops, use the stops() getter with the XLGradientStops access functions (create, stopByIndex, [])
|
|
1039
|
+
* and the XLGradientStop setter functions
|
|
1040
|
+
*/
|
|
1041
|
+
bool setGradientType(XLGradientType newType);
|
|
1042
|
+
bool setDegree(double newDegree);
|
|
1043
|
+
bool setLeft(double newLeft);
|
|
1044
|
+
bool setRight(double newRight);
|
|
1045
|
+
bool setTop(double newTop);
|
|
1046
|
+
bool setBottom(double newBottom);
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* @brief Setter functions for patternFill - will throwOnFillType(XLGradientFill, __func__)
|
|
1050
|
+
* @param value that shall be set
|
|
1051
|
+
* @return true for success, false for failure
|
|
1052
|
+
*/
|
|
1053
|
+
bool setPatternType(XLPatternType newPatternType);
|
|
1054
|
+
bool setColor(XLColor newColor);
|
|
1055
|
+
bool setBackgroundColor(XLColor newBgColor);
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* @brief Return a string summary of the fill properties
|
|
1059
|
+
* @return string with info about the fill object
|
|
1060
|
+
*/
|
|
1061
|
+
std::string summary();
|
|
1062
|
+
|
|
1063
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1064
|
+
std::unique_ptr<XMLNode> m_fillNode; /**< An XMLNode object with the fill item */
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* @brief An encapsulation of the XLSX fills
|
|
1070
|
+
*/
|
|
1071
|
+
class OPENXLSX_EXPORT XLFills
|
|
1072
|
+
{
|
|
1073
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1074
|
+
/**
|
|
1075
|
+
* @brief
|
|
1076
|
+
*/
|
|
1077
|
+
XLFills();
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1081
|
+
* @param node An XMLNode object with the fills item. If no input is provided, a null node is used.
|
|
1082
|
+
*/
|
|
1083
|
+
explicit XLFills(const XMLNode& node);
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* @brief Copy Constructor.
|
|
1087
|
+
* @param other Object to be copied.
|
|
1088
|
+
*/
|
|
1089
|
+
XLFills(const XLFills& other);
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* @brief Move Constructor.
|
|
1093
|
+
* @param other Object to be moved.
|
|
1094
|
+
*/
|
|
1095
|
+
XLFills(XLFills&& other);
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* @brief
|
|
1099
|
+
*/
|
|
1100
|
+
~XLFills();
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* @brief Copy assignment operator.
|
|
1104
|
+
* @param other Right hand side of assignment operation.
|
|
1105
|
+
* @return A reference to the lhs object.
|
|
1106
|
+
*/
|
|
1107
|
+
XLFills& operator=(const XLFills& other);
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* @brief Move assignment operator.
|
|
1111
|
+
* @param other Right hand side of assignment operation.
|
|
1112
|
+
* @return A reference to lhs object.
|
|
1113
|
+
*/
|
|
1114
|
+
XLFills& operator=(XLFills&& other) noexcept;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* @brief Get the count of fills
|
|
1118
|
+
* @return The amount of fill entries
|
|
1119
|
+
*/
|
|
1120
|
+
size_t count() const;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* @brief Get the fill entry identified by index
|
|
1124
|
+
* @param index The index within the XML sequence
|
|
1125
|
+
* @return An XLFill object
|
|
1126
|
+
*/
|
|
1127
|
+
XLFill fillByIndex(XLStyleIndex index) const;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* @brief Operator overload: allow [] as shortcut access to fillByIndex
|
|
1131
|
+
* @param index The index within the XML sequence
|
|
1132
|
+
* @return An XLFill object
|
|
1133
|
+
*/
|
|
1134
|
+
XLFill operator[](XLStyleIndex index) const { return fillByIndex(index); }
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* @brief Append a new XLFill, based on copyFrom, and return its index in fills node
|
|
1138
|
+
* @param copyFrom Can provide an XLFill to use as template for the new style
|
|
1139
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
1140
|
+
* @returns The index of the new style as used by operator[]
|
|
1141
|
+
*/
|
|
1142
|
+
XLStyleIndex create(XLFill copyFrom = XLFill{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
1143
|
+
|
|
1144
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1145
|
+
std::unique_ptr<XMLNode> m_fillsNode; /**< An XMLNode object with the fills item */
|
|
1146
|
+
std::vector<XLFill> m_fills;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
// ================================================================================
|
|
1151
|
+
// XLBorders Class
|
|
1152
|
+
// ================================================================================
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* @brief An encapsulation of a line item
|
|
1156
|
+
*/
|
|
1157
|
+
class OPENXLSX_EXPORT XLLine
|
|
1158
|
+
{
|
|
1159
|
+
// friend class TBD: XLBorder or XLBorders; // for access to m_lineNode in TBD
|
|
1160
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1161
|
+
/**
|
|
1162
|
+
* @brief
|
|
1163
|
+
*/
|
|
1164
|
+
XLLine();
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* @brief Constructor. New items should only be created through an XLBorder object.
|
|
1168
|
+
* @param node An XMLNode object with the line XMLNode. If no input is provided, a null node is used.
|
|
1169
|
+
*/
|
|
1170
|
+
explicit XLLine(const XMLNode& node);
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* @brief Copy Constructor.
|
|
1174
|
+
* @param other Object to be copied.
|
|
1175
|
+
*/
|
|
1176
|
+
XLLine(const XLLine& other);
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* @brief Move Constructor.
|
|
1180
|
+
* @param other Object to be moved.
|
|
1181
|
+
*/
|
|
1182
|
+
XLLine(XLLine&& other) noexcept;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* @brief
|
|
1186
|
+
*/
|
|
1187
|
+
~XLLine();
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* @brief Copy assignment operator.
|
|
1191
|
+
* @param other Right hand side of assignment operation.
|
|
1192
|
+
* @return A reference to the lhs object.
|
|
1193
|
+
*/
|
|
1194
|
+
XLLine& operator=(const XLLine& other);
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* @brief Move assignment operator.
|
|
1198
|
+
* @param other Right hand side of assignment operation.
|
|
1199
|
+
* @return A reference to lhs object.
|
|
1200
|
+
*/
|
|
1201
|
+
XLLine& operator=(XLLine&& other) noexcept;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* @brief Get the line style
|
|
1205
|
+
* @return An XLLineStyle enum
|
|
1206
|
+
*/
|
|
1207
|
+
XLLineStyle style() const;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* @brief Evaluate XLLine as bool
|
|
1211
|
+
* @return true if line is set, false if not
|
|
1212
|
+
*/
|
|
1213
|
+
explicit operator bool() const;
|
|
1214
|
+
|
|
1215
|
+
XLDataBarColor color() const; // <line><color /></line> where node can be left, right, top, bottom, diagonal, vertical, horizontal
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* @note Regarding setter functions for style parameters:
|
|
1219
|
+
* @note Please refer to XLBorder setLine / setLeft / setRight / setTop / setBottom / setDiagonal
|
|
1220
|
+
* @note and XLDataBarColor setter functions that can be invoked via color()
|
|
1221
|
+
*/
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* @brief Return a string summary of the line properties
|
|
1225
|
+
* @return string with info about the line object
|
|
1226
|
+
*/
|
|
1227
|
+
std::string summary() const;
|
|
1228
|
+
|
|
1229
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1230
|
+
std::unique_ptr<XMLNode> m_lineNode; /**< An XMLNode object with the line item */
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* @brief An encapsulation of a border item
|
|
1236
|
+
*/
|
|
1237
|
+
class OPENXLSX_EXPORT XLBorder
|
|
1238
|
+
{
|
|
1239
|
+
friend class XLBorders; // for access to m_borderNode in XLBorders::create
|
|
1240
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1241
|
+
/**
|
|
1242
|
+
* @brief
|
|
1243
|
+
*/
|
|
1244
|
+
XLBorder();
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1248
|
+
* @param node An XMLNode object with the border XMLNode. If no input is provided, a null node is used.
|
|
1249
|
+
*/
|
|
1250
|
+
explicit XLBorder(const XMLNode& node);
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* @brief Copy Constructor.
|
|
1254
|
+
* @param other Object to be copied.
|
|
1255
|
+
*/
|
|
1256
|
+
XLBorder(const XLBorder& other);
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* @brief Move Constructor.
|
|
1260
|
+
* @param other Object to be moved.
|
|
1261
|
+
*/
|
|
1262
|
+
XLBorder(XLBorder&& other) noexcept;
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* @brief
|
|
1266
|
+
*/
|
|
1267
|
+
~XLBorder();
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* @brief Copy assignment operator.
|
|
1271
|
+
* @param other Right hand side of assignment operation.
|
|
1272
|
+
* @return A reference to the lhs object.
|
|
1273
|
+
*/
|
|
1274
|
+
XLBorder& operator=(const XLBorder& other);
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* @brief Move assignment operator.
|
|
1278
|
+
* @param other Right hand side of assignment operation.
|
|
1279
|
+
* @return A reference to lhs object.
|
|
1280
|
+
*/
|
|
1281
|
+
XLBorder& operator=(XLBorder&& other) noexcept;
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* @brief Get the diagonal up property
|
|
1285
|
+
* @return true if set, otherwise false
|
|
1286
|
+
*/
|
|
1287
|
+
bool diagonalUp() const;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @brief Get the diagonal down property
|
|
1291
|
+
* @return true if set, otherwise false
|
|
1292
|
+
*/
|
|
1293
|
+
bool diagonalDown() const;
|
|
1294
|
+
|
|
1295
|
+
/**
|
|
1296
|
+
* @brief Get the outline property
|
|
1297
|
+
* @return true if set, otherwise false
|
|
1298
|
+
*/
|
|
1299
|
+
bool outline() const;
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* @brief Get the left line property
|
|
1303
|
+
* @return An XLLine object
|
|
1304
|
+
*/
|
|
1305
|
+
XLLine left() const;
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* @brief Get the left line property
|
|
1309
|
+
* @return An XLLine object
|
|
1310
|
+
*/
|
|
1311
|
+
XLLine right() const;
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* @brief Get the left line property
|
|
1315
|
+
* @return An XLLine object
|
|
1316
|
+
*/
|
|
1317
|
+
XLLine top() const;
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* @brief Get the bottom line property
|
|
1321
|
+
* @return An XLLine object
|
|
1322
|
+
*/
|
|
1323
|
+
XLLine bottom() const;
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* @brief Get the diagonal line property
|
|
1327
|
+
* @return An XLLine object
|
|
1328
|
+
*/
|
|
1329
|
+
XLLine diagonal() const;
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* @brief Get the vertical line property
|
|
1333
|
+
* @return An XLLine object
|
|
1334
|
+
*/
|
|
1335
|
+
XLLine vertical() const;
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* @brief Get the horizontal line property
|
|
1339
|
+
* @return An XLLine object
|
|
1340
|
+
*/
|
|
1341
|
+
XLLine horizontal() const;
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* @brief Setter functions for style parameters
|
|
1345
|
+
* @param value that shall be set
|
|
1346
|
+
* @param value2 (optional) that shall be set
|
|
1347
|
+
* @return true for success, false for failure
|
|
1348
|
+
*/
|
|
1349
|
+
bool setDiagonalUp (bool set = true);
|
|
1350
|
+
bool setDiagonalDown(bool set = true);
|
|
1351
|
+
bool setOutline (bool set = true);
|
|
1352
|
+
bool setLine (XLLineType lineType, XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1353
|
+
bool setLeft ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1354
|
+
bool setRight ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1355
|
+
bool setTop ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1356
|
+
bool setBottom ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1357
|
+
bool setDiagonal ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1358
|
+
bool setVertical ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1359
|
+
bool setHorizontal ( XLLineStyle lineStyle, XLColor lineColor, double lineTint = 0.0);
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* @brief Return a string summary of the font properties
|
|
1363
|
+
* @return string with info about the font object
|
|
1364
|
+
*/
|
|
1365
|
+
std::string summary() const;
|
|
1366
|
+
|
|
1367
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1368
|
+
std::unique_ptr<XMLNode> m_borderNode; /**< An XMLNode object with the font item */
|
|
1369
|
+
inline static const std::vector< std::string_view > m_nodeOrder = { "left", "right", "top", "bottom", "diagonal", "vertical", "horizontal" };
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* @brief An encapsulation of the XLSX borders
|
|
1375
|
+
*/
|
|
1376
|
+
class OPENXLSX_EXPORT XLBorders
|
|
1377
|
+
{
|
|
1378
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1379
|
+
/**
|
|
1380
|
+
* @brief
|
|
1381
|
+
*/
|
|
1382
|
+
XLBorders();
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1386
|
+
* @param node An XMLNode object with the borders item. If no input is provided, a null node is used.
|
|
1387
|
+
*/
|
|
1388
|
+
explicit XLBorders(const XMLNode& node);
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* @brief Copy Constructor.
|
|
1392
|
+
* @param other Object to be copied.
|
|
1393
|
+
*/
|
|
1394
|
+
XLBorders(const XLBorders& other);
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* @brief Move Constructor.
|
|
1398
|
+
* @param other Object to be moved.
|
|
1399
|
+
*/
|
|
1400
|
+
XLBorders(XLBorders&& other);
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* @brief
|
|
1404
|
+
*/
|
|
1405
|
+
~XLBorders();
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* @brief Copy assignment operator.
|
|
1409
|
+
* @param other Right hand side of assignment operation.
|
|
1410
|
+
* @return A reference to the lhs object.
|
|
1411
|
+
*/
|
|
1412
|
+
XLBorders& operator=(const XLBorders& other);
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* @brief Move assignment operator.
|
|
1416
|
+
* @param other Right hand side of assignment operation.
|
|
1417
|
+
* @return A reference to lhs object.
|
|
1418
|
+
*/
|
|
1419
|
+
XLBorders& operator=(XLBorders&& other) noexcept;
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* @brief Get the count of border descriptions
|
|
1423
|
+
* @return The amount of border description entries
|
|
1424
|
+
*/
|
|
1425
|
+
size_t count() const;
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* @brief Get the border description identified by index
|
|
1429
|
+
* @param index The index within the XML sequence
|
|
1430
|
+
* @return An XLBorder object
|
|
1431
|
+
*/
|
|
1432
|
+
XLBorder borderByIndex(XLStyleIndex index) const;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* @brief Operator overload: allow [] as shortcut access to borderByIndex
|
|
1436
|
+
* @param index The index within the XML sequence
|
|
1437
|
+
* @return An XLBorder object
|
|
1438
|
+
*/
|
|
1439
|
+
XLBorder operator[](XLStyleIndex index) const { return borderByIndex(index); }
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* @brief Append a new XLBorder, based on copyFrom, and return its index in borders node
|
|
1443
|
+
* @param copyFrom Can provide an XLBorder to use as template for the new style
|
|
1444
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
1445
|
+
* @returns The index of the new style as used by operator[]
|
|
1446
|
+
*/
|
|
1447
|
+
XLStyleIndex create(XLBorder copyFrom = XLBorder{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
1448
|
+
|
|
1449
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1450
|
+
std::unique_ptr<XMLNode> m_bordersNode; /**< An XMLNode object with the borders item */
|
|
1451
|
+
std::vector<XLBorder> m_borders;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
// ================================================================================
|
|
1456
|
+
// XLCellFormats Class
|
|
1457
|
+
// ================================================================================
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @brief An encapsulation of an alignment item
|
|
1461
|
+
*/
|
|
1462
|
+
class OPENXLSX_EXPORT XLAlignment
|
|
1463
|
+
{
|
|
1464
|
+
// friend class TBD: XLCellFormat or XLCellFormats; // for access to m_alignmentNode in TBD
|
|
1465
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1466
|
+
/**
|
|
1467
|
+
* @brief
|
|
1468
|
+
*/
|
|
1469
|
+
XLAlignment();
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* @brief Constructor. New items should only be created through an XLBorder object.
|
|
1473
|
+
* @param node An XMLNode object with the alignment XMLNode. If no input is provided, a null node is used.
|
|
1474
|
+
*/
|
|
1475
|
+
explicit XLAlignment(const XMLNode& node);
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* @brief Copy Constructor.
|
|
1479
|
+
* @param other Object to be copied.
|
|
1480
|
+
*/
|
|
1481
|
+
XLAlignment(const XLAlignment& other);
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* @brief Move Constructor.
|
|
1485
|
+
* @param other Object to be moved.
|
|
1486
|
+
*/
|
|
1487
|
+
XLAlignment(XLAlignment&& other) noexcept;
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* @brief
|
|
1491
|
+
*/
|
|
1492
|
+
~XLAlignment();
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* @brief Copy assignment operator.
|
|
1496
|
+
* @param other Right hand side of assignment operation.
|
|
1497
|
+
* @return A reference to the lhs object.
|
|
1498
|
+
*/
|
|
1499
|
+
XLAlignment& operator=(const XLAlignment& other);
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* @brief Move assignment operator.
|
|
1503
|
+
* @param other Right hand side of assignment operation.
|
|
1504
|
+
* @return A reference to lhs object.
|
|
1505
|
+
*/
|
|
1506
|
+
XLAlignment& operator=(XLAlignment&& other) noexcept;
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* @brief Get the horizontal alignment
|
|
1510
|
+
* @return An XLAlignmentStyle
|
|
1511
|
+
*/
|
|
1512
|
+
XLAlignmentStyle horizontal() const;
|
|
1513
|
+
|
|
1514
|
+
/**
|
|
1515
|
+
* @brief Get the vertical alignment
|
|
1516
|
+
* @return An XLAlignmentStyle
|
|
1517
|
+
*/
|
|
1518
|
+
XLAlignmentStyle vertical() const;
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* @brief Get the text rotation
|
|
1522
|
+
* @return A value in degrees (TBD: clockwise? counter-clockwise?)
|
|
1523
|
+
*/
|
|
1524
|
+
uint16_t textRotation() const;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* @brief Check whether text wrapping is enabled
|
|
1528
|
+
* @return true if enabled, false otherwise
|
|
1529
|
+
*/
|
|
1530
|
+
bool wrapText() const;
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* @brief Get the indent setting
|
|
1534
|
+
* @return An integer value, where an increment of 1 represents 3 spaces.
|
|
1535
|
+
*/
|
|
1536
|
+
uint32_t indent() const;
|
|
1537
|
+
|
|
1538
|
+
/**
|
|
1539
|
+
* @brief Get the relative indent setting
|
|
1540
|
+
* @return An integer value, where an increment of 1 represents 1 space, in addition to indent()*3 spaces
|
|
1541
|
+
* @note can be negative
|
|
1542
|
+
*/
|
|
1543
|
+
int32_t relativeIndent() const;
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* @brief Check whether justification of last line is enabled
|
|
1547
|
+
* @return true if enabled, false otherwise
|
|
1548
|
+
*/
|
|
1549
|
+
bool justifyLastLine() const;
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* @brief Check whether shrink to fit is enabled
|
|
1553
|
+
* @return true if enabled, false otherwise
|
|
1554
|
+
*/
|
|
1555
|
+
bool shrinkToFit() const;
|
|
1556
|
+
|
|
1557
|
+
/**
|
|
1558
|
+
* @brief Get the reading order setting
|
|
1559
|
+
* @return An integer value: 0 - Context Dependent, 1 - Left-to-Right, 2 - Right-to-Left (any other value should be invalid)
|
|
1560
|
+
*/
|
|
1561
|
+
uint32_t readingOrder() const;
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* @brief Setter functions for style parameters
|
|
1565
|
+
* @param value that shall be set
|
|
1566
|
+
* @return true for success, false for failure
|
|
1567
|
+
*/
|
|
1568
|
+
bool setHorizontal (XLAlignmentStyle newStyle);
|
|
1569
|
+
bool setVertical (XLAlignmentStyle newStyle);
|
|
1570
|
+
/**
|
|
1571
|
+
* @details on setTextRotation from XLSX specification:
|
|
1572
|
+
* Text rotation in cells. Expressed in degrees. Values range from 0 to 180. The first letter of the text
|
|
1573
|
+
* is considered the center-point of the arc.
|
|
1574
|
+
* For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
|
|
1575
|
+
* [degrees below horizon] = 90 - [newRotation].
|
|
1576
|
+
* Examples: setTextRotation( 45): / (text is formatted along a line from lower left to upper right)
|
|
1577
|
+
* setTextRotation(135): \ (text is formatted along a line from upper left to lower right)
|
|
1578
|
+
*/
|
|
1579
|
+
bool setTextRotation (uint16_t newRotation);
|
|
1580
|
+
bool setWrapText (bool set = true);
|
|
1581
|
+
bool setIndent (uint32_t newIndent);
|
|
1582
|
+
bool setRelativeIndent (int32_t newIndent);
|
|
1583
|
+
bool setJustifyLastLine(bool set = true);
|
|
1584
|
+
bool setShrinkToFit (bool set = true);
|
|
1585
|
+
bool setReadingOrder (uint32_t newReadingOrder); // can be used with XLReadingOrderContextual, XLReadingOrderLeftToRight, XLReadingOrderRightToLeft
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* @brief Return a string summary of the alignment properties
|
|
1589
|
+
* @return string with info about the alignment object
|
|
1590
|
+
*/
|
|
1591
|
+
std::string summary() const;
|
|
1592
|
+
|
|
1593
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1594
|
+
std::unique_ptr<XMLNode> m_alignmentNode; /**< An XMLNode object with the alignment item */
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* @brief An encapsulation of a cell format item
|
|
1600
|
+
*/
|
|
1601
|
+
class OPENXLSX_EXPORT XLCellFormat
|
|
1602
|
+
{
|
|
1603
|
+
friend class XLCellFormats; // for access to m_cellFormatNode in XLCellFormats::create
|
|
1604
|
+
|
|
1605
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1606
|
+
/**
|
|
1607
|
+
* @brief
|
|
1608
|
+
*/
|
|
1609
|
+
XLCellFormat();
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1613
|
+
* @param node An XMLNode object with the xf XMLNode. If no input is provided, a null node is used.
|
|
1614
|
+
* @param permitXfId true (XLPermitXfID) -> getter xfId and setter setXfId are enabled, otherwise will throw XLException if invoked
|
|
1615
|
+
*/
|
|
1616
|
+
explicit XLCellFormat(const XMLNode& node, bool permitXfId);
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* @brief Copy Constructor.
|
|
1620
|
+
* @param other Object to be copied.
|
|
1621
|
+
*/
|
|
1622
|
+
XLCellFormat(const XLCellFormat& other);
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* @brief Move Constructor.
|
|
1626
|
+
* @param other Object to be moved.
|
|
1627
|
+
*/
|
|
1628
|
+
XLCellFormat(XLCellFormat&& other) noexcept;
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* @brief
|
|
1632
|
+
*/
|
|
1633
|
+
~XLCellFormat();
|
|
1634
|
+
|
|
1635
|
+
/**
|
|
1636
|
+
* @brief Copy assignment operator.
|
|
1637
|
+
* @param other Right hand side of assignment operation.
|
|
1638
|
+
* @return A reference to the lhs object.
|
|
1639
|
+
*/
|
|
1640
|
+
XLCellFormat& operator=(const XLCellFormat& other);
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* @brief Move assignment operator.
|
|
1644
|
+
* @param other Right hand side of assignment operation.
|
|
1645
|
+
* @return A reference to lhs object.
|
|
1646
|
+
*/
|
|
1647
|
+
XLCellFormat& operator=(XLCellFormat&& other) noexcept;
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* @brief Get the number format id
|
|
1651
|
+
* @return The identifier of a number format, built-in (predefined by office) or defind in XLNumberFormats
|
|
1652
|
+
*/
|
|
1653
|
+
uint32_t numberFormatId() const;
|
|
1654
|
+
|
|
1655
|
+
/**
|
|
1656
|
+
* @brief Get the font index
|
|
1657
|
+
* @return The index(!) of a font as defined in XLFonts
|
|
1658
|
+
*/
|
|
1659
|
+
XLStyleIndex fontIndex() const;
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* @brief Get the fill index
|
|
1663
|
+
* @return The index(!) of a fill as defined in XLFills
|
|
1664
|
+
*/
|
|
1665
|
+
XLStyleIndex fillIndex() const;
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* @brief Get the border index
|
|
1669
|
+
* @return The index(!) of a border as defined in XLBorders
|
|
1670
|
+
*/
|
|
1671
|
+
XLStyleIndex borderIndex() const;
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* @brief Get the id of a referred <xf> entry
|
|
1675
|
+
* @return The id referring to an index in cell style formats (cellStyleXfs)
|
|
1676
|
+
* @throw XLException when invoked from cellStyleFormats
|
|
1677
|
+
* @note - only permitted for cellFormats
|
|
1678
|
+
*/
|
|
1679
|
+
XLStyleIndex xfId() const;
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* @brief Report whether number format is applied
|
|
1683
|
+
* @return true for a setting enabled, or false if disabled
|
|
1684
|
+
*/
|
|
1685
|
+
bool applyNumberFormat() const;
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* @brief Report whether font is applied
|
|
1689
|
+
* @return true for a setting enabled, or false if disabled
|
|
1690
|
+
*/
|
|
1691
|
+
bool applyFont() const;
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* @brief Report whether fill is applied
|
|
1695
|
+
* @return true for a setting enabled, or false if disabled
|
|
1696
|
+
*/
|
|
1697
|
+
bool applyFill() const;
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* @brief Report whether border is applied
|
|
1701
|
+
* @return true for a setting enabled, or false if disabled
|
|
1702
|
+
*/
|
|
1703
|
+
bool applyBorder() const;
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* @brief Report whether alignment is applied
|
|
1707
|
+
* @return true for a setting enabled, or false if disabled
|
|
1708
|
+
*/
|
|
1709
|
+
bool applyAlignment() const;
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* @brief Report whether protection is applied
|
|
1713
|
+
* @return true for a setting enabled, or false if disabled
|
|
1714
|
+
*/
|
|
1715
|
+
bool applyProtection() const;
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* @brief Report whether quotePrefix is enabled
|
|
1719
|
+
* @return true for a setting enabled, or false if disabled
|
|
1720
|
+
* @note from documentation: A boolean value indicating whether the text string in a cell should be prefixed by a single quote mark
|
|
1721
|
+
* (e.g., 'text). In these cases, the quote is not stored in the Shared Strings Part.
|
|
1722
|
+
*/
|
|
1723
|
+
bool quotePrefix() const;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* @brief Report whether pivot button is applied
|
|
1727
|
+
* @return true for a setting enabled, or false if disabled
|
|
1728
|
+
* @note from documentation: A boolean value indicating whether the cell rendering includes a pivot table dropdown button.
|
|
1729
|
+
* @todo need to find a use case for this
|
|
1730
|
+
*/
|
|
1731
|
+
bool pivotButton() const;
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* @brief Report whether protection locked is applied
|
|
1735
|
+
* @return true for a setting enabled, or false if disabled
|
|
1736
|
+
*/
|
|
1737
|
+
bool locked() const;
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* @brief Report whether protection hidden is applied
|
|
1741
|
+
* @return true for a setting enabled, or false if disabled
|
|
1742
|
+
*/
|
|
1743
|
+
bool hidden() const;
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* @brief Return a reference to applicable alignment
|
|
1747
|
+
* @param createIfMissing triggers creation of alignment node - should be used with setter functions of XLAlignment
|
|
1748
|
+
* @return An XLAlignment object reference
|
|
1749
|
+
*/
|
|
1750
|
+
XLAlignment alignment(bool createIfMissing = false) const;
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* @brief Unsupported getter
|
|
1754
|
+
*/
|
|
1755
|
+
XLUnsupportedElement extLst() const { return XLUnsupportedElement{}; } // <xf><extLst>...</extLst></xf>
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @brief Setter functions for style parameters
|
|
1759
|
+
* @param value that shall be set
|
|
1760
|
+
* @return true for success, false for failure
|
|
1761
|
+
*/
|
|
1762
|
+
bool setNumberFormatId (uint32_t newNumFmtId);
|
|
1763
|
+
bool setFontIndex (XLStyleIndex newFontIndex);
|
|
1764
|
+
bool setFillIndex (XLStyleIndex newFillIndex);
|
|
1765
|
+
bool setBorderIndex (XLStyleIndex newBorderIndex);
|
|
1766
|
+
bool setXfId (XLStyleIndex newXfId); // NOTE: throws when invoked from cellStyleFormats
|
|
1767
|
+
bool setApplyNumberFormat(bool set = true);
|
|
1768
|
+
bool setApplyFont (bool set = true);
|
|
1769
|
+
bool setApplyFill (bool set = true);
|
|
1770
|
+
bool setApplyBorder (bool set = true);
|
|
1771
|
+
bool setApplyAlignment (bool set = true);
|
|
1772
|
+
bool setApplyProtection (bool set = true);
|
|
1773
|
+
bool setQuotePrefix (bool set = true);
|
|
1774
|
+
bool setPivotButton (bool set = true);
|
|
1775
|
+
bool setLocked (bool set = true);
|
|
1776
|
+
bool setHidden (bool set = true);
|
|
1777
|
+
/**
|
|
1778
|
+
* @brief Unsupported setter
|
|
1779
|
+
*/
|
|
1780
|
+
bool setExtLst (XLUnsupportedElement const& newExtLst);
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* @brief Return a string summary of the cell format properties
|
|
1784
|
+
* @return string with info about the cell format object
|
|
1785
|
+
*/
|
|
1786
|
+
std::string summary() const;
|
|
1787
|
+
|
|
1788
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1789
|
+
std::unique_ptr<XMLNode> m_cellFormatNode; /**< An XMLNode object with the cell format (xf) item */
|
|
1790
|
+
bool m_permitXfId{false};
|
|
1791
|
+
inline static const std::vector< std::string_view > m_nodeOrder = { "alignment", "protection" };
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* @brief An encapsulation of the XLSX cell style formats
|
|
1797
|
+
*/
|
|
1798
|
+
class OPENXLSX_EXPORT XLCellFormats
|
|
1799
|
+
{
|
|
1800
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1801
|
+
/**
|
|
1802
|
+
* @brief
|
|
1803
|
+
*/
|
|
1804
|
+
XLCellFormats();
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1808
|
+
* @param node An XMLNode object with the cell formats (cellXfs or cellStyleXfs) item. If no input is provided, a null node is used.
|
|
1809
|
+
* @param permitXfId Pass-through to XLCellFormat constructor: true (XLPermitXfID) -> setter setXfId is enabled, otherwise throws
|
|
1810
|
+
*/
|
|
1811
|
+
explicit XLCellFormats(const XMLNode& node, bool permitXfId = false);
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* @brief Copy Constructor.
|
|
1815
|
+
* @param other Object to be copied.
|
|
1816
|
+
*/
|
|
1817
|
+
XLCellFormats(const XLCellFormats& other);
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* @brief Move Constructor.
|
|
1821
|
+
* @param other Object to be moved.
|
|
1822
|
+
*/
|
|
1823
|
+
XLCellFormats(XLCellFormats&& other);
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* @brief
|
|
1827
|
+
*/
|
|
1828
|
+
~XLCellFormats();
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* @brief Copy assignment operator.
|
|
1832
|
+
* @param other Right hand side of assignment operation.
|
|
1833
|
+
* @return A reference to the lhs object.
|
|
1834
|
+
*/
|
|
1835
|
+
XLCellFormats& operator=(const XLCellFormats& other);
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* @brief Move assignment operator.
|
|
1839
|
+
* @param other Right hand side of assignment operation.
|
|
1840
|
+
* @return A reference to lhs object.
|
|
1841
|
+
*/
|
|
1842
|
+
XLCellFormats& operator=(XLCellFormats&& other) noexcept;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* @brief Get the count of cell style format descriptions
|
|
1846
|
+
* @return The amount of cell style format description entries
|
|
1847
|
+
*/
|
|
1848
|
+
size_t count() const;
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* @brief Get the cell style format description identified by index
|
|
1852
|
+
* @param index The index within the XML sequence
|
|
1853
|
+
* @return An XLCellFormat object
|
|
1854
|
+
*/
|
|
1855
|
+
XLCellFormat cellFormatByIndex(XLStyleIndex index) const;
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* @brief Operator overload: allow [] as shortcut access to cellFormatByIndex
|
|
1859
|
+
* @param index The index within the XML sequence
|
|
1860
|
+
* @return An XLCellFormat object
|
|
1861
|
+
*/
|
|
1862
|
+
XLCellFormat operator[](XLStyleIndex index) const { return cellFormatByIndex(index); }
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* @brief Append a new XLCellFormat, based on copyFrom, and return its index
|
|
1866
|
+
* in cellXfs (for XLStyles::cellFormats) or cellStyleXfs (for XLStyles::cellStyleFormats)
|
|
1867
|
+
* @param copyFrom Can provide an XLCellFormat to use as template for the new style
|
|
1868
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
1869
|
+
* @returns The index of the new style as used by operator[]
|
|
1870
|
+
*/
|
|
1871
|
+
XLStyleIndex create(XLCellFormat copyFrom = XLCellFormat{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
1872
|
+
|
|
1873
|
+
private: // ---------- Private Member Variables ---------- //
|
|
1874
|
+
std::unique_ptr<XMLNode> m_cellFormatsNode; /**< An XMLNode object with the cell formats item */
|
|
1875
|
+
std::vector<XLCellFormat> m_cellFormats;
|
|
1876
|
+
bool m_permitXfId{false};
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
// ================================================================================
|
|
1881
|
+
// XLCellStyles Class
|
|
1882
|
+
// ================================================================================
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* @brief An encapsulation of a cell style item
|
|
1886
|
+
*/
|
|
1887
|
+
class OPENXLSX_EXPORT XLCellStyle
|
|
1888
|
+
{
|
|
1889
|
+
friend class XLCellStyles; // for access to m_cellStyleNode in XLCellStyles::create
|
|
1890
|
+
|
|
1891
|
+
public: // ---------- Public Member Functions ---------- //
|
|
1892
|
+
/**
|
|
1893
|
+
* @brief
|
|
1894
|
+
*/
|
|
1895
|
+
XLCellStyle();
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
1899
|
+
* @param node An XMLNode object with the cellStyle item. If no input is provided, a null node is used.
|
|
1900
|
+
*/
|
|
1901
|
+
explicit XLCellStyle(const XMLNode& node);
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* @brief Copy Constructor.
|
|
1905
|
+
* @param other Object to be copied.
|
|
1906
|
+
*/
|
|
1907
|
+
XLCellStyle(const XLCellStyle& other);
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* @brief Move Constructor.
|
|
1911
|
+
* @param other Object to be moved.
|
|
1912
|
+
*/
|
|
1913
|
+
XLCellStyle(XLCellStyle&& other) noexcept;
|
|
1914
|
+
|
|
1915
|
+
/**
|
|
1916
|
+
* @brief
|
|
1917
|
+
*/
|
|
1918
|
+
~XLCellStyle();
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* @brief Copy assignment operator.
|
|
1922
|
+
* @param other Right hand side of assignment operation.
|
|
1923
|
+
* @return A reference to the lhs object.
|
|
1924
|
+
*/
|
|
1925
|
+
XLCellStyle& operator=(const XLCellStyle& other);
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* @brief Move assignment operator.
|
|
1929
|
+
* @param other Right hand side of assignment operation.
|
|
1930
|
+
* @return A reference to lhs object.
|
|
1931
|
+
*/
|
|
1932
|
+
XLCellStyle& operator=(XLCellStyle&& other) noexcept;
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* @brief Test if this is an empty node
|
|
1936
|
+
* @return true if underlying XMLNode is empty
|
|
1937
|
+
*/
|
|
1938
|
+
bool empty() const;
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* @brief Get the name of the cell style
|
|
1942
|
+
* @return The name for this cell style entry
|
|
1943
|
+
*/
|
|
1944
|
+
std::string name() const;
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* @brief Get the id of the cell style format
|
|
1948
|
+
* @return The id referring to an index in cell style formats (cellStyleXfs) - TBD to be confirmed
|
|
1949
|
+
*/
|
|
1950
|
+
XLStyleIndex xfId() const;
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* @brief Get the built-in id of the cell style
|
|
1954
|
+
* @return The built-in id of the cell style
|
|
1955
|
+
* @todo need to find a use case for this
|
|
1956
|
+
*/
|
|
1957
|
+
uint32_t builtinId() const;
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* @brief Get the outline style id (attribute iLevel) of the cell style
|
|
1961
|
+
* @return The outline style id of the cell style
|
|
1962
|
+
* @todo need to find a use case for this
|
|
1963
|
+
*/
|
|
1964
|
+
uint32_t outlineStyle() const;
|
|
1965
|
+
|
|
1966
|
+
/**
|
|
1967
|
+
* @brief Get the hidden flag of the cell style
|
|
1968
|
+
* @return The hidden flag status (true: applications should not show this style)
|
|
1969
|
+
*/
|
|
1970
|
+
bool hidden() const;
|
|
1971
|
+
|
|
1972
|
+
/**
|
|
1973
|
+
* @brief Get the custom buildin flag
|
|
1974
|
+
* @return true if this cell style shall customize a built-in style
|
|
1975
|
+
*/
|
|
1976
|
+
bool customBuiltin() const;
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* @brief Unsupported getter
|
|
1980
|
+
*/
|
|
1981
|
+
XLUnsupportedElement extLst() const { return XLUnsupportedElement{}; } // <cellStyle><extLst>...</extLst></cellStyle>
|
|
1982
|
+
|
|
1983
|
+
/**
|
|
1984
|
+
* @brief Setter functions for style parameters
|
|
1985
|
+
* @param value that shall be set
|
|
1986
|
+
* @return true for success, false for failure
|
|
1987
|
+
*/
|
|
1988
|
+
bool setName (std::string newName);
|
|
1989
|
+
bool setXfId (XLStyleIndex newXfId);
|
|
1990
|
+
bool setBuiltinId (uint32_t newBuiltinId);
|
|
1991
|
+
bool setOutlineStyle (uint32_t newOutlineStyle);
|
|
1992
|
+
bool setHidden (bool set = true);
|
|
1993
|
+
bool setCustomBuiltin(bool set = true);
|
|
1994
|
+
/**
|
|
1995
|
+
* @brief Unsupported setter
|
|
1996
|
+
*/
|
|
1997
|
+
bool setExtLst (XLUnsupportedElement const& newExtLst);
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* @brief Return a string summary of the cell style properties
|
|
2001
|
+
* @return string with info about the cell style object
|
|
2002
|
+
*/
|
|
2003
|
+
std::string summary() const;
|
|
2004
|
+
|
|
2005
|
+
private: // ---------- Private Member Variables ---------- //
|
|
2006
|
+
std::unique_ptr<XMLNode> m_cellStyleNode; /**< An XMLNode object with the cell style item */
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* @brief An encapsulation of the XLSX cell styles
|
|
2012
|
+
*/
|
|
2013
|
+
class OPENXLSX_EXPORT XLCellStyles
|
|
2014
|
+
{
|
|
2015
|
+
public: // ---------- Public Member Functions ---------- //
|
|
2016
|
+
/**
|
|
2017
|
+
* @brief
|
|
2018
|
+
*/
|
|
2019
|
+
XLCellStyles();
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
2023
|
+
* @param node An XMLNode object with the cellStyles item. If no input is provided, a null node is used.
|
|
2024
|
+
*/
|
|
2025
|
+
explicit XLCellStyles(const XMLNode& node);
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* @brief Copy Constructor.
|
|
2029
|
+
* @param other Object to be copied.
|
|
2030
|
+
*/
|
|
2031
|
+
XLCellStyles(const XLCellStyles& other);
|
|
2032
|
+
|
|
2033
|
+
/**
|
|
2034
|
+
* @brief Move Constructor.
|
|
2035
|
+
* @param other Object to be moved.
|
|
2036
|
+
*/
|
|
2037
|
+
XLCellStyles(XLCellStyles&& other);
|
|
2038
|
+
|
|
2039
|
+
/**
|
|
2040
|
+
* @brief
|
|
2041
|
+
*/
|
|
2042
|
+
~XLCellStyles();
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* @brief Copy assignment operator.
|
|
2046
|
+
* @param other Right hand side of assignment operation.
|
|
2047
|
+
* @return A reference to the lhs object.
|
|
2048
|
+
*/
|
|
2049
|
+
XLCellStyles& operator=(const XLCellStyles& other);
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* @brief Move assignment operator.
|
|
2053
|
+
* @param other Right hand side of assignment operation.
|
|
2054
|
+
* @return A reference to lhs object.
|
|
2055
|
+
*/
|
|
2056
|
+
XLCellStyles& operator=(XLCellStyles&& other) noexcept;
|
|
2057
|
+
|
|
2058
|
+
/**
|
|
2059
|
+
* @brief Get the count of cell styles
|
|
2060
|
+
* @return The amount of entries in the cell styles
|
|
2061
|
+
*/
|
|
2062
|
+
size_t count() const;
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* @brief Get the cell style identified by index
|
|
2066
|
+
* @return An XLCellStyle object
|
|
2067
|
+
*/
|
|
2068
|
+
XLCellStyle cellStyleByIndex(XLStyleIndex index) const;
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* @brief Operator overload: allow [] as shortcut access to cellStyleByIndex
|
|
2072
|
+
* @param index The index within the XML sequence
|
|
2073
|
+
* @return An XLCellStyle object
|
|
2074
|
+
*/
|
|
2075
|
+
XLCellStyle operator[](XLStyleIndex index) const { return cellStyleByIndex(index); }
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* @brief Append a new XLCellStyle, based on copyFrom, and return its index in cellStyles node
|
|
2079
|
+
* @param copyFrom Can provide an XLCellStyle to use as template for the new style
|
|
2080
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
2081
|
+
* @returns The index of the new style as used by operator[]
|
|
2082
|
+
*/
|
|
2083
|
+
XLStyleIndex create(XLCellStyle copyFrom = XLCellStyle{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
2084
|
+
|
|
2085
|
+
private: // ---------- Private Member Variables ---------- //
|
|
2086
|
+
std::unique_ptr<XMLNode> m_cellStylesNode; /**< An XMLNode object with the cell styles item */
|
|
2087
|
+
std::vector<XLCellStyle> m_cellStyles;
|
|
2088
|
+
};
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
// ================================================================================
|
|
2092
|
+
// XLDiffCellFormats Class
|
|
2093
|
+
// ================================================================================
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* @brief An encapsulation of a differential cell format item
|
|
2097
|
+
*/
|
|
2098
|
+
class OPENXLSX_EXPORT XLDiffCellFormat
|
|
2099
|
+
{
|
|
2100
|
+
friend class XLDiffCellFormats; // for access to m_diffCellFormatNode in XLDiffCellFormats::create
|
|
2101
|
+
|
|
2102
|
+
public: // ---------- Public Member Functions ---------- //
|
|
2103
|
+
/**
|
|
2104
|
+
* @brief
|
|
2105
|
+
*/
|
|
2106
|
+
XLDiffCellFormat();
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
2110
|
+
* @param node An XMLNode object with the dxf item. If no input is provided, a null node is used.
|
|
2111
|
+
*/
|
|
2112
|
+
explicit XLDiffCellFormat(const XMLNode& node);
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* @brief Copy Constructor.
|
|
2116
|
+
* @param other Object to be copied.
|
|
2117
|
+
*/
|
|
2118
|
+
XLDiffCellFormat(const XLDiffCellFormat& other);
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* @brief Move Constructor.
|
|
2122
|
+
* @param other Object to be moved.
|
|
2123
|
+
*/
|
|
2124
|
+
XLDiffCellFormat(XLDiffCellFormat&& other) noexcept;
|
|
2125
|
+
|
|
2126
|
+
/**
|
|
2127
|
+
* @brief
|
|
2128
|
+
*/
|
|
2129
|
+
~XLDiffCellFormat();
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* @brief Copy assignment operator.
|
|
2133
|
+
* @param other Right hand side of assignment operation.
|
|
2134
|
+
* @return A reference to the lhs object.
|
|
2135
|
+
*/
|
|
2136
|
+
XLDiffCellFormat& operator=(const XLDiffCellFormat& other);
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* @brief Move assignment operator.
|
|
2140
|
+
* @param other Right hand side of assignment operation.
|
|
2141
|
+
* @return A reference to lhs object.
|
|
2142
|
+
*/
|
|
2143
|
+
XLDiffCellFormat& operator=(XLDiffCellFormat&& other) noexcept;
|
|
2144
|
+
|
|
2145
|
+
/**
|
|
2146
|
+
* @brief Test if this is an empty node
|
|
2147
|
+
* @return true if underlying XMLNode is empty
|
|
2148
|
+
*/
|
|
2149
|
+
bool empty() const;
|
|
2150
|
+
|
|
2151
|
+
/**
|
|
2152
|
+
* @brief Getter functions, will create empty object on access and can be used to manipulate underlying setters
|
|
2153
|
+
*/
|
|
2154
|
+
XLFont font() const;
|
|
2155
|
+
XLNumberFormat numFmt() const;
|
|
2156
|
+
XLFill fill() const;
|
|
2157
|
+
XLAlignment alignment() const;
|
|
2158
|
+
XLBorder border() const;
|
|
2159
|
+
// setProtection ();
|
|
2160
|
+
|
|
2161
|
+
/**
|
|
2162
|
+
* @brief Unsupported getter
|
|
2163
|
+
*/
|
|
2164
|
+
XLUnsupportedElement extLst() const { return XLUnsupportedElement{}; } // <cellStyle><extLst>...</extLst></cellStyle>
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* @brief Setter functions for differential cell format protection settings
|
|
2168
|
+
* @return true for success, false for failure
|
|
2169
|
+
*/
|
|
2170
|
+
// bool setProtection ();
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* @brief Unsupported setter
|
|
2174
|
+
*/
|
|
2175
|
+
bool setExtLst (XLUnsupportedElement const& newExtLst);
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* @brief Return a string summary of the differential cell format properties
|
|
2179
|
+
* @return string with info about the differential cell format object
|
|
2180
|
+
*/
|
|
2181
|
+
std::string summary() const;
|
|
2182
|
+
|
|
2183
|
+
private: // ---------- Private Member Variables ---------- //
|
|
2184
|
+
std::unique_ptr<XMLNode> m_diffCellFormatNode; /**< An XMLNode object with the cell style item */
|
|
2185
|
+
};
|
|
2186
|
+
|
|
2187
|
+
|
|
2188
|
+
/**
|
|
2189
|
+
* @brief An encapsulation of the XLSX differential cell formats
|
|
2190
|
+
*/
|
|
2191
|
+
class OPENXLSX_EXPORT XLDiffCellFormats
|
|
2192
|
+
{
|
|
2193
|
+
public: // ---------- Public Member Functions ---------- //
|
|
2194
|
+
/**
|
|
2195
|
+
* @brief
|
|
2196
|
+
*/
|
|
2197
|
+
XLDiffCellFormats();
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* @brief Constructor. New items should only be created through an XLStyles object.
|
|
2201
|
+
* @param node An XMLNode object with the dxfs item. If no input is provided, a null node is used.
|
|
2202
|
+
*/
|
|
2203
|
+
explicit XLDiffCellFormats(const XMLNode& node);
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* @brief Copy Constructor.
|
|
2207
|
+
* @param other Object to be copied.
|
|
2208
|
+
*/
|
|
2209
|
+
XLDiffCellFormats(const XLDiffCellFormats& other);
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* @brief Move Constructor.
|
|
2213
|
+
* @param other Object to be moved.
|
|
2214
|
+
*/
|
|
2215
|
+
XLDiffCellFormats(XLDiffCellFormats&& other);
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* @brief
|
|
2219
|
+
*/
|
|
2220
|
+
~XLDiffCellFormats();
|
|
2221
|
+
|
|
2222
|
+
/**
|
|
2223
|
+
* @brief Copy assignment operator.
|
|
2224
|
+
* @param other Right hand side of assignment operation.
|
|
2225
|
+
* @return A reference to the lhs object.
|
|
2226
|
+
*/
|
|
2227
|
+
XLDiffCellFormats& operator=(const XLDiffCellFormats& other);
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* @brief Move assignment operator.
|
|
2231
|
+
* @param other Right hand side of assignment operation.
|
|
2232
|
+
* @return A reference to lhs object.
|
|
2233
|
+
*/
|
|
2234
|
+
XLDiffCellFormats& operator=(XLDiffCellFormats&& other) noexcept;
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* @brief Get the count of differential cell formats
|
|
2238
|
+
* @return The amount of entries in the differential cell formats
|
|
2239
|
+
*/
|
|
2240
|
+
size_t count() const;
|
|
2241
|
+
|
|
2242
|
+
/**
|
|
2243
|
+
* @brief Get the differential cell format identified by index
|
|
2244
|
+
* @return An XLDiffCellFormat object
|
|
2245
|
+
*/
|
|
2246
|
+
XLDiffCellFormat diffCellFormatByIndex(XLStyleIndex index) const;
|
|
2247
|
+
|
|
2248
|
+
/**
|
|
2249
|
+
* @brief Operator overload: allow [] as shortcut access to diffCellFormatByIndex
|
|
2250
|
+
* @param index The index within the XML sequence
|
|
2251
|
+
* @return An XLDiffCellFormat object
|
|
2252
|
+
*/
|
|
2253
|
+
XLDiffCellFormat operator[](XLStyleIndex index) const { return diffCellFormatByIndex(index); }
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* @brief Append a new XLDiffCellFormat, based on copyFrom, and return its index in dxfs node
|
|
2257
|
+
* @param copyFrom Can provide an XLDiffCellFormat to use as template for the new style
|
|
2258
|
+
* @param styleEntriesPrefix Prefix the newly created cell style XMLNode with this pugi::node_pcdata text
|
|
2259
|
+
* @returns The index of the new differential cell format as used by operator[]
|
|
2260
|
+
*/
|
|
2261
|
+
XLStyleIndex create(XLDiffCellFormat copyFrom = XLDiffCellFormat{}, std::string styleEntriesPrefix = XLDefaultStyleEntriesPrefix);
|
|
2262
|
+
|
|
2263
|
+
private: // ---------- Private Member Variables ---------- //
|
|
2264
|
+
std::unique_ptr<XMLNode> m_diffCellFormatsNode; /**< An XMLNode object with the cell styles item */
|
|
2265
|
+
std::vector<XLDiffCellFormat> m_diffCellFormats;
|
|
2266
|
+
};
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
// ================================================================================
|
|
2270
|
+
// XLStyles Class
|
|
2271
|
+
// ================================================================================
|
|
2272
|
+
|
|
2273
|
+
/**
|
|
2274
|
+
* @brief An encapsulation of the styles file (xl/styles.xml) in an Excel document package.
|
|
2275
|
+
*/
|
|
2276
|
+
class OPENXLSX_EXPORT XLStyles : public XLXmlFile
|
|
2277
|
+
{
|
|
2278
|
+
public: // ---------- Public Member Functions ---------- //
|
|
2279
|
+
/**
|
|
2280
|
+
* @brief
|
|
2281
|
+
*/
|
|
2282
|
+
XLStyles();
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* @brief
|
|
2286
|
+
* @param xmlData
|
|
2287
|
+
* @param suppressWarnings if true (SUPRESS_WARNINGS), messages such as "XLStyles: Ignoring currently unsupported <dxfs> node" will be silenced
|
|
2288
|
+
* @param stylesPrefix Prefix any newly created root style nodes with this text as pugi::node_pcdata
|
|
2289
|
+
*/
|
|
2290
|
+
explicit XLStyles(XLXmlData* xmlData, bool suppressWarnings = false, std::string stylesPrefix = XLDefaultStylesPrefix);
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* @brief Destructor
|
|
2294
|
+
*/
|
|
2295
|
+
~XLStyles();
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* @brief The move constructor.
|
|
2299
|
+
* @param other an existing styles object other will be assigned to this
|
|
2300
|
+
*/
|
|
2301
|
+
XLStyles(XLStyles&& other) noexcept;
|
|
2302
|
+
|
|
2303
|
+
/**
|
|
2304
|
+
* @brief The copy constructor.
|
|
2305
|
+
* @param other an existing styles object other will be also referred by this
|
|
2306
|
+
*/
|
|
2307
|
+
XLStyles(const XLStyles& other);
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* @brief move assignment
|
|
2311
|
+
* @param other
|
|
2312
|
+
* @return
|
|
2313
|
+
*/
|
|
2314
|
+
XLStyles& operator=(XLStyles&& other) noexcept;
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* @brief copy assignment
|
|
2318
|
+
* @param other
|
|
2319
|
+
* @return
|
|
2320
|
+
*/
|
|
2321
|
+
XLStyles& operator=(const XLStyles& other);
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* @brief Get the number formats object
|
|
2325
|
+
* @return An XLNumberFormats object
|
|
2326
|
+
*/
|
|
2327
|
+
XLNumberFormats& numberFormats() const;
|
|
2328
|
+
|
|
2329
|
+
/**
|
|
2330
|
+
* @brief Get the fonts object
|
|
2331
|
+
* @return An XLFonts object
|
|
2332
|
+
*/
|
|
2333
|
+
XLFonts& fonts() const;
|
|
2334
|
+
|
|
2335
|
+
/**
|
|
2336
|
+
* @brief Get the fills object
|
|
2337
|
+
* @return An XLFills object
|
|
2338
|
+
*/
|
|
2339
|
+
XLFills& fills() const;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* @brief Get the borders object
|
|
2343
|
+
* @return An XLBorders object
|
|
2344
|
+
*/
|
|
2345
|
+
XLBorders& borders() const;
|
|
2346
|
+
|
|
2347
|
+
/**
|
|
2348
|
+
* @brief Get the cell style formats object
|
|
2349
|
+
* @return An XLCellFormats object
|
|
2350
|
+
*/
|
|
2351
|
+
XLCellFormats& cellStyleFormats() const;
|
|
2352
|
+
|
|
2353
|
+
/**
|
|
2354
|
+
* @brief Get the cell formats object
|
|
2355
|
+
* @return An XLCellFormats object
|
|
2356
|
+
*/
|
|
2357
|
+
XLCellFormats& cellFormats() const;
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* @brief Get the cell styles object
|
|
2361
|
+
* @return An XLCellStyles object
|
|
2362
|
+
*/
|
|
2363
|
+
XLCellStyles& cellStyles() const;
|
|
2364
|
+
|
|
2365
|
+
/**
|
|
2366
|
+
* @brief Get the differential cell formats object
|
|
2367
|
+
* @return An XLDiffCellFormats object
|
|
2368
|
+
*/
|
|
2369
|
+
XLDiffCellFormats& diffCellFormats() const;
|
|
2370
|
+
|
|
2371
|
+
// ---------- Protected Member Functions ---------- //
|
|
2372
|
+
private:
|
|
2373
|
+
bool m_suppressWarnings; // if true, will suppress output of warnings where supported
|
|
2374
|
+
std::unique_ptr<XLNumberFormats> m_numberFormats; // handle to the underlying number formats
|
|
2375
|
+
std::unique_ptr<XLFonts> m_fonts; // handle to the underlying fonts
|
|
2376
|
+
std::unique_ptr<XLFills> m_fills; // handle to the underlying fills
|
|
2377
|
+
std::unique_ptr<XLBorders> m_borders; // handle to the underlying border descriptions
|
|
2378
|
+
std::unique_ptr<XLCellFormats> m_cellStyleFormats; // handle to the underlying cell style formats descriptions
|
|
2379
|
+
std::unique_ptr<XLCellFormats> m_cellFormats; // handle to the underlying cell formats descriptions
|
|
2380
|
+
std::unique_ptr<XLCellStyles> m_cellStyles; // handle to the underlying cell styles
|
|
2381
|
+
std::unique_ptr<XLDiffCellFormats> m_diffCellFormats; // handle to the underlying differential cell formats
|
|
2382
|
+
inline static const std::vector< std::string_view > m_nodeOrder = { "numFmts", "fonts", "fills", "borders", "cellStyleXfs", "cellXfs", "cellStyles", "dxfs", "tableStyles", "colors", "extLst" };
|
|
2383
|
+
};
|
|
2384
|
+
} // namespace OpenXLSX
|
|
2385
|
+
|
|
2386
|
+
#ifdef _MSC_VER // conditionally enable MSVC specific pragmas to avoid other compilers warning about unknown pragmas
|
|
2387
|
+
# pragma warning(pop)
|
|
2388
|
+
#endif // _MSC_VER
|
|
2389
|
+
|
|
2390
|
+
#endif // OPENXLSX_XLSTYLES_HPP
|