StaticPasteboard.h [plain text]
#pragma once
#include "Pasteboard.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
#include <wtf/text/StringHash.h>
namespace WebCore {
class StaticPasteboard final : public Pasteboard {
public:
StaticPasteboard();
PasteboardCustomData takeCustomData();
bool isStatic() const final { return true; }
bool hasData() final;
Vector<String> typesSafeForBindings(const String&) final { return m_types; }
Vector<String> typesForLegacyUnsafeBindings() final { return m_types; }
String readOrigin() final { return { }; }
String readString(const String& type) final;
String readStringInCustomData(const String& type) final;
void writeString(const String& type, const String& data) final;
void writeStringInCustomData(const String& type, const String& data);
void clear() final;
void clear(const String& type) final;
void read(PasteboardPlainText&) final { }
void read(PasteboardWebContentReader&, WebContentReadingPolicy) final { }
void write(const PasteboardURL&) final { }
void write(const PasteboardImage&) final { }
void write(const PasteboardWebContent&) final { }
void writeCustomData(const PasteboardCustomData&) final { }
bool containsFiles() final { return false; }
bool canSmartReplace() final { return false; }
void writeMarkup(const String&) final { }
void writePlainText(const String&, SmartReplaceOption) final { }
#if ENABLE(DRAG_SUPPORT)
void setDragImage(DragImage, const IntPoint&) final { }
#endif
private:
Vector<String> m_types;
HashMap<String, String> m_platformData;
HashMap<String, String> m_customData;
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StaticPasteboard)
static bool isType(const WebCore::Pasteboard& pasteboard) { return pasteboard.isStatic(); }
SPECIALIZE_TYPE_TRAITS_END()