class __attribute__()

in ComponentKit/Core/ComponentBuilder.h [649:759]


class __attribute__((__may_alias__)) ComponentBuilderBaseSizeOnly : public BuilderBase<Derived, PropsBitmap> {
public:
  ComponentBuilderBaseSizeOnly() = default;

  ComponentBuilderBaseSizeOnly(const CK::ComponentSpecContext& context)
    : BuilderBase<Derived, PropsBitmap>{context} { }

  ~ComponentBuilderBaseSizeOnly() = default;

  /**
   The width of the component relative to its parent's size.
   */
  auto &width(RCRelativeDimension w)
  {
    _size.width = w;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The width of the component.
   */
  auto &width(CGFloat w)
  {
    _size.width = w;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The height of the component relative to its parent's size.
   */
  auto &height(RCRelativeDimension h)
  {
    _size.height = h;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The height of the component.
   */
  auto &height(CGFloat h)
  {
    _size.height = h;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The minumum allowable width of the component relative to its parent's size.
   */
  auto &minWidth(RCRelativeDimension w)
  {
    _size.minWidth = w;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The minumum allowable height of the component relative to its parent's size.
   */
  auto &minHeight(RCRelativeDimension h)
  {
    _size.minHeight = h;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The maximum allowable width of the component relative to its parent's size.
   */
  auto &maxWidth(RCRelativeDimension w)
  {
    _size.maxWidth = w;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   The maximum allowable height of the component relative to its parent's size.
   */
  auto &maxHeight(RCRelativeDimension h)
  {
    _size.maxHeight = h;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   Specifies a size constraint that should apply to this component.
   */
  auto &size(RCComponentSize &&s)
  {
    _size = std::move(s);
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

  /**
   Specifies a size constraint that should apply to this component.
   */
  auto &size(const RCComponentSize &s)
  {
    _size = s;
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }
  
  /**
   Specifies a size constraint that should apply to this component.
   */
  auto &size(const CGSize &s)
  {
    _size = RCComponentSize::fromCGSize(s);
    return reinterpret_cast<Derived<PropsBitmap | ComponentBuilderBaseSizeOnlyPropId::size> &>(*this);
  }

protected:
  RCComponentSize _size;
};