11#ifndef OPENXLSX_XLSLICER_HPP
12#define OPENXLSX_XLSLICER_HPP
14#include "OpenXLSX-Exports.hpp"
80 [[nodiscard]]
bool valid()
const {
return m_slicerXml !=
nullptr; }
81 explicit operator bool()
const {
return valid(); }
85 [[nodiscard]] std::string name()
const;
86 [[nodiscard]] std::string caption()
const;
87 [[nodiscard]] std::string cache()
const;
89 [[nodiscard]] std::string styleRaw()
const;
90 [[nodiscard]]
bool showCaption()
const;
91 [[nodiscard]]
int columnCount()
const;
92 [[nodiscard]]
bool lockedPosition()
const;
93 [[nodiscard]]
int rowHeight()
const;
95 void setName(std::string_view name);
96 XLSlicer& setCaption(std::string_view caption);
98 XLSlicer& setStyleRaw(std::string_view rawStyleName);
101 XLSlicer& setLockedPosition(
bool locked);
102 XLSlicer& setRowHeight(
int emuHeight);
107 [[nodiscard]] std::vector<std::string> items()
const;
109 [[nodiscard]] std::vector<std::string> selectedItems()
const;
111 [[nodiscard]]
bool isSortDescending()
const;
114 XLSlicer& showOnly(
const std::vector<std::string>& itemsToShow);
118 XLSlicer& hideItems(
const std::vector<std::string>& itemsToHide);
120 XLSlicer& setSortDescending(
bool desc);
125 [[nodiscard]] std::string cellRef()
const;
127 [[nodiscard]] uint32_t width()
const;
129 [[nodiscard]] uint32_t height()
const;
132 XLSlicer& moveTo(std::string_view cellRef);
134 XLSlicer& resize(uint32_t widthPx, uint32_t heightPx);
147 XMLNode m_slicerNode;
148 XLXmlData* m_cacheXml{
nullptr};
This class encapsulates the concept of an excel file. It is different from the XLWorkbook,...
Definition XLDocument.hpp:97
Definition XLSlicer.hpp:58
XLXmlData * slicerXml() const
Definition XLSlicer.hpp:137
XLSlicer(const XLSlicer &)=default
bool valid() const
Definition XLSlicer.hpp:80
XLXmlData * cacheXml() const
Definition XLSlicer.hpp:138
XLSlicer(XLSlicer &&) noexcept=default
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook ob...
Definition XLWorksheet.hpp:132
The XLXmlData class encapsulates the properties and behaviour of the .xml files in an ....
Definition XLXmlData.hpp:79
Definition IXLCellProvider.hpp:24
XLSlicerStyle
Definition XLSlicer.hpp:30
@ Dark3
Definition XLSlicer.hpp:34
@ Dark5
Definition XLSlicer.hpp:34
@ Dark1
Definition XLSlicer.hpp:34
@ Light1
Definition XLSlicer.hpp:32
@ Light3
Definition XLSlicer.hpp:32
@ Other2
Definition XLSlicer.hpp:36
@ Dark2
Definition XLSlicer.hpp:34
@ Dark4
Definition XLSlicer.hpp:34
@ Light5
Definition XLSlicer.hpp:32
@ Dark6
Definition XLSlicer.hpp:34
@ Light6
Definition XLSlicer.hpp:32
@ Light2
Definition XLSlicer.hpp:32
@ Light4
Definition XLSlicer.hpp:32
@ Other1
Definition XLSlicer.hpp:36
OPENXLSX_EXPORT XLSlicerStyle xlSlicerStyleFromString(std::string_view s)
Convert a raw style string to XLSlicerStyle enum (Custom if unrecognized).
Definition XLSlicer.cpp:47
OPENXLSX_EXPORT std::string xlSlicerStyleToString(XLSlicerStyle style)
Convert XLSlicerStyle enum to its Excel XML string representation.
Definition XLSlicer.cpp:26
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
@ Custom
Definition XLChart.hpp:112