TrackManiaControl/application/core/Libs/FML/Types/Container.php

47 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace FML\Types;
2014-01-19 19:30:21 +01:00
use FML\Elements\Format;
/**
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>
2014-04-13 18:21:40 +02:00
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
2014-05-14 23:24:00 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Container {
/**
2014-05-14 23:24:00 +02:00
* Add a new Child Element
*
2014-05-14 23:24:00 +02:00
* @param Renderable $child The Child Control to add
2014-01-19 19:30:21 +01:00
* @return \FML\Types\Container
*/
2014-05-14 23:24:00 +02:00
public function add(Renderable $child);
/**
2013-12-31 02:55:19 +01:00
* Remove all Children
2014-01-19 19:30:21 +01:00
*
* @return \FML\Types\Container
*/
public function removeChildren();
2014-01-19 19:30:21 +01:00
/**
* Set the Format Object of the Container
*
* @param Format $format New Format Object
* @return \FML\Types\Container
*/
public function setFormat(Format $format);
/**
* Get the Format Object of the Container
2014-05-14 23:24:00 +02:00
*
2014-01-19 19:30:21 +01:00
* @param bool $createIfEmpty (optional) Whether the Format Object should be created if it's not set yet
* @return \FML\Elements\Format
*/
public function getFormat($createIfEmpty = true);
}