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> Versions;
};
}
namespace WebCore {
class CSSStyleDeclaration;
class DocumentFragment;
class Node;
struct SimpleRange;
}
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&, const WebCore::SimpleRange&) final;
bool shouldEndEditing(WebPage&, const WebCore::SimpleRange&) final;
bool shouldInsertNode(WebPage&, WebCore::Node&, const Optional<WebCore::SimpleRange>& rangeToReplace, WebCore::EditorInsertAction) final;
bool shouldInsertText(WebPage&, const String&, const Optional<WebCore::SimpleRange>& rangeToReplace, WebCore::EditorInsertAction) final;
bool shouldDeleteRange(WebPage&, const Optional<WebCore::SimpleRange>&) final;
bool shouldChangeSelectedRange(WebPage&, const Optional<WebCore::SimpleRange>& fromRange, const Optional<WebCore::SimpleRange>& toRange, WebCore::EAffinity, bool stillSelecting) final;
bool shouldApplyStyle(WebPage&, const WebCore::StyleProperties&, const Optional<WebCore::SimpleRange>&) final;
void didBeginEditing(WebPage&, const String& notificationName) final;
void didEndEditing(WebPage&, const String& notificationName) final;
void didChange(WebPage&, const String& notificationName) final;
void didChangeSelection(WebPage&, const String& notificationName) final;
void willWriteToPasteboard(WebPage&, const Optional<WebCore::SimpleRange>&) final;
void getPasteboardDataForRange(WebPage&, const Optional<WebCore::SimpleRange>&, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
void didWriteToPasteboard(WebPage&) final;
bool performTwoStepDrop(WebPage&, WebCore::DocumentFragment&, const WebCore::SimpleRange& destination, bool isMove) final;
};
}