IRCWindowListModel.h 868 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Function.h>
  8. #include <LibGUI/Model.h>
  9. class IRCClient;
  10. class IRCWindow;
  11. class IRCWindowListModel final : public GUI::Model {
  12. public:
  13. enum Column {
  14. Name,
  15. };
  16. static NonnullRefPtr<IRCWindowListModel> create(IRCClient& client) { return adopt_ref(*new IRCWindowListModel(client)); }
  17. virtual ~IRCWindowListModel() override;
  18. virtual int row_count(const GUI::ModelIndex&) const override;
  19. virtual int column_count(const GUI::ModelIndex&) const override;
  20. virtual String column_name(int column) const override;
  21. virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
  22. private:
  23. explicit IRCWindowListModel(IRCClient&);
  24. NonnullRefPtr<IRCClient> m_client;
  25. };