summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/MimeData.h
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-11-07 23:14:21 +0330
committerAndreas Kling <kling@serenityos.org>2020-11-08 21:46:13 +0100
commit6d1e47e7dd1741aec64dd93a4d95ff1854e3abab (patch)
treed69b6ece9a552535db9d842e9b10b56928c505d5 /Libraries/LibCore/MimeData.h
parentc930e026240c2c255b77ad8b2322aeea9ab92ea3 (diff)
downloadserenity-6d1e47e7dd1741aec64dd93a4d95ff1854e3abab.zip
LibGUI+WindowServer: Make DragOperation hold a MimeData instance
...instead of maybe bitmap + a single mime type and its corresponding data. This allows drag&drop operations to hold multiple different kinds of data, and the views/applications to choose between those. For instance, Spreadsheet can keep the structure of the dragged cells, and still provide text-only data to be passed to different unrelated editors.
Diffstat (limited to 'Libraries/LibCore/MimeData.h')
-rw-r--r--Libraries/LibCore/MimeData.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibCore/MimeData.h b/Libraries/LibCore/MimeData.h
index 65bd56c121..fe575ab675 100644
--- a/Libraries/LibCore/MimeData.h
+++ b/Libraries/LibCore/MimeData.h
@@ -55,8 +55,14 @@ public:
Vector<URL> urls() const;
void set_urls(const Vector<URL>&);
+ const HashMap<String, ByteBuffer>& all_data() const { return m_data; }
+
private:
MimeData() { }
+ explicit MimeData(const HashMap<String, ByteBuffer>& data)
+ : m_data(data)
+ {
+ }
HashMap<String, ByteBuffer> m_data;
};