TableModel
Base class for models of Table.
| Header | #include "nativeui/table_model.h" |
| Namespace | namespace nu |
| Type | class (RefCounted) |
Users can implement a subclass of TableModel to feed Table any
kind of data source. It is required to call the Notify methods in
subclasses when data has been changed, so the Table can correctly
update.
For simple use cases, the SimpleTableModel can be used.
Methods
uint32_t GetRowCount() const
Return how many rows are in the model.
This is a pure virtual method, subclass must override this method.
Return
uint32_tconst base::Value* GetValue(uint32_t column, uint32_t row) const
Return the reference to the data at column and row.
Caller should not store the return value, as it is a temporary reference that may immediately get destroyed after exiting current stack.
This is a pure virtual method, subclass must override this method.
Parameters
uint32_tcolumnuint32_trow
Return
const base::Value*void SetValue(uint32_t column, uint32_t row, base::Value value)
Change the value at column and row.
This is a pure virtual method, subclass must override this method.
Parameters
uint32_tcolumnuint32_trowbase::Valuevalue
void NotifyRowInsertion(uint32_t row)
Called by implementers to notify the table that a row is inserted.
Parameters
uint32_trow
void NotifyRowDeletion(uint32_t row)
Called by implementers to notify the table that a row is removed.
Parameters
uint32_trow
void NotifyValueChange(uint32_t column, uint32_t row)
Called by implementers to notify the table that the value at column and
row has been changed.
Parameters
uint32_tcolumnuint32_trow