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

48 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace FML\Types;
2014-01-19 19:30:21 +01:00
use FML\Controls\Control;
use FML\Elements\Format;
/**
2014-01-19 19:30:21 +01:00
* Interface for Element being able to contain other Controls
*
* @author steeffeen
2014-04-13 18:21:40 +02:00
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Container {
/**
2014-01-19 19:30:21 +01:00
* Add a new Child Control
*
2014-01-19 19:30:21 +01:00
* @param Control $child The Child Control to add
* @return \FML\Types\Container
*/
2014-01-19 19:30:21 +01:00
public function add(Control $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
*
* @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);
}