mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8bd3edec88
Reviewed By: aaronabramov Differential Revision: D33367752 fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and 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 <memory>
|
|
#include <string>
|
|
|
|
#include <react/renderer/core/EventTarget.h>
|
|
#include <react/renderer/core/ValueFactory.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* Represents ready-to-dispatch event object.
|
|
*/
|
|
struct RawEvent {
|
|
/*
|
|
* Defines category of a native platform event. This is used to deduce types
|
|
* of events for Concurrent Mode.
|
|
* This enum is duplicated for JNI access in `EventCategoryDef.java`, keep in
|
|
* sync.
|
|
*/
|
|
enum class Category {
|
|
/*
|
|
* Start of a continuous event. To be used with touchStart.
|
|
*/
|
|
ContinuousStart = 0,
|
|
|
|
/*
|
|
* End of a continuous event. To be used with touchEnd.
|
|
*/
|
|
ContinuousEnd = 1,
|
|
|
|
/*
|
|
* Priority for this event will be determined from other events in the
|
|
* queue. If it is triggered by continuous event, its priority will be
|
|
* default. If it is not triggered by continuous event, its priority will be
|
|
* discrete.
|
|
*/
|
|
Unspecified = 2,
|
|
|
|
/*
|
|
* Forces discrete type for the event. Regardless if continuous event is
|
|
* ongoing.
|
|
*/
|
|
Discrete = 3,
|
|
|
|
/*
|
|
* Forces continuous type for the event. Regardless if continuous event
|
|
* isn't ongoing.
|
|
*/
|
|
Continuous = 4
|
|
};
|
|
|
|
RawEvent(
|
|
std::string type,
|
|
ValueFactory payloadFactory,
|
|
SharedEventTarget eventTarget,
|
|
Category category = Category::Unspecified);
|
|
|
|
std::string type;
|
|
ValueFactory payloadFactory;
|
|
SharedEventTarget eventTarget;
|
|
Category category;
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|