1#ifndef OPENXLSX_XLSLICER_HPP
2#define OPENXLSX_XLSLICER_HPP
4#include "OpenXLSX-Exports.hpp"
70 [[nodiscard]]
bool valid()
const {
return m_slicerXml !=
nullptr; }
71 explicit operator bool()
const {
return valid(); }
75 [[nodiscard]] std::string name()
const;
76 [[nodiscard]] std::string caption()
const;
77 [[nodiscard]] std::string cache()
const;
79 [[nodiscard]] std::string styleRaw()
const;
80 [[nodiscard]]
bool showCaption()
const;
81 [[nodiscard]]
int columnCount()
const;
82 [[nodiscard]]
bool lockedPosition()
const;
83 [[nodiscard]]
int rowHeight()
const;
85 void setName(std::string_view name);
86 XLSlicer& setCaption(std::string_view caption);
88 XLSlicer& setStyleRaw(std::string_view rawStyleName);
91 XLSlicer& setLockedPosition(
bool locked);
92 XLSlicer& setRowHeight(
int emuHeight);
97 [[nodiscard]] std::vector<std::string> items()
const;
99 [[nodiscard]] std::vector<std::string> selectedItems()
const;
101 [[nodiscard]]
bool isSortDescending()
const;
104 XLSlicer& showOnly(
const std::vector<std::string>& itemsToShow);
108 XLSlicer& hideItems(
const std::vector<std::string>& itemsToHide);
110 XLSlicer& setSortDescending(
bool desc);
115 [[nodiscard]] std::string cellRef()
const;
117 [[nodiscard]] uint32_t width()
const;
119 [[nodiscard]] uint32_t height()
const;
122 XLSlicer& moveTo(std::string_view cellRef);
124 XLSlicer& resize(uint32_t widthPx, uint32_t heightPx);
137 XMLNode m_slicerNode;
138 XLXmlData* m_cacheXml{
nullptr};
140 XLWorksheet* m_worksheet{
nullptr};
Definition XLXmlParser.hpp:84
Definition XLSlicer.hpp:48
XLXmlData * slicerXml() const
Definition XLSlicer.hpp:127
XLSlicer(const XLSlicer &)=default
XLXmlData * cacheXml() const
Definition XLSlicer.hpp:128
XLSlicer(XLSlicer &&) noexcept=default
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook ob...
Definition XLWorksheet.hpp:120
The XLXmlData class encapsulates the properties and behaviour of the .xml files in an ....
Definition XLXmlData.hpp:68
Definition IZipArchive.hpp:18
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:63
XLSlicerStyle
Definition XLSlicer.hpp:20
OPENXLSX_EXPORT XLSlicerStyle xlSlicerStyleFromString(std::string_view s)
Convert a raw style string to XLSlicerStyle enum (Custom if unrecognized).
Definition XLSlicer.cpp:35
OPENXLSX_EXPORT std::string xlSlicerStyleToString(XLSlicerStyle style)
Convert XLSlicerStyle enum to its Excel XML string representation.
Definition XLSlicer.cpp:14