TrackManiaControl/libs/FML/Types/Container.php

96 lines
1.9 KiB
PHP
Raw Normal View History

<?php
namespace FML\Types;
2014-01-19 19:30:21 +01:00
use FML\Elements\Format;
2017-04-02 16:32:57 +02:00
use FML\Stylesheet\Style;
2014-01-19 19:30:21 +01:00
/**
2014-01-19 19:30:21 +01:00
* Interface for Element being able to contain other Controls
*
2014-05-20 15:44:45 +02:00
* @author steeffeen <mail@steeffeen.com>
2017-03-25 18:40:15 +01:00
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
2014-05-14 23:24:00 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
2017-03-25 18:40:15 +01:00
interface Container
{
/**
* Get the children
*
* @api
* @return Renderable[]
*/
public function getChildren();
/**
* Add a new child
*
* @api
* @param Renderable $child Child Control to add
* @return static
*/
public function addChild(Renderable $child);
2017-04-02 16:32:57 +02:00
/**
* Add a new child
*
* @api
* @param Renderable $child Child Control to add
* @return static
* @deprecated Use addChild()
* @see Container::addChild()
*/
public function add(Renderable $child);
2017-03-25 18:40:15 +01:00
/**
* Add new children
*
* @api
* @param Renderable[] $children Child Controls to add
* @return static
*/
public function addChildren(array $children);
/**
* Remove all children
*
* @api
* @return static
*/
public function removeAllChildren();
2017-04-02 16:32:57 +02:00
/**
* Remove all children
*
* @api
* @return static
* @deprecated Use removeAllChildren()
* @see Container::removeAllChildren()
*/
public function removeChildren();
2017-03-25 18:40:15 +01:00
/**
* Get the Format
*
* @api
2017-04-02 16:32:57 +02:00
* @param bool $createIfEmpty If the format should be created if it doesn't exist yet
2017-03-25 18:40:15 +01:00
* @return Format
2017-04-02 16:32:57 +02:00
* @deprecated Use Style
* @see Style
2017-03-25 18:40:15 +01:00
*/
2017-04-02 16:32:57 +02:00
public function getFormat($createIfEmpty = true);
2017-03-25 18:40:15 +01:00
/**
* Set the Format
*
* @api
* @param Format $format New Format
* @return static
2017-04-02 16:32:57 +02:00
* @deprecated Use Style
* @see Style
2017-03-25 18:40:15 +01:00
*/
public function setFormat(Format $format = null);
}