chromium/ui/views/layout/flex_layout_types.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/layout/flex_layout_types.h"

#include <algorithm>
#include <tuple>
#include <utility>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/layout/layout_types.h"
#include "ui/views/view.h"

namespace views {

namespace {

// Default Flex Rules ----------------------------------------------------------

constexpr MaximumFlexSizeRule kDefaultMaximumFlexSizeRule =;

class LazySize;

// Helper object that lazily returns either the width or height of a LazySize
// (see below).
class LazyDimension {};

// Some of a view's sizing methods can be expensive to compute. This provides
// a lazy-eval value that behaves like a smart pointer but is more lightweight
// than base::LazyInstance.
class LazySize {};

int LazyDimension::get() const {}

// Interpolates a size between minimum, preferred size, and upper bound based on
// sizing rules, returning the resulting ideal size.
int InterpolateSize(MinimumFlexSizeRule minimum_size_rule,
                    MaximumFlexSizeRule maximum_size_rule,
                    int minimum_size,
                    int preferred_size,
                    LazyDimension maximum_size,
                    int available_size) {}

gfx::Size GetPreferredSize(MinimumFlexSizeRule minimum_width_rule,
                           MaximumFlexSizeRule maximum_width_rule,
                           MinimumFlexSizeRule minimum_height_rule,
                           MaximumFlexSizeRule maximum_height_rule,
                           bool adjust_height_for_width,
                           const View* view,
                           const SizeBounds& size_bounds) {}

}  // namespace

// FlexSpecification -----------------------------------------------------------

FlexSpecification::FlexSpecification()
    :{}

FlexSpecification::FlexSpecification(FlexRule rule)
    :{}

FlexSpecification::FlexSpecification(MinimumFlexSizeRule minimum_size_rule,
                                     MaximumFlexSizeRule maximum_size_rule,
                                     bool adjust_height_for_width)
    :{}

FlexSpecification::FlexSpecification(
    LayoutOrientation orientation,
    MinimumFlexSizeRule minimum_main_axis_rule,
    MaximumFlexSizeRule maximum_main_axis_rule,
    bool adjust_height_for_width,
    MinimumFlexSizeRule minimum_cross_axis_rule)
    :{}

FlexSpecification::FlexSpecification(const FlexSpecification& other) = default;

FlexSpecification& FlexSpecification::operator=(
    const FlexSpecification& other) = default;

FlexSpecification::~FlexSpecification() = default;

FlexSpecification FlexSpecification::WithWeight(int weight) const {}

FlexSpecification FlexSpecification::WithOrder(int order) const {}

FlexSpecification FlexSpecification::WithAlignment(
    LayoutAlignment alignment) const {}

// Inset1D ---------------------------------------------------------------------

void Inset1D::SetInsets(int leading, int trailing) {}

void Inset1D::Expand(int leading, int trailing) {}

bool Inset1D::operator==(const Inset1D& other) const {}

bool Inset1D::operator!=(const Inset1D& other) const {}

bool Inset1D::operator<(const Inset1D& other) const {}

std::string Inset1D::ToString() const {}

// Span ------------------------------------------------------------------------

void Span::SetSpan(int start, int length) {}

void Span::Expand(int leading, int trailing) {}

void Span::Inset(int leading, int trailing) {}

void Span::Inset(const Inset1D& insets) {}

void Span::Center(const Span& container, const Inset1D& margins) {}

void Span::Align(const Span& container,
                 LayoutAlignment alignment,
                 const Inset1D& margins) {}

bool Span::operator==(const Span& other) const {}

bool Span::operator!=(const Span& other) const {}

bool Span::operator<(const Span& other) const {}

std::string Span::ToString() const {}

}  // namespace views