2013-11-25 00:02:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FML\Types;
|
|
|
|
|
2014-01-19 19:30:21 +01:00
|
|
|
use FML\Elements\Format;
|
|
|
|
|
2013-11-25 00:02:07 +01:00
|
|
|
/**
|
2014-01-19 19:30:21 +01:00
|
|
|
* Interface for Element being able to contain other Controls
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
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
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
interface Container {
|
|
|
|
|
|
|
|
/**
|
2014-06-21 03:18:21 +02:00
|
|
|
* Add a new child Element
|
2013-11-25 00:02:07 +01:00
|
|
|
*
|
2014-06-21 03:18:21 +02:00
|
|
|
* @param Renderable $child Child Control to add
|
|
|
|
* @return \FML\Types\Container|static
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
2014-05-14 23:24:00 +02:00
|
|
|
public function add(Renderable $child);
|
2013-11-25 00:02:07 +01:00
|
|
|
|
|
|
|
/**
|
2014-06-21 03:18:21 +02:00
|
|
|
* Remove all children
|
2014-01-19 19:30:21 +01:00
|
|
|
*
|
2014-06-21 03:18:21 +02:00
|
|
|
* @return \FML\Types\Container|static
|
2013-11-25 00:02:07 +01:00
|
|
|
*/
|
|
|
|
public function removeChildren();
|
2014-01-19 19:30:21 +01:00
|
|
|
|
|
|
|
/**
|
2014-06-21 03:18:21 +02:00
|
|
|
* Set the Format object of the Container
|
2014-01-19 19:30:21 +01:00
|
|
|
*
|
2014-06-21 03:18:21 +02:00
|
|
|
* @param Format $format New Format object
|
|
|
|
* @return \FML\Types\Container|static
|
2014-01-19 19:30:21 +01:00
|
|
|
*/
|
|
|
|
public function setFormat(Format $format);
|
|
|
|
|
|
|
|
/**
|
2014-06-21 03:18:21 +02:00
|
|
|
* Get the Format object of the Container
|
2014-05-14 23:24:00 +02:00
|
|
|
*
|
2014-06-21 03:18:21 +02:00
|
|
|
* @param bool $createIfEmpty (optional) Whether the Format object should be created if it's not set
|
|
|
|
* @return \FML\Elements\Format|static
|
2014-01-19 19:30:21 +01:00
|
|
|
*/
|
|
|
|
public function getFormat($createIfEmpty = true);
|
2013-11-25 00:02:07 +01:00
|
|
|
}
|