InjectedBundlePageEditorClient.h [plain text]
#pragma once
#include "APIClient.h"
#include "APIInjectedBundleEditorClient.h"
#include "WKBundlePageEditorClient.h"
namespace API {
template<> struct ClientTraits<WKBundlePageEditorClientBase> {
typedef std::tuple<WKBundlePageEditorClientV0, WKBundlePageEditorClientV1, WKBundlePageEditorClientV2> Versions;
};
}
namespace WebCore {
class CSSStyleDeclaration;
class DocumentFragment;
class Node;
class Range;
}
namespace WebKit {
class WebFrame;
class WebPage;
class InjectedBundlePageEditorClient final : public API::Client<WKBundlePageEditorClientBase>, public API::InjectedBundle::EditorClient {
public:
explicit InjectedBundlePageEditorClient(const WKBundlePageEditorClientBase&);
private:
bool shouldBeginEditing(WebPage&, WebCore::Range*) final;
bool shouldEndEditing(WebPage&, WebCore::Range*) final;
bool shouldInsertNode(WebPage&, WebCore::Node*, WebCore::Range* rangeToReplace, WebCore::EditorInsertAction) final;
bool shouldInsertText(WebPage&, StringImpl*, WebCore::Range* rangeToReplace, WebCore::EditorInsertAction) final;
bool shouldDeleteRange(WebPage&, WebCore::Range*) final;
bool shouldChangeSelectedRange(WebPage&, WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) final;
bool shouldApplyStyle(WebPage&, WebCore::CSSStyleDeclaration*, WebCore::Range*) final;
void didBeginEditing(WebPage&, StringImpl* notificationName) final;
void didEndEditing(WebPage&, StringImpl* notificationName) final;
void didChange(WebPage&, StringImpl* notificationName) final;
void didChangeSelection(WebPage&, StringImpl* notificationName) final;
void willWriteToPasteboard(WebPage&, WebCore::Range*) final;
void getPasteboardDataForRange(WebPage&, WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
void didWriteToPasteboard(WebPage&) final;
bool performTwoStepDrop(WebPage&, WebCore::DocumentFragment&, WebCore::Range& destination, bool isMove) final;
String replacementURLForResource(WebPage&, Ref<WebCore::SharedBuffer>&& resourceData, const String&) final;
};
}