mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:32:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/JsonArray.h>
 | |
| #include <LibCore/CHttpJob.h>
 | |
| #include <LibGUI/GModel.h>
 | |
| 
 | |
| class BoardListModel final : public GModel {
 | |
| public:
 | |
|     enum Column {
 | |
|         Board,
 | |
|         __Count,
 | |
|     };
 | |
| 
 | |
|     static NonnullRefPtr<BoardListModel> create() { return adopt(*new BoardListModel); }
 | |
|     virtual ~BoardListModel() override;
 | |
| 
 | |
|     virtual int row_count(const GModelIndex& = GModelIndex()) const override;
 | |
|     virtual int column_count(const GModelIndex& = GModelIndex()) const override { return Column::__Count; }
 | |
|     virtual String column_name(int) const override;
 | |
|     virtual ColumnMetadata column_metadata(int) const override;
 | |
|     virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
 | |
|     virtual void update() override;
 | |
| 
 | |
| private:
 | |
|     BoardListModel();
 | |
| 
 | |
|     JsonArray m_boards;
 | |
|     RefPtr<CHttpJob> m_pending_job;
 | |
| };
 | 
