|
OpenXLSX 1.9.1
|
The XLDrawing class is the base class for worksheet drawings (images, charts, etc.) More...
#include <XLDrawing.hpp>
Public Member Functions | |
| XLDrawing () | |
| Constructor. | |
| XLDrawing (gsl::not_null< XLXmlData * > xmlData) | |
| The constructor. | |
| XLDrawing (const XLDrawing &other) | |
| The copy constructor. | |
| XLDrawing (XLDrawing &&other) noexcept | |
| Move constructor. | |
| ~XLDrawing ()=default | |
| The destructor. | |
| XLDrawing & | operator= (const XLDrawing &other) |
| Assignment operator. | |
| XLDrawing & | operator= (XLDrawing &&other) noexcept |
| Move assignment operator. | |
| void | addImage (std::string_view rId, std::string_view name, std::string_view description, uint32_t row, uint32_t col, uint32_t width, uint32_t height, const XLImageOptions &options=XLImageOptions()) |
| Add an image to the drawing. | |
| void | addShape (uint32_t row, uint32_t col, const XLVectorShapeOptions &options=XLVectorShapeOptions()) |
| Add a chart to the drawing. | |
| void | addChartAnchor (std::string_view rId, std::string_view name, uint32_t row, uint32_t col, uint32_t width, uint32_t height) |
| void | addChartAnchor (std::string_view rId, std::string_view name, uint32_t row, uint32_t col, XLDistance width, XLDistance height) |
| void | addScaledImage (std::string_view rId, std::string_view name, std::string_view description, std::string_view data, uint32_t row, uint32_t col, double scalingFactor=1.0) |
| Add an image to the drawing, automatically maintaining aspect ratio. | |
| XLRelationships & | relationships () |
| Get the drawing relationships. | |
| uint32_t | imageCount () const |
| Get the number of images in the drawing. | |
| XLDrawingItem | image (uint32_t index) const |
| Get an image item by index. | |
Public Member Functions inherited from OpenXLSX::XLXmlFile | |
| XLXmlFile ()=default | |
| Default constructor. | |
| std::string | xmlData (XLXmlSavingDeclaration savingDeclaration=XLXmlSavingDeclaration{}) const |
| Method for getting the XML data represented by the object. | |
| XLXmlFile (XLXmlData *xmlData) | |
| Constructor. Creates an object based on the xmlData input. | |
| XLXmlFile (const XLXmlFile &other)=default | |
| Copy constructor. Default implementation used. | |
| XLXmlFile (XLXmlFile &&other) noexcept=default | |
| Move constructor. Default implementation used. | |
| ~XLXmlFile ()=default | |
| Destructor. Default implementation used. | |
| bool | valid () const |
| check whether class is linked to a valid XML file | |
| XLXmlFile & | operator= (const XLXmlFile &other)=default |
| The copy assignment operator. The default implementation has been used. | |
| XLXmlFile & | operator= (XLXmlFile &&other) noexcept=default |
| The move assignment operator. The default implementation has been used. | |
| XLDocument & | parentDoc () |
| This function provides access to the parent XLDocument object. | |
| const XLDocument & | parentDoc () const |
| This function provides access to the parent XLDocument object. | |
| XMLDocument & | xmlDocument () |
| This function provides access to the underlying XMLDocument object. | |
| const XMLDocument & | xmlDocument () const |
| This function provides access to the underlying XMLDocument object. | |
| std::string | getXmlPath () const |
| Retrieve the path of the XML data in the .xlsx zip archive via m_xmlData->getXmlPath. | |
Friends | |
| class | XLWorksheet |
| class | XLDocument |
Additional Inherited Members | |
Protected Member Functions inherited from OpenXLSX::XLXmlFile | |
| void | setXmlData (std::string_view xmlData) |
| Provide the XML data represented by the object. | |
| std::string | relationshipID () const |
| This function returns the relationship ID (the ID used in the XLRelationships objects) for the object. | |
Protected Attributes inherited from OpenXLSX::XLXmlFile | |
| XLXmlData * | m_xmlData {nullptr} |
The XLDrawing class is the base class for worksheet drawings (images, charts, etc.)
|
inline |
Constructor.
|
explicit |
The constructor.
| xmlData | the source XML of the drawings file |
| XLDrawing::XLDrawing | ( | const XLDrawing & | other | ) |
The copy constructor.
| other | The object to be copied. |
|
defaultnoexcept |
Move constructor.
|
default |
The destructor.
| void XLDrawing::addChartAnchor | ( | std::string_view | rId, |
| std::string_view | name, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| uint32_t | width, | ||
| uint32_t | height | ||
| ) |
| void XLDrawing::addChartAnchor | ( | std::string_view | rId, |
| std::string_view | name, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| XLDistance | width, | ||
| XLDistance | height | ||
| ) |
| void XLDrawing::addImage | ( | std::string_view | rId, |
| std::string_view | name, | ||
| std::string_view | description, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| const XLImageOptions & | options = XLImageOptions() |
||
| ) |
Add an image to the drawing.
| rId | the relationship ID of the image file |
| name | the name of the image |
| description | the description of the image |
| row | the row where the image should be placed (0-indexed) |
| col | the column where the image should be placed (0-indexed) |
| width | the width of the image in pixels |
| height | the height of the image in pixels |
| options | the formatting and positioning options |
| void XLDrawing::addScaledImage | ( | std::string_view | rId, |
| std::string_view | name, | ||
| std::string_view | description, | ||
| std::string_view | data, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| double | scalingFactor = 1.0 |
||
| ) |
Add an image to the drawing, automatically maintaining aspect ratio.
| rId | the relationship ID of the image file |
| name | the name of the image |
| description | the description of the image |
| data | the binary data of the image (used to detect dimensions) |
| row | the row where the image should be placed (0-indexed) |
| col | the column where the image should be placed (0-indexed) |
| scalingFactor | the factor to scale the image by (1.0 = original size) |
| void XLDrawing::addShape | ( | uint32_t | row, |
| uint32_t | col, | ||
| const XLVectorShapeOptions & | options = XLVectorShapeOptions() |
||
| ) |
Add a chart to the drawing.
| rId | the relationship ID of the chart file |
| name | the name of the chart |
| row | the row where the chart should be placed (0-indexed) |
| col | the column where the chart should be placed (0-indexed) |
| width | the width of the chart in pixels |
| height | the height of the chart in pixels |
| XLDrawingItem XLDrawing::image | ( | uint32_t | index | ) | const |
| uint32_t XLDrawing::imageCount | ( | ) | const |
Get the number of images in the drawing.
| XLRelationships & XLDrawing::relationships | ( | ) |
Get the drawing relationships.
fetches XLRelationships for the drawing - creates & assigns the class if empty
|
friend |
|
friend |