1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:15:07 +00:00

LibGUI: Add a GModelNotification class that views will receive.

I don't want to use GEvent here since these need to be synchronous
and mixing sync and async GEvents would be stupid.
This commit is contained in:
Andreas Kling 2019-02-28 21:30:17 +01:00
parent 322f49caec
commit bff5b71467
6 changed files with 41 additions and 2 deletions

View file

@ -10,6 +10,27 @@
class GTableView;
class GModelNotification {
public:
enum Type {
Invalid = 0,
ModelUpdated,
};
explicit GModelNotification(Type type, const GModelIndex& index = GModelIndex())
: m_type(type)
, m_index(index)
{
}
Type type() const { return m_type; }
GModelIndex index() const { return m_index; }
private:
Type m_type { Invalid };
GModelIndex m_index;
};
class GTableModel {
public:
struct ColumnMetadata {