2019-03-15 14:01:04 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/GTableModel.h>
|
2019-03-15 16:12:51 +01:00
|
|
|
#include <AK/Function.h>
|
2019-03-15 14:01:04 +01:00
|
|
|
|
|
|
|
class IRCClient;
|
2019-03-16 01:15:19 +01:00
|
|
|
class IRCWindow;
|
2019-03-15 14:01:04 +01:00
|
|
|
|
2019-03-16 01:15:19 +01:00
|
|
|
class IRCWindowListModel final : public GTableModel {
|
2019-03-15 14:01:04 +01:00
|
|
|
public:
|
|
|
|
enum Column {
|
|
|
|
Name,
|
|
|
|
};
|
|
|
|
|
2019-03-16 01:15:19 +01:00
|
|
|
explicit IRCWindowListModel(IRCClient&);
|
|
|
|
virtual ~IRCWindowListModel() override;
|
2019-03-15 14:01:04 +01:00
|
|
|
|
|
|
|
virtual int row_count() const override;
|
|
|
|
virtual int column_count() 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;
|
|
|
|
|
2019-03-16 01:15:19 +01:00
|
|
|
Function<void(IRCWindow&)> on_activation;
|
2019-03-15 16:12:51 +01:00
|
|
|
|
2019-03-15 14:01:04 +01:00
|
|
|
private:
|
|
|
|
IRCClient& m_client;
|
|
|
|
};
|