mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
add38b3981
This is in preparation for supporting hierarchical models.
28 lines
939 B
C++
28 lines
939 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GModel.h>
|
|
#include <AK/Function.h>
|
|
|
|
class IRCChannel;
|
|
|
|
class IRCChannelMemberListModel final : public GModel {
|
|
public:
|
|
enum Column { Name };
|
|
static Retained<IRCChannelMemberListModel> create(IRCChannel& channel) { return adopt(*new IRCChannelMemberListModel(channel)); }
|
|
virtual ~IRCChannelMemberListModel() override;
|
|
|
|
virtual int row_count(const GModelIndex&) const override;
|
|
virtual int column_count(const GModelIndex&) const override;
|
|
virtual String column_name(int column) const override;
|
|
virtual ColumnMetadata column_metadata(int column) const override;
|
|
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
|
|
virtual void update() override;
|
|
virtual void activate(const GModelIndex&) override;
|
|
|
|
Function<void(const String&)> on_activation;
|
|
|
|
private:
|
|
explicit IRCChannelMemberListModel(IRCChannel&);
|
|
|
|
IRCChannel& m_channel;
|
|
};
|