react-native/ReactCommon/fabric/view/ViewShadowNode.h
Valentin Shergin b13d5beb11 Fabric: LayoutableShadowNodeList::getChildren renamed to getLayoutableChildNodes
Summary:
The previous name conflicts with the method with same (but with different semantic) name in `ShadowNode` class.
That was bad idea to use same name especially because the different semantic.

Reviewed By: fkgozali

Differential Revision: D7554549

fbshipit-source-id: 0bccbaacd0812f8a26592b2008f15ddb5bc34ebc
2018-04-10 17:15:08 -07:00

69 lines
1.9 KiB
C++

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* 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 <fabric/core/ConcreteShadowNode.h>
#include <fabric/core/LayoutableShadowNode.h>
#include <fabric/core/ShadowNode.h>
#include <fabric/view/AccessibleShadowNode.h>
#include <fabric/view/ViewProps.h>
#include <fabric/view/YogaLayoutableShadowNode.h>
namespace facebook {
namespace react {
class ViewShadowNode;
using SharedViewShadowNode = std::shared_ptr<const ViewShadowNode>;
class ViewShadowNode:
public ConcreteShadowNode<ViewProps>,
public AccessibleShadowNode,
public YogaLayoutableShadowNode {
static_assert(std::is_base_of<YogaStylableProps, ViewProps>::value, "ViewProps must be a descendant of YogaStylableProps");
static_assert(std::is_base_of<AccessibilityProps, ViewProps>::value, "ViewProps must be a descendant of AccessibilityProps");
public:
ViewShadowNode(
const Tag &tag,
const Tag &rootTag,
const InstanceHandle &instanceHandle,
const SharedViewProps &props = ViewShadowNode::defaultSharedProps(),
const SharedShadowNodeSharedList &children = ShadowNode::emptySharedShadowNodeSharedList()
);
ViewShadowNode(
const SharedViewShadowNode &shadowNode,
const SharedViewProps &props = nullptr,
const SharedShadowNodeSharedList &children = nullptr
);
ComponentName getComponentName() const override;
void appendChild(const SharedShadowNode &child);
#pragma mark - Equality
bool operator==(const ShadowNode& rhs) const override;
#pragma mark - DebugStringConvertible
SharedDebugStringConvertibleList getDebugProps() const override;
private:
#pragma mark - LayoutableShadowNode
SharedLayoutableShadowNodeList getLayoutableChildNodes() const override;
SharedLayoutableShadowNode cloneAndReplaceChild(const SharedLayoutableShadowNode &child) override;
};
} // namespace react
} // namespace facebook