|
OpenXLSX 1.9.1
|
The XLComments class is the base class for worksheet comments. More...
#include <XLComments.hpp>
Public Member Functions | |
| XLComments () | |
| Constructor. | |
| XLComments (XLXmlData *xmlData) | |
| The constructor. | |
| XLComments (const XLComments &other)=default | |
| The copy constructor. | |
| XLComments (XLComments &&other) noexcept=default | |
| ~XLComments ()=default | |
| The destructor. | |
| XLComments & | operator= (XLComments &&other) noexcept=default |
| XLComments & | operator= (const XLComments &other)=default |
| Assignment operator. | |
| bool | setVmlDrawing (const XLVmlDrawing &vmlDrawing) |
| associate the worksheet's VML drawing object with the comments so it can be modified from here | |
| uint16_t | authorCount () const |
| std::string | author (uint16_t index) const |
| bool | deleteAuthor (uint16_t index) |
| uint16_t | addAuthor (const std::string &authorName) |
| size_t | count () const |
| get the amount of comments | |
| uint16_t | authorId (const std::string &cellRef) const |
| bool | deleteComment (const std::string &cellRef) |
| XLComment | get (size_t index) const |
| get a comment by its index in the comment list | |
| std::string | get (std::string const &cellRef) const |
| get the comment (if any) for the referenced cell | |
| bool | set (std::string const &cellRef, std::string const &comment, uint16_t authorId_=0, uint16_t widthCols=4, uint16_t heightRows=6) |
| set the comment for the referenced cell | |
| bool | set (std::string const &cellRef, std::string const &comment, std::string const &authorName, uint16_t widthCols=4, uint16_t heightRows=6) |
| set the comment for the referenced cell, automatically adding the author if not exists | |
| bool | setRichText (std::string const &cellRef, const XLRichText &richText, uint16_t authorId_=0, uint16_t widthCols=4, uint16_t heightRows=6) |
| set the rich text comment for the referenced cell | |
| bool | setRichText (std::string const &cellRef, const XLRichText &richText, std::string const &authorName, uint16_t widthCols=4, uint16_t heightRows=6) |
| set the rich text comment for the referenced cell, automatically adding the author if not exists | |
| XLShape | shape (std::string const &cellRef) |
| get the XLShape object for this comment | |
| bool | setVisible (std::string const &cellRef, bool visible) |
| Set the visibility of the comment shape. | |
| void | print (std::basic_ostream< char > &ostr) const |
| Print the XML contents of this XLComments instance using the underlying XMLNode print function. | |
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 |
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 XLComments class is the base class for worksheet comments.
| XLComments::XLComments | ( | ) |
Constructor.
|
explicit |
The constructor.
| xmlData | the source XML of the comments file |
The constructor creates an instance of the superclass, XLXmlFile
|
default |
The copy constructor.
| other | The object to be copied. |
|
defaultnoexcept |
| other |
|
default |
The destructor.
| uint16_t XLComments::addAuthor | ( | const std::string & | authorName | ) |
insert author and return index
| std::string XLComments::author | ( | uint16_t | index | ) | const |
| uint16_t XLComments::authorCount | ( | ) | const |
| uint16_t XLComments::authorId | ( | const std::string & | cellRef | ) | const |
| size_t XLComments::count | ( | ) | const |
get the amount of comments
| bool XLComments::deleteAuthor | ( | uint16_t | index | ) |
| bool XLComments::deleteComment | ( | const std::string & | cellRef | ) |
| XLComment XLComments::get | ( | size_t | index | ) | const |
get a comment by its index in the comment list
| index | the index of the comment as per XML sequence, no guarantee about cell reference being in sequence |
| std::string XLComments::get | ( | std::string const & | cellRef | ) | const |
get the comment (if any) for the referenced cell
| cellRef | the cell address to check |
|
default |
Assignment operator.
|
defaultnoexcept |
| other |
| void XLComments::print | ( | std::basic_ostream< char > & | ostr | ) | const |
Print the XML contents of this XLComments instance using the underlying XMLNode print function.
Print the underlying XML using pugixml::xml_node::print
| bool XLComments::set | ( | std::string const & | cellRef, |
| std::string const & | comment, | ||
| std::string const & | authorName, | ||
| uint16_t | widthCols = 4, |
||
| uint16_t | heightRows = 6 |
||
| ) |
set the comment for the referenced cell, automatically adding the author if not exists
| cellRef | the cell address to set |
| comment | set this text as comment for the cell |
| authorName | set this author name |
| widthCols | width of the comment box in columns |
| heightRows | height of the comment box in rows |
| bool XLComments::set | ( | std::string const & | cellRef, |
| std::string const & | comment, | ||
| uint16_t | authorId_ = 0, |
||
| uint16_t | widthCols = 4, |
||
| uint16_t | heightRows = 6 |
||
| ) |
set the comment for the referenced cell
| cellRef | the cell address to set |
| comment | set this text as comment for the cell |
| authorId_ | set this author (underscore to avoid conflict with function name) |
| widthCols | width of the comment box in columns |
| heightRows | height of the comment box in rows |
| bool XLComments::setRichText | ( | std::string const & | cellRef, |
| const XLRichText & | richText, | ||
| std::string const & | authorName, | ||
| uint16_t | widthCols = 4, |
||
| uint16_t | heightRows = 6 |
||
| ) |
set the rich text comment for the referenced cell, automatically adding the author if not exists
| cellRef | the cell address to set |
| richText | set this rich text as comment for the cell |
| authorName | set this author name |
| widthCols | width of the comment box in columns |
| heightRows | height of the comment box in rows |
| bool XLComments::setRichText | ( | std::string const & | cellRef, |
| const XLRichText & | richText, | ||
| uint16_t | authorId_ = 0, |
||
| uint16_t | widthCols = 4, |
||
| uint16_t | heightRows = 6 |
||
| ) |
set the rich text comment for the referenced cell
| cellRef | the cell address to set |
| richText | set this rich text as comment for the cell |
| authorId_ | set this author (underscore to avoid conflict with function name) |
| widthCols | width of the comment box in columns |
| heightRows | height of the comment box in rows |
| bool XLComments::setVisible | ( | std::string const & | cellRef, |
| bool | visible | ||
| ) |
Set the visibility of the comment shape.
| cellRef | the cell address |
| visible | true to show the comment, false to hide |
| bool XLComments::setVmlDrawing | ( | const XLVmlDrawing & | vmlDrawing | ) |
associate the worksheet's VML drawing object with the comments so it can be modified from here
| vmlDrawing | the worksheet's previously created XLVmlDrawing object |
|
friend |