Files
react-native/ReactCommon/fabric/components/slider/SliderShadowNode.h
Marco Zandonadi 756dc2f3ed Fix #import/include in SliderShadowNode
Summary: This diff is a part of an effort to resolve build errors that appear when compiling with the latest version of clang.

Reviewed By: shergin

Differential Revision: D14369797

fbshipit-source-id: e4c6f53e293f336efad18597f9d2705c025e1051
2019-03-11 12:36:28 -07:00

59 lines
1.8 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/rncore/EventEmitters.h>
#include <react/components/rncore/Props.h>
#include <react/components/slider/SliderMeasurementsManager.h>
#include <react/components/view/ConcreteViewShadowNode.h>
#include <react/imagemanager/ImageManager.h>
#include <react/imagemanager/primitives.h>
namespace facebook {
namespace react {
extern const char SliderComponentName[];
/*
* `ShadowNode` for <Slider> component.
*/
class SliderShadowNode final : public ConcreteViewShadowNode<
SliderComponentName,
SliderProps,
SliderEventEmitter> {
public:
using ConcreteViewShadowNode::ConcreteViewShadowNode;
// Associates a shared `ImageManager` with the node.
void setImageManager(const SharedImageManager &imageManager);
// Associates a shared `SliderMeasurementsManager` with the node.
void setSliderMeasurementsManager(
const std::shared_ptr<SliderMeasurementsManager> &measurementsManager);
#pragma mark - LayoutableShadowNode
Size measure(LayoutConstraints layoutConstraints) const override;
void layout(LayoutContext layoutContext) override;
private:
// (Re)Creates a `LocalData` object (with `ImageRequest`) if needed.
void updateLocalData();
ImageSource getTrackImageSource() const;
ImageSource getMinimumTrackImageSource() const;
ImageSource getMaximumTrackImageSource() const;
ImageSource getThumbImageSource() const;
SharedImageManager imageManager_;
std::shared_ptr<SliderMeasurementsManager> measurementsManager_;
};
} // namespace react
} // namespace facebook