2016-08-04 08:19:59 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package com.facebook.csslayout;
|
|
|
|
|
|
|
|
public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
|
|
|
|
|
|
|
|
interface MeasureFunction {
|
2016-10-27 10:52:09 -07:00
|
|
|
/**
|
|
|
|
* Return a value created by MeasureOutput.make(width, height);
|
|
|
|
*/
|
|
|
|
long measure(
|
2016-08-04 08:19:59 -07:00
|
|
|
CSSNodeAPI node,
|
|
|
|
float width,
|
2016-12-02 05:47:43 -08:00
|
|
|
YogaMeasureMode widthMode,
|
2016-08-04 08:19:59 -07:00
|
|
|
float height,
|
2016-12-02 05:47:43 -08:00
|
|
|
YogaMeasureMode heightMode);
|
2016-08-04 08:19:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int getChildCount();
|
|
|
|
CSSNodeType getChildAt(int i);
|
|
|
|
void addChildAt(CSSNodeType child, int i);
|
|
|
|
CSSNodeType removeChildAt(int i);
|
|
|
|
CSSNodeType getParent();
|
|
|
|
int indexOf(CSSNodeType child);
|
|
|
|
void setMeasureFunction(MeasureFunction measureFunction);
|
|
|
|
boolean isMeasureDefined();
|
2016-11-29 12:23:02 -08:00
|
|
|
void calculateLayout();
|
2016-08-04 08:19:59 -07:00
|
|
|
boolean isDirty();
|
|
|
|
boolean hasNewLayout();
|
|
|
|
void dirty();
|
|
|
|
void markLayoutSeen();
|
2016-11-17 09:10:47 -08:00
|
|
|
void copyStyle(CSSNodeType srcNode);
|
2016-12-02 05:47:43 -08:00
|
|
|
YogaDirection getStyleDirection();
|
|
|
|
void setDirection(YogaDirection direction);
|
|
|
|
YogaFlexDirection getFlexDirection();
|
|
|
|
void setFlexDirection(YogaFlexDirection flexDirection);
|
|
|
|
YogaJustify getJustifyContent();
|
|
|
|
void setJustifyContent(YogaJustify justifyContent);
|
|
|
|
YogaAlign getAlignItems();
|
|
|
|
void setAlignItems(YogaAlign alignItems);
|
|
|
|
YogaAlign getAlignSelf();
|
|
|
|
void setAlignSelf(YogaAlign alignSelf);
|
|
|
|
YogaAlign getAlignContent();
|
|
|
|
void setAlignContent(YogaAlign alignContent);
|
|
|
|
YogaPositionType getPositionType();
|
|
|
|
void setPositionType(YogaPositionType positionType);
|
|
|
|
void setWrap(YogaWrap flexWrap);
|
2016-08-04 08:19:59 -07:00
|
|
|
void setFlex(float flex);
|
2016-08-23 04:36:55 -07:00
|
|
|
float getFlexGrow();
|
|
|
|
void setFlexGrow(float flexGrow);
|
|
|
|
float getFlexShrink();
|
|
|
|
void setFlexShrink(float flexShrink);
|
|
|
|
float getFlexBasis();
|
|
|
|
void setFlexBasis(float flexBasis);
|
2016-12-02 05:47:43 -08:00
|
|
|
float getMargin(YogaEdge edge);
|
|
|
|
void setMargin(YogaEdge edge, float margin);
|
|
|
|
float getPadding(YogaEdge edge);
|
|
|
|
void setPadding(YogaEdge edge, float padding);
|
|
|
|
float getBorder(YogaEdge edge);
|
|
|
|
void setBorder(YogaEdge edge, float border);
|
|
|
|
float getPosition(YogaEdge edge);
|
|
|
|
void setPosition(YogaEdge edge, float position);
|
2016-11-29 09:04:43 -08:00
|
|
|
float getWidth();
|
|
|
|
void setWidth(float width);
|
|
|
|
float getHeight();
|
|
|
|
void setHeight(float height);
|
|
|
|
float getMaxWidth();
|
|
|
|
void setMaxWidth(float maxWidth);
|
|
|
|
float getMinWidth();
|
|
|
|
void setMinWidth(float minWidth);
|
|
|
|
float getMaxHeight();
|
|
|
|
void setMaxHeight(float maxHeight);
|
|
|
|
float getMinHeight();
|
|
|
|
void setMinHeight(float minHeight);
|
2016-08-04 08:19:59 -07:00
|
|
|
float getLayoutX();
|
|
|
|
float getLayoutY();
|
|
|
|
float getLayoutWidth();
|
|
|
|
float getLayoutHeight();
|
2016-12-02 05:47:43 -08:00
|
|
|
YogaDirection getLayoutDirection();
|
|
|
|
YogaOverflow getOverflow();
|
|
|
|
void setOverflow(YogaOverflow overflow);
|
2016-08-04 08:20:07 -07:00
|
|
|
void setData(Object data);
|
|
|
|
Object getData();
|
2016-10-24 10:35:41 -07:00
|
|
|
void reset();
|
2016-08-04 08:19:59 -07:00
|
|
|
}
|