CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UILayoutSolver Class Reference

#include <CeresEngine/UI/UILayoutSolver.hpp>

Public Member Functions

 UILayoutSolver (UIView &view)
 
Span< const UILayoutConstraintgetConstraints () const
 
void setConstraints (const Span< const UILayoutConstraint > &constraints)
 
void setConstraints (Vector< UILayoutConstraint > &&constraints)
 
void addConstraint (const UILayoutConstraint &constraint)
 Add a constraint to the solver.
 
void addConstraints (const Span< const UILayoutConstraint > &constraints)
 
void removeConstraint (const UILayoutConstraint &constraint)
 Remove a constraint from the solver.
 
void removeConstraints (const Span< const UILayoutConstraint > &constraints)
 
bool hasConstraint (const UILayoutConstraint &constraint) const
 Test whether a constraint has been added to the solver.
 
void solve (const UIRect &bounds)
 Solves the layout for the given bounds frame.
 
UISize solveFittingSize (const UISize &targetSize)
 
void setNeedsRebuild ()
 
void rebuildIfNeeded ()
 
void rebuild ()
 

Private Attributes

UIViewmView
 The view this solver solves the layout for.
 
Constraint::ConstraintSolver mSolver
 
Vector< UILayoutConstraintmConstraints
 The.
 
bool mNeedsRebuild = true
 Determines if the solver needs to be rebuilt.
 

Constructor & Destructor Documentation

◆ UILayoutSolver()

CeresEngine::UILayoutSolver::UILayoutSolver ( UIView view)

Member Function Documentation

◆ addConstraint()

void CeresEngine::UILayoutSolver::addConstraint ( const UILayoutConstraint constraint)

Add a constraint to the solver.

Exceptions
DuplicateConstraintThe given constraint has already been added to the solver.
UnsatisfiableConstraintThe given constraint is required and cannot be satisfied.

◆ addConstraints()

void CeresEngine::UILayoutSolver::addConstraints ( const Span< const UILayoutConstraint > &  constraints)

◆ getConstraints()

Span< const UILayoutConstraint > CeresEngine::UILayoutSolver::getConstraints ( ) const

◆ hasConstraint()

bool CeresEngine::UILayoutSolver::hasConstraint ( const UILayoutConstraint constraint) const

Test whether a constraint has been added to the solver.

◆ rebuild()

void CeresEngine::UILayoutSolver::rebuild ( )

◆ rebuildIfNeeded()

void CeresEngine::UILayoutSolver::rebuildIfNeeded ( )

◆ removeConstraint()

void CeresEngine::UILayoutSolver::removeConstraint ( const UILayoutConstraint constraint)

Remove a constraint from the solver.

Exceptions
UnknownConstraintThe given constraint has not been added to the solver.

◆ removeConstraints()

void CeresEngine::UILayoutSolver::removeConstraints ( const Span< const UILayoutConstraint > &  constraints)

◆ setConstraints() [1/2]

void CeresEngine::UILayoutSolver::setConstraints ( const Span< const UILayoutConstraint > &  constraints)

◆ setConstraints() [2/2]

void CeresEngine::UILayoutSolver::setConstraints ( Vector< UILayoutConstraint > &&  constraints)

◆ setNeedsRebuild()

void CeresEngine::UILayoutSolver::setNeedsRebuild ( )

◆ solve()

void CeresEngine::UILayoutSolver::solve ( const UIRect bounds)

Solves the layout for the given bounds frame.

◆ solveFittingSize()

UISize CeresEngine::UILayoutSolver::solveFittingSize ( const UISize targetSize)

Member Data Documentation

◆ mConstraints

Vector<UILayoutConstraint> CeresEngine::UILayoutSolver::mConstraints
private

The.

◆ mNeedsRebuild

bool CeresEngine::UILayoutSolver::mNeedsRebuild = true
private

Determines if the solver needs to be rebuilt.

◆ mSolver

Constraint::ConstraintSolver CeresEngine::UILayoutSolver::mSolver
private

◆ mView

UIView& CeresEngine::UILayoutSolver::mView
private

The view this solver solves the layout for.


The documentation for this class was generated from the following file: