OpenXLSX 1.10.0
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
 
XLSliceroperator= (const XLSlicer &)=default
 
XLSliceroperator= (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)
 
XLSlicersetCaption (std::string_view caption)
 
XLSlicersetStyle (XLSlicerStyle style)
 
XLSlicersetStyleRaw (std::string_view rawStyleName)
 Arbitrary style string.
 
XLSlicersetShowCaption (bool show)
 
XLSlicersetColumnCount (int cols)
 Multi-column slicer layout.
 
XLSlicersetLockedPosition (bool locked)
 
XLSlicersetRowHeight (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).
 
XLSlicershowOnly (const std::vector< std::string > &itemsToShow)
 Keep ONLY the listed items visible; hide all others.
 
XLSlicershowAll ()
 Clear all filters — show every item.
 
XLSlicerhideItems (const std::vector< std::string > &itemsToHide)
 Hide the listed items (keep everything else visible).
 
XLSlicersetSortDescending (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).
 
XLSlicermoveTo (std::string_view cellRef)
 Move the slicer anchor to a new cell (updates drawing XML).
 
XLSlicerresize (uint32_t widthPx, uint32_t heightPx)
 Resize the slicer (updates drawing XML, pixels).
 
XLXmlDataslicerXml () const
 
XLXmlDatacacheXml () 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

Cache name (e.g. "Slicer_Region")

◆ cacheXml()

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

◆ caption()

std::string XLSlicer::caption ( ) const

◆ cellRef()

std::string XLSlicer::cellRef ( ) const

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

◆ columnCount()

int XLSlicer::columnCount ( ) const

Button columns (0 = unset → 1)

◆ height()

uint32_t XLSlicer::height ( ) const

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

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

◆ items()

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

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

◆ lockedPosition()

bool XLSlicer::lockedPosition ( ) const

◆ 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

◆ 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

EMU per item row (0 = unset)

◆ selectedItems()

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

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

◆ 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

◆ styleRaw()

std::string XLSlicer::styleRaw ( ) const

Raw style string.

◆ valid()

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

◆ width()

uint32_t XLSlicer::width ( ) const

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


The documentation for this class was generated from the following files: