OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
OpenXLSX::XLSlicer Class Reference

#include <XLSlicer.hpp>

Public Member Functions

 XLSlicer ()=default
 XLSlicer (XLXmlData *slicerXml)
 Minimal constructor: wraps only the slicer XML (legacy compat).
 XLSlicer (XLXmlData *slicerXml, XMLNode slicerNode, XLXmlData *cacheXml, XMLNode anchorNode, XLWorksheet *worksheet)
 Full three-source constructor used by XLSlicerCollection.
 XLSlicer (const XLSlicer &)=default
 XLSlicer (XLSlicer &&) noexcept=default
XLSlicer & operator= (const XLSlicer &)=default
XLSlicer & operator= (XLSlicer &&)=default
 ~XLSlicer ()=default
bool valid () const
 operator bool () const
std::string name () const
std::string caption () const
std::string cache () const
 Cache name (e.g. "Slicer_Region").
XLSlicerStyle style () const
std::string styleRaw () const
 Raw style string.
bool showCaption () const
int columnCount () const
 Button columns (0 = unset → 1).
bool lockedPosition () const
int rowHeight () const
 EMU per item row (0 = unset).
void setName (std::string_view name)
XLSlicer & setCaption (std::string_view caption)
XLSlicer & setStyle (XLSlicerStyle style)
XLSlicer & setStyleRaw (std::string_view rawStyleName)
 Arbitrary style string.
XLSlicer & setShowCaption (bool show)
XLSlicer & setColumnCount (int cols)
 Multi-column slicer layout.
XLSlicer & setLockedPosition (bool locked)
XLSlicer & setRowHeight (int emuHeight)
 Raw EMU, 251883 ≈ 20 px.
std::vector< std::string > items () const
 All available items in the slicer (read from pivot/table data).
std::vector< std::string > selectedItems () const
 Items that are currently SELECTED (shown, not filtered out).
bool isSortDescending () const
 True if items are sorted descending (Z→A).
XLSlicer & showOnly (const std::vector< std::string > &itemsToShow)
 Keep ONLY the listed items visible; hide all others.
XLSlicer & showAll ()
 Clear all filters — show every item.
XLSlicer & hideItems (const std::vector< std::string > &itemsToHide)
 Hide the listed items (keep everything else visible).
XLSlicer & setSortDescending (bool desc)
 Set sort direction.
std::string cellRef () const
 Top-left anchor cell reference, e.g. "E2". Empty if anchor unknown.
uint32_t width () const
 Width in pixels (converted from EMU, 0 if anchor unknown).
uint32_t height () const
 Height in pixels (converted from EMU, 0 if anchor unknown).
XLSlicer & moveTo (std::string_view cellRef)
 Move the slicer anchor to a new cell (updates drawing XML).
XLSlicer & resize (uint32_t widthPx, uint32_t heightPx)
 Resize the slicer (updates drawing XML, pixels).
XLXmlData * slicerXml () const
XLXmlData * cacheXml () const

Constructor & Destructor Documentation

◆ XLSlicer() [1/5]

OpenXLSX::XLSlicer::XLSlicer ( )
default

◆ XLSlicer() [2/5]

XLSlicer::XLSlicer ( XLXmlData * slicerXml)
explicit

Minimal constructor: wraps only the slicer XML (legacy compat).

◆ XLSlicer() [3/5]

XLSlicer::XLSlicer ( XLXmlData * slicerXml,
XMLNode slicerNode,
XLXmlData * cacheXml,
XMLNode anchorNode,
XLWorksheet * worksheet )

Full three-source constructor used by XLSlicerCollection.

◆ XLSlicer() [4/5]

OpenXLSX::XLSlicer::XLSlicer ( const XLSlicer & )
default

◆ XLSlicer() [5/5]

OpenXLSX::XLSlicer::XLSlicer ( XLSlicer && )
defaultnoexcept

◆ ~XLSlicer()

OpenXLSX::XLSlicer::~XLSlicer ( )
default

Member Function Documentation

◆ cache()

std::string XLSlicer::cache ( ) const
nodiscard

Cache name (e.g. "Slicer_Region").

◆ cacheXml()

XLXmlData * OpenXLSX::XLSlicer::cacheXml ( ) const
inline

◆ caption()

std::string XLSlicer::caption ( ) const
nodiscard

◆ cellRef()

std::string XLSlicer::cellRef ( ) const
nodiscard

Top-left anchor cell reference, e.g. "E2". Empty if anchor unknown.

◆ columnCount()

int XLSlicer::columnCount ( ) const
nodiscard

Button columns (0 = unset → 1).

◆ height()

uint32_t XLSlicer::height ( ) const
nodiscard

Height in pixels (converted from EMU, 0 if anchor unknown).

◆ hideItems()

XLSlicer & XLSlicer::hideItems ( const std::vector< std::string > & itemsToHide)

Hide the listed items (keep everything else visible).

◆ isSortDescending()

bool XLSlicer::isSortDescending ( ) const
nodiscard

True if items are sorted descending (Z→A).

◆ items()

std::vector< std::string > XLSlicer::items ( ) const
nodiscard

All available items in the slicer (read from pivot/table data).

◆ lockedPosition()

bool XLSlicer::lockedPosition ( ) const
nodiscard

◆ moveTo()

XLSlicer & XLSlicer::moveTo ( std::string_view cellRef)

Move the slicer anchor to a new cell (updates drawing XML).

◆ name()

std::string XLSlicer::name ( ) const
nodiscard

◆ operator bool()

OpenXLSX::XLSlicer::operator bool ( ) const
inlineexplicit

◆ operator=() [1/2]

XLSlicer & OpenXLSX::XLSlicer::operator= ( const XLSlicer & )
default

◆ operator=() [2/2]

XLSlicer & OpenXLSX::XLSlicer::operator= ( XLSlicer && )
default

◆ resize()

XLSlicer & XLSlicer::resize ( uint32_t widthPx,
uint32_t heightPx )

Resize the slicer (updates drawing XML, pixels).

◆ rowHeight()

int XLSlicer::rowHeight ( ) const
nodiscard

EMU per item row (0 = unset).

◆ selectedItems()

std::vector< std::string > XLSlicer::selectedItems ( ) const
nodiscard

Items that are currently SELECTED (shown, not filtered out).

◆ setCaption()

XLSlicer & XLSlicer::setCaption ( std::string_view caption)

◆ setColumnCount()

XLSlicer & XLSlicer::setColumnCount ( int cols)

Multi-column slicer layout.

◆ setLockedPosition()

XLSlicer & XLSlicer::setLockedPosition ( bool locked)

◆ setName()

void XLSlicer::setName ( std::string_view name)

◆ setRowHeight()

XLSlicer & XLSlicer::setRowHeight ( int emuHeight)

Raw EMU, 251883 ≈ 20 px.

◆ setShowCaption()

XLSlicer & XLSlicer::setShowCaption ( bool show)

◆ setSortDescending()

XLSlicer & XLSlicer::setSortDescending ( bool desc)

Set sort direction.

◆ setStyle()

XLSlicer & XLSlicer::setStyle ( XLSlicerStyle style)

◆ setStyleRaw()

XLSlicer & XLSlicer::setStyleRaw ( std::string_view rawStyleName)

Arbitrary style string.

◆ showAll()

XLSlicer & XLSlicer::showAll ( )

Clear all filters — show every item.

◆ showCaption()

bool XLSlicer::showCaption ( ) const
nodiscard

◆ showOnly()

XLSlicer & XLSlicer::showOnly ( const std::vector< std::string > & itemsToShow)

Keep ONLY the listed items visible; hide all others.

◆ slicerXml()

XLXmlData * OpenXLSX::XLSlicer::slicerXml ( ) const
inline

◆ style()

XLSlicerStyle XLSlicer::style ( ) const
nodiscard

◆ styleRaw()

std::string XLSlicer::styleRaw ( ) const
nodiscard

Raw style string.

◆ valid()

bool OpenXLSX::XLSlicer::valid ( ) const
inlinenodiscard

◆ width()

uint32_t XLSlicer::width ( ) const
nodiscard

Width in pixels (converted from EMU, 0 if anchor unknown).


The documentation for this class was generated from the following files:
  • /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/headers/XLSlicer.hpp
  • /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/sources/XLSlicer.cpp