InteractionInformationAtPosition.h [plain text]
#pragma once
#if PLATFORM(IOS_FAMILY)
#include "ArgumentCoders.h"
#include "InteractionInformationRequest.h"
#include "ShareableBitmap.h"
#include <WebCore/Cursor.h>
#include <WebCore/ElementContext.h>
#include <WebCore/IntPoint.h>
#include <WebCore/ScrollTypes.h>
#include <WebCore/SelectionRect.h>
#include <WebCore/TextIndicator.h>
#include <wtf/URL.h>
#include <wtf/text/WTFString.h>
namespace WebKit {
struct InteractionInformationAtPosition {
static InteractionInformationAtPosition invalidInformation()
{
InteractionInformationAtPosition response;
response.canBeValid = false;
return response;
}
InteractionInformationRequest request;
bool canBeValid { true };
Optional<bool> nodeAtPositionHasDoubleClickHandler;
bool isSelectable { false };
bool prefersDraggingOverTextSelection { false };
bool isNearMarkedText { false };
bool touchCalloutEnabled { true };
bool isLink { false };
bool isImage { false };
bool isAttachment { false };
bool isAnimatedImage { false };
bool isElement { false };
WebCore::ScrollingNodeID containerScrollingNodeID { 0 };
#if ENABLE(DATA_DETECTION)
bool isDataDetectorLink { false };
#endif
#if ENABLE(DATALIST_ELEMENT)
bool preventTextInteraction { false };
#endif
bool shouldNotUseIBeamInEditableContent { false };
WebCore::FloatPoint adjustedPointForNodeRespondingToClickEvents;
URL url;
URL imageURL;
String title;
String idAttribute;
WebCore::IntRect bounds;
#if PLATFORM(MACCATALYST)
WebCore::IntRect caretRect;
#endif
RefPtr<ShareableBitmap> image;
String textBefore;
String textAfter;
float caretHeight { 0 };
WebCore::FloatRect lineCaretExtent;
Optional<WebCore::Cursor> cursor;
WebCore::TextIndicatorData linkIndicator;
#if ENABLE(DATA_DETECTION)
String dataDetectorIdentifier;
RetainPtr<NSArray> dataDetectorResults;
#endif
Optional<WebCore::ElementContext> elementContext;
void mergeCompatibleOptionalInformation(const InteractionInformationAtPosition& oldInformation);
void encode(IPC::Encoder&) const;
static WARN_UNUSED_RETURN bool decode(IPC::Decoder&, InteractionInformationAtPosition&);
};
}
#endif // PLATFORM(IOS_FAMILY)