AssistedNodeInformation.h [plain text]
#pragma once
#include "ArgumentCoders.h"
#include <WebCore/AutocapitalizeTypes.h>
#include <WebCore/Autofill.h>
#include <WebCore/IntRect.h>
#include <WebCore/URL.h>
#include <wtf/text/WTFString.h>
namespace WebKit {
enum class InputType {
None,
ContentEditable,
Text,
Password,
TextArea,
Search,
Email,
URL,
Phone,
Number,
NumberPad,
Date,
DateTime,
DateTimeLocal,
Month,
Week,
Time,
Select
};
#if PLATFORM(IOS)
struct OptionItem {
OptionItem() { }
OptionItem(const OptionItem& item)
: text(item.text)
, isGroup(item.isGroup)
, isSelected(item.isSelected)
, disabled(item.disabled)
, parentGroupID(item.parentGroupID)
{
}
OptionItem(const String& text, bool isGroup, int parentID, bool selected, bool disabled)
: text(text)
, isGroup(isGroup)
, isSelected(selected)
, disabled(disabled)
, parentGroupID(parentID)
{
}
String text;
bool isGroup { false };
bool isSelected { false };
bool disabled { false };
int parentGroupID { 0 };
void encode(IPC::Encoder&) const;
static std::optional<OptionItem> decode(IPC::Decoder&);
};
struct AssistedNodeInformation {
WebCore::IntRect elementRect;
WebCore::IntRect selectionRect;
double minimumScaleFactor { -INFINITY };
double maximumScaleFactor { INFINITY };
double maximumScaleFactorIgnoringAlwaysScalable { INFINITY };
double nodeFontSize { 0 };
bool hasNextNode { false };
bool hasPreviousNode { false };
bool isAutocorrect { false };
bool isRTL { false };
bool isMultiSelect { false };
bool isReadOnly {false };
bool allowsUserScaling { false };
bool allowsUserScalingIgnoringAlwaysScalable { false };
bool insideFixedPosition { false };
AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault };
InputType elementType { InputType::None };
String formAction;
Vector<OptionItem> selectOptions;
int selectedIndex { -1 };
String value;
double valueAsNumber { 0 };
String title;
bool acceptsAutofilledLoginCredentials { false };
WebCore::URL representingPageURL;
WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None };
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, AssistedNodeInformation&);
};
#endif
}