[TASK] EXT:form - license headers
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / Domain / Model / Renderable / RenderableInterface.php
1 <?php
2 declare(strict_types=1);
3 namespace TYPO3\CMS\Form\Domain\Model\Renderable;
4
5 /*
6 * This file is part of the TYPO3 CMS project.
7 *
8 * It originated from the Neos.Form package (www.neos.io)
9 *
10 * It is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License, either version 2
12 * of the License, or any later version.
13 *
14 * For the full copyright and license information, please read the
15 * LICENSE.txt file that was distributed with this source code.
16 *
17 * The TYPO3 project - inspiring people to share!
18 */
19
20 /**
21 * Base interface which all Form Parts except the FormDefinition must adhere
22 * to (i.e. all elements which are NOT the root of a Form).
23 *
24 * Scope: frontend
25 * **This class is NOT meant to be sub classed by developers.**
26 */
27 interface RenderableInterface extends RootRenderableInterface
28 {
29
30 /**
31 * Return the parent renderable
32 *
33 * @return null|CompositeRenderableInterface the parent renderable
34 * @internal
35 */
36 public function getParentRenderable();
37
38 /**
39 * Set the new parent renderable. You should not call this directly;
40 * it is automatically called by addRenderable.
41 *
42 * This method should also register itself at the parent form, if possible.
43 *
44 * @param CompositeRenderableInterface $renderable
45 * @return void
46 * @internal
47 */
48 public function setParentRenderable(CompositeRenderableInterface $renderable);
49
50 /**
51 * Set the index of this renderable inside the parent renderable
52 *
53 * @param int $index
54 * @return void
55 * @internal
56 */
57 public function setIndex(int $index);
58
59 /**
60 * Get the index inside the parent renderable
61 *
62 * @return int
63 * @api
64 */
65 public function getIndex(): int;
66
67 /**
68 * This function is called after a renderable has been removed from its parent
69 * renderable. The function should make sure to clean up the internal state,
70 * like reseting $this->parentRenderable or deregistering the renderable
71 * at the form.
72 *
73 * @return void
74 * @internal
75 */
76 public function onRemoveFromParentRenderable();
77
78 /**
79 * This is a callback that is invoked by the Form Factory after the whole form has been built.
80 * It can be used to add new form elements as children for complex form elements.
81 *
82 * @return void
83 * @api
84 */
85 public function onBuildingFinished();
86
87 /**
88 * Register this element at the parent form, if there is a connection to the parent form.
89 *
90 * @return void
91 * @internal
92 */
93 public function registerInFormIfPossible();
94 }