8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
26 const ffi::TableCell* p_;
34 std::string_view
text()
const {
35 ffi::PineStringRef ref;
36 ffi::tableCellText(p_, &ref);
43 float width()
const {
return ffi::tableCellWidth(p_); }
48 float height()
const {
return ffi::tableCellHeight(p_); }
55 if (ffi::tableCellTextColor(p_, &v)) {
65 HorizontalAlign
textHalign()
const {
return ffi::tableCellTextHalign(p_); }
70 VerticalAlign
textValign()
const {
return ffi::tableCellTextValign(p_); }
75 uint32_t
textSize()
const {
return ffi::tableCellTextSize(p_); }
82 if (ffi::tableCellBackgroundColor(p_, &v)) {
92 std::optional<std::string_view>
tooltip()
const {
93 ffi::PineStringRef ref;
94 if (ffi::tableCellTooltip(p_, &ref)) {
110 return ffi::tableCellTextFormatting(p_);
116 uintptr_t
colspan()
const {
return ffi::tableCellColspan(p_); }
121 uintptr_t
rowspan()
const {
return ffi::tableCellRowspan(p_); }
129 const ffi::Table* p_;
132 Table(
const ffi::Table* p) : p_(p) {}
137 TablePosition
position()
const {
return ffi::tablePosition(p_); }
142 uintptr_t
numColumns()
const {
return ffi::tableNumColumns(p_); }
147 uintptr_t
numRows()
const {
return ffi::tableNumRows(p_); }
154 if (ffi::tableBackgroundColor(p_, &v)) {
166 if (ffi::tableFrameColor(p_, &v)) {
176 int32_t
frameWidth()
const {
return ffi::tableFrameWidth(p_); }
183 if (ffi::tableBorderColor(p_, &v)) {
203 std::optional<TableCell>
cell(uintptr_t row, uintptr_t col)
const {
204 const ffi::TableCell* c = ffi::tableCell(p_, row, col);
float width() const
Gets the cell width.
std::string_view text() const
Gets the cell text.
uintptr_t colspan() const
Gets the number of columns spanned.
uintptr_t rowspan() const
Gets the number of rows spanned.
VerticalAlign textValign() const
Gets the vertical text alignment.
TableCell(const ffi::TableCell *p)
std::optional< uint32_t > backgroundColor() const
Gets the optional background color.
HorizontalAlign textHalign() const
Gets the horizontal text alignment.
TextFormatting textFormatting() const
Gets the text formatting (bold/italic).
std::optional< uint32_t > textColor() const
Gets the optional cell text color.
std::optional< std::string_view > tooltip() const
Gets the optional tooltip.
uint32_t textSize() const
Gets the text size.
FontFamily textFontFamily() const
Gets the font family.
float height() const
Gets the cell height.
std::optional< uint32_t > backgroundColor() const
Gets the optional table background color.
int32_t frameWidth() const
Gets the frame width.
bool forceOverlay() const
Gets whether the table is forced to render as overlay.
int32_t borderWidth() const
Gets the border width.
std::optional< TableCell > cell(uintptr_t row, uintptr_t col) const
Gets the cell wrapper at row/col.
Table(const ffi::Table *p)
uintptr_t numRows() const
Gets the number of rows.
std::optional< uint32_t > borderColor() const
Gets the optional border color.
TablePosition position() const
Gets the table anchor position.
std::optional< uint32_t > frameColor() const
Gets the optional table frame color.
uintptr_t numColumns() const
Gets the number of columns.
std::string_view refToView(const ffi::PineStringRef &ref)
Shared helpers for converting C ABI string refs to std::string_view.
Re-exports FFI types into the openpine namespace.