TrackManiaControl/libs/FML/Types/Container.php

47 lines
999 B
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-06-21 03:18:21 +02:00
* Add a new child Element
*
2014-06-21 03:18:21 +02:00
* @param Renderable $child Child Control to add
2014-07-03 22:34:47 +02:00
* @return static
*/
2014-05-14 23:24:00 +02:00
public function add(Renderable $child);
/**
2014-06-21 03:18:21 +02:00
* Remove all children
2014-01-19 19:30:21 +01:00
*
2014-07-03 22:34:47 +02:00
* @return static
*/
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
2014-07-03 22:34:47 +02:00
* @return 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
2014-07-03 22:34:47 +02:00
* @return \FML\Elements\Format
2014-01-19 19:30:21 +01:00
*/
public function getFormat($createIfEmpty = true);
}