Files
react-native/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputEventEmitter.h
T
Joshua Gross 5abe5843e2 Add C++ AndroidTextInput component for backwards-compatible Fabric support of TextInput on Android
Summary: Support existing, backwards-compatible AndroidTextInput component for minimal support of TextInput on Android.

Reviewed By: shergin, mdvacca

Differential Revision: D17086758

fbshipit-source-id: 25726f22229e0d5dfe96eb36b386a5317601283d
2019-08-30 19:04:14 -07:00

149 lines
3.2 KiB
C++

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/view/ViewEventEmitter.h>
namespace facebook {
namespace react {
struct AndroidTextInputOnBlurStruct {
int target;
};
struct AndroidTextInputOnFocusStruct {
int target;
};
struct AndroidTextInputOnChangeStruct {
int target;
int eventCount;
std::string text;
};
struct AndroidTextInputOnChangeTextStruct {
int target;
int eventCount;
std::string text;
};
struct AndroidTextInputOnContentSizeChangeContentSizeStruct {
double width;
double height;
};
struct AndroidTextInputOnContentSizeChangeStruct {
int target;
AndroidTextInputOnContentSizeChangeContentSizeStruct contentSize;
};
struct AndroidTextInputOnTextInputRangeStruct {
double start;
double end;
};
struct AndroidTextInputOnTextInputStruct {
int target;
std::string text;
std::string previousText;
AndroidTextInputOnTextInputRangeStruct range;
};
struct AndroidTextInputOnEndEditingStruct {
int target;
std::string text;
};
struct AndroidTextInputOnSelectionChangeSelectionStruct {
double start;
double end;
};
struct AndroidTextInputOnSelectionChangeStruct {
int target;
AndroidTextInputOnSelectionChangeSelectionStruct selection;
};
struct AndroidTextInputOnSubmitEditingStruct {
int target;
std::string text;
};
struct AndroidTextInputOnKeyPressStruct {
int target;
std::string key;
};
struct AndroidTextInputOnScrollContentInsetStruct {
double top;
double bottom;
double left;
double right;
};
struct AndroidTextInputOnScrollContentOffsetStruct {
double x;
double y;
};
struct AndroidTextInputOnScrollContentSizeStruct {
double width;
double height;
};
struct AndroidTextInputOnScrollLayoutMeasurementStruct {
double width;
double height;
};
struct AndroidTextInputOnScrollVelocityStruct {
double x;
double y;
};
struct AndroidTextInputOnScrollStruct {
int target;
bool responderIgnoreScroll;
AndroidTextInputOnScrollContentInsetStruct contentInset;
AndroidTextInputOnScrollContentOffsetStruct contentOffset;
AndroidTextInputOnScrollContentSizeStruct contentSize;
AndroidTextInputOnScrollLayoutMeasurementStruct layoutMeasurement;
AndroidTextInputOnScrollVelocityStruct velocity;
};
class AndroidTextInputEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;
void onBlur(AndroidTextInputOnBlurStruct value) const;
void onFocus(AndroidTextInputOnFocusStruct value) const;
void onChange(AndroidTextInputOnChangeStruct value) const;
void onChangeText(AndroidTextInputOnChangeTextStruct value) const;
void onContentSizeChange(
AndroidTextInputOnContentSizeChangeStruct value) const;
void onTextInput(AndroidTextInputOnTextInputStruct value) const;
void onEndEditing(AndroidTextInputOnEndEditingStruct value) const;
void onSelectionChange(AndroidTextInputOnSelectionChangeStruct value) const;
void onSubmitEditing(AndroidTextInputOnSubmitEditingStruct value) const;
void onKeyPress(AndroidTextInputOnKeyPressStruct value) const;
void onScroll(AndroidTextInputOnScrollStruct value) const;
};
} // namespace react
} // namespace facebook