de2f82a441d48f85ef295232cc3dbbeeaac697df
[yaffs-website] / web / core / lib / Drupal / Core / Layout / Icon / IconBuilderInterface.php
1 <?php
2
3 namespace Drupal\Core\Layout\Icon;
4
5 /**
6  * Provides an interface for building layout icons.
7  */
8 interface IconBuilderInterface {
9
10   /**
11    * Builds a render array representation of an SVG based on an icon map.
12    *
13    * @param string[][] $icon_map
14    *   A two-dimensional array representing the visual output of the layout.
15    *   For the following shape:
16    *   |------------------------------|
17    *   |                              |
18    *   |             100%             |
19    *   |                              |
20    *   |-------|--------------|-------|
21    *   |       |              |       |
22    *   |       |      50%     |  25%  |
23    *   |       |              |       |
24    *   |  25%  |--------------|-------|
25    *   |       |                      |
26    *   |       |         75%          |
27    *   |       |                      |
28    *   |------------------------------|
29    *   The corresponding array would be:
30    *   - ['top']
31    *   - ['first', 'second', 'second', 'third']
32    *   - ['first', 'bottom', 'bottom', 'bottom'].
33    *
34    * @return array
35    *   A render array representing a SVG icon.
36    */
37   public function build(array $icon_map);
38
39   /**
40    * Sets the ID.
41    *
42    * @param string $id
43    *   The machine name of the layout.
44    *
45    * @return $this
46    */
47   public function setId($id);
48
49   /**
50    * Sets the label.
51    *
52    * @param string $label
53    *   The label of the layout.
54    *
55    * @return $this
56    */
57   public function setLabel($label);
58
59   /**
60    * Sets the width.
61    *
62    * @param int $width
63    *   The width of the SVG.
64    *
65    * @return $this
66    */
67   public function setWidth($width);
68
69   /**
70    * Sets the height.
71    *
72    * @param int $height
73    *   The height of the SVG.
74    *
75    * @return $this
76    */
77   public function setHeight($height);
78
79   /**
80    * Sets the padding.
81    *
82    * @param int $padding
83    *   The padding between regions.
84    *
85    * @return $this
86    */
87   public function setPadding($padding);
88
89   /**
90    * Sets the stroke width.
91    *
92    * @param int|null $stroke_width
93    *   The width of region borders.
94    *
95    * @return $this
96    */
97   public function setStrokeWidth($stroke_width);
98
99 }