chromium/ui/views/layout/table_layout.cc

// Copyright 2021 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/table_layout.h"

#include <algorithm>
#include <functional>
#include <memory>
#include <numeric>
#include <optional>
#include <utility>

#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/layout/layout_types.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"

namespace views {

namespace {

// A LayoutElement has a size and location along one axis. It contains methods
// that are used along both axes.
class LayoutElement {};

// Invokes ResetSize on all the layout elements.
template <class T>
void ResetSizes(std::vector<T>& elements) {}

// Distributes delta among the resizable elements. Each resizable element is
// given (resize() / total_resize * delta) DIP of extra space.
template <class T>
void DistributeDelta(int delta, std::vector<T>& elements) {}

// Returns the sum of the size of the elements from `start` to
// `start` + `length`.
template <class T>
int TotalSize(size_t start, size_t length, const std::vector<T>& elements) {}

// Advances `index` past any padding elements.
template <class T>
void SkipPadding(size_t& index, const std::vector<T>& elements) {}

void CalculateLocationAndSize(int pref_size,
                              LayoutAlignment alignment,
                              int* location,
                              int* size) {}

}  // namespace

constexpr float TableLayout::kFixedSize;

// As the name implies, this represents a Column. Column contains default values
// for views originating in this column.
class TableLayout::Column : public LayoutElement {};

class TableLayout::Row : public LayoutElement {};

// Identifies the location in the grid of a particular view, along with
// placement information and size information.
struct TableLayout::ViewState {};

TableLayout::TableLayout() = default;

TableLayout::~TableLayout() = default;

TableLayout& TableLayout::AddColumn(LayoutAlignment h_align,
                                    LayoutAlignment v_align,
                                    float horizontal_resize,
                                    ColumnSize size_type,
                                    int fixed_width,
                                    int min_width) {}

TableLayout& TableLayout::AddPaddingColumn(float horizontal_resize, int width) {}

TableLayout& TableLayout::AddRows(size_t n, float vertical_resize, int height) {}

TableLayout& TableLayout::AddPaddingRow(float vertical_resize, int height) {}

TableLayout& TableLayout::LinkColumnSizes(std::vector<size_t> columns) {}

TableLayout& TableLayout::SetLinkedColumnSizeLimit(int size_limit) {}

TableLayout& TableLayout::SetMinimumSize(const gfx::Size& size) {}

ProposedLayout TableLayout::CalculateProposedLayout(
    const SizeBounds& size_bounds) const {}

void TableLayout::SetViewStates() const {}

gfx::Size TableLayout::SizeRowsAndColumns(const SizeBounds& bounds) const {}

void TableLayout::DistributeRemainingHeight(ViewState& view_state) const {}

void TableLayout::UnifyLinkedColumnSizes() const {}

void TableLayout::DistributeRemainingWidth(ViewState& view_state) const {}

int TableLayout::LayoutWidth() const {}

void TableLayout::CalculateSize(
    SizeCalculationType type,
    const std::vector<raw_ptr<ViewState, VectorExperimental>>& view_states)
    const {}

void TableLayout::Resize(int delta) const {}

void TableLayout::ResizeUsingMin(int total_delta) const {}

bool TableLayout::CanUseMinimum(const ViewState& view_state) const {}

}  // namespace views