2019-03-15 14:01:04 +01:00
|
|
|
#pragma once
|
|
|
|
|
2019-03-15 16:12:51 +01:00
|
|
|
#include <AK/Function.h>
|
2019-05-28 11:53:16 +02:00
|
|
|
#include <LibGUI/GModel.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-23 01:42:49 +01:00
|
|
|
class IRCWindowListModel final : public GModel {
|
2019-03-15 14:01:04 +01:00
|
|
|
public:
|
2019-06-07 17:13:23 +02:00
|
|
|
enum Column {
|
2019-03-15 14:01:04 +01:00
|
|
|
Name,
|
|
|
|
};
|
|
|
|
|
2019-06-21 18:37:47 +02:00
|
|
|
static NonnullRefPtr<IRCWindowListModel> create(IRCClient& client) { return adopt(*new IRCWindowListModel(client)); }
|
2019-03-16 01:15:19 +01:00
|
|
|
virtual ~IRCWindowListModel() override;
|
2019-03-15 14:01:04 +01:00
|
|
|
|
2019-03-29 03:27:03 +01:00
|
|
|
virtual int row_count(const GModelIndex&) const override;
|
|
|
|
virtual int column_count(const GModelIndex&) const override;
|
2019-03-15 14:01:04 +01:00
|
|
|
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;
|
|
|
|
|
|
|
|
private:
|
2019-03-20 03:27:07 +01:00
|
|
|
explicit IRCWindowListModel(IRCClient&);
|
|
|
|
|
2019-03-15 14:01:04 +01:00
|
|
|
IRCClient& m_client;
|
|
|
|
};
|