mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibGUI: Add GAbstractView base class for GTableView.
This is in preparation for adding a new view class.
This commit is contained in:
parent
994cf10b3e
commit
5707d7f547
7 changed files with 100 additions and 64 deletions
26
LibGUI/GAbstractView.h
Normal file
26
LibGUI/GAbstractView.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GModel.h>
|
||||
#include <LibGUI/GScrollableWidget.h>
|
||||
|
||||
class GAbstractView : public GScrollableWidget {
|
||||
friend class GModel;
|
||||
public:
|
||||
explicit GAbstractView(GWidget* parent);
|
||||
virtual ~GAbstractView() override;
|
||||
|
||||
void set_model(RetainPtr<GModel>&&);
|
||||
GModel* model() { return m_model.ptr(); }
|
||||
const GModel* model() const { return m_model.ptr(); }
|
||||
|
||||
void scroll_into_view(const GModelIndex&, Orientation);
|
||||
|
||||
virtual bool accepts_focus() const override { return true; }
|
||||
virtual void did_update_model();
|
||||
|
||||
protected:
|
||||
virtual void model_notification(const GModelNotification&);
|
||||
|
||||
private:
|
||||
RetainPtr<GModel> m_model;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue