flex_enum.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. #ifndef WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
  20. #define WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
  21. #define WEEXCORE_CSS_DEFAULT_DIRECTION kDirectionLTR
  22. /* These enum definitions may also be used by C files. */
  23. #ifdef __cplusplus
  24. namespace WeexCore {
  25. #endif
  26. /**
  27. * MainAxis direction
  28. */
  29. enum WXCoreDirection {
  30. kDirectionInherit,
  31. kDirectionLTR,
  32. kDirectionRTL
  33. };
  34. /**
  35. * MainAxis direction
  36. */
  37. enum WXCoreFlexDirection {
  38. kFlexDirectionColumn,
  39. kFlexDirectionColumnReverse,
  40. kFlexDirectionRow,
  41. kFlexDirectionRowReverse,
  42. };
  43. /**
  44. * Controls the position of the element on the MainAxis
  45. */
  46. enum WXCoreJustifyContent {
  47. kJustifyFlexStart,
  48. kJustifyCenter,
  49. kJustifyFlexEnd,
  50. kJustifySpaceBetween,
  51. kJustifySpaceAround,
  52. };
  53. /**
  54. * Controls the position of the element on the CrossAxis and whether Stretch
  55. */
  56. enum WXCoreAlignItems {
  57. kAlignItemsFlexStart,
  58. kAlignItemsCenter,
  59. kAlignItemsFlexEnd,
  60. kAlignItemsStretch,
  61. };
  62. /**
  63. * Controls the count of flexlines
  64. */
  65. enum WXCoreFlexWrap {
  66. kNoWrap,
  67. kWrap,
  68. kWrapReverse,
  69. };
  70. /**
  71. * The align-self will overrides the align-items specified by the Flex container.
  72. * The two attributes have the same range of values.
  73. */
  74. enum WXCoreAlignSelf {
  75. kAlignSelfAuto = -1,
  76. kAlignSelfFlexStart = kAlignItemsFlexStart,
  77. kAlignSelfCenter = kAlignItemsCenter,
  78. kAlignSelfFlexEnd = kAlignItemsFlexEnd,
  79. kAlignSelfStretch = kAlignItemsStretch,
  80. };
  81. enum WXCorePositionType {
  82. kRelative,
  83. kAbsolute,
  84. kFixed,
  85. kSticky = kRelative
  86. };
  87. enum WXCorePositionEdge {
  88. kPositionEdgeTop,
  89. kPositionEdgeBottom,
  90. kPositionEdgeLeft,
  91. kPositionEdgeRight,
  92. };
  93. enum WXCoreMarginEdge {
  94. kMarginALL,
  95. kMarginTop,
  96. kMarginBottom,
  97. kMarginLeft,
  98. kMarginRight,
  99. };
  100. enum WXCorePaddingEdge {
  101. kPaddingALL,
  102. kPaddingTop,
  103. kPaddingBottom,
  104. kPaddingLeft,
  105. kPaddingRight,
  106. };
  107. enum WXCoreBorderWidthEdge {
  108. kBorderWidthALL,
  109. kBorderWidthTop,
  110. kBorderWidthBottom,
  111. kBorderWidthLeft,
  112. kBorderWidthRight,
  113. };
  114. enum WXCoreEdge{
  115. kTop,
  116. kRight,
  117. kBottom,
  118. kLeft,
  119. };
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif //WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H