1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\DataDefinition\Palette;
14:
15: use DcGeneral\Data\ModelInterface;
16: use DcGeneral\Data\PropertyValueBag;
17:
18: /**
19: * A legend group a lot of properties.
20: */
21: interface LegendInterface
22: {
23: /**
24: * Return the palette this legend belongs to.
25: *
26: * @param PaletteInterface|null $palette The palette.
27: *
28: * @return LegendInterface
29: */
30: public function setPalette(PaletteInterface $palette = null);
31:
32: /**
33: * Return the palette this legend belongs to.
34: *
35: * @return PaletteInterface|null
36: */
37: public function getPalette();
38:
39: /**
40: * Set the name of this legend (e.g. "title", not "title_legend").
41: *
42: * @param string $name The name.
43: *
44: * @return LegendInterface
45: */
46: public function setName($name);
47:
48: /**
49: * Return the name of this legend (e.g. "title", not "title_legend").
50: *
51: * @return string
52: */
53: public function getName();
54:
55: /**
56: * Set if this legend's initial state is visible (expanded).
57: *
58: * @param bool $value The visibility state.
59: *
60: * @return bool
61: */
62: public function setInitialVisibility($value);
63:
64: /**
65: * Determine if this legend's initial state shall be expanded.
66: *
67: * @return LegendInterface
68: */
69: public function isInitialVisible();
70:
71: /**
72: * Clear all properties from this legend.
73: *
74: * @return LegendInterface
75: */
76: public function clearProperties();
77:
78: /**
79: * Set the properties of this legend.
80: *
81: * @param array|PropertyInterface[] $properties The properties.
82: *
83: * @return LegendInterface
84: */
85: public function setProperties(array $properties);
86:
87: /**
88: * Add all properties to this legend.
89: *
90: * @param array|PropertyInterface[] $properties The properties.
91: *
92: * @param PropertyInterface $before The property before the passed properties shall be inserted
93: * (optional).
94: *
95: * @return LegendInterface
96: */
97: public function addProperties(array $properties, PropertyInterface $before = null);
98:
99: /**
100: * Add a property to this legend.
101: *
102: * @param PropertyInterface $property The property.
103: *
104: * @param PropertyInterface $before The property before the passed property shall be inserted (optional).
105: *
106: * @return LegendInterface
107: */
108: public function addProperty(PropertyInterface $property, PropertyInterface $before = null);
109:
110: /**
111: * Remove a property from this legend.
112: *
113: * @param PropertyInterface $property The property.
114: *
115: * @return LegendInterface
116: */
117: public function removeProperty(PropertyInterface $property);
118:
119: /**
120: * Get all properties in this legend.
121: *
122: * @param ModelInterface|null $model If given, subpalettes will be evaluated depending on the model.
123: * If no model is given, all properties will be returned, including subpalette
124: * properties.
125: *
126: * @param PropertyValueBag $input If given, subpalettes will be evaluated depending on the input data.
127: * If no model and no input data is given, all properties will be returned,
128: * including subpalette properties.
129: *
130: * @return PropertyInterface[]
131: */
132: public function getProperties(ModelInterface $model = null, PropertyValueBag $input = null);
133:
134: /**
135: * Create a deep clone of the legend.
136: *
137: * @return void
138: */
139: public function __clone();
140: }
141: