summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GModel.h
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2020-01-22 21:15:46 +0300
committerAndreas Kling <kling@serenityos.org>2020-01-22 21:22:23 +0100
commitdec95cb8b39003d85a9aae46a69f0fbcf450830d (patch)
tree7cd88165160820239687dbcff0fca01686e8439f /Libraries/LibGUI/GModel.h
parentd3ce7ae0e305a4eb6056076eb34577a13e5f8ed5 (diff)
downloadserenity-dec95cb8b39003d85a9aae46a69f0fbcf450830d.zip
LibGUI: Let GModel specify the drag data type
GModel subclasses can now override drag_data_type() to specify which type GAbstractView should set for drag data. The default implementation returns a null string, which disables dragging from this widget.
Diffstat (limited to 'Libraries/LibGUI/GModel.h')
-rw-r--r--Libraries/LibGUI/GModel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GModel.h b/Libraries/LibGUI/GModel.h
index bf3efa0ba4..12f16fdeb8 100644
--- a/Libraries/LibGUI/GModel.h
+++ b/Libraries/LibGUI/GModel.h
@@ -94,6 +94,8 @@ public:
virtual GSortOrder sort_order() const { return GSortOrder::None; }
virtual void set_key_column_and_sort_order(int, GSortOrder) {}
+ virtual StringView drag_data_type() const { return {}; }
+
void register_view(Badge<GAbstractView>, GAbstractView&);
void unregister_view(Badge<GAbstractView>, GAbstractView&);