1 | <?php |
||
12 | class StaticItem implements MenuItemInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $text; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $numberOfRows = 0; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | private $startRowNumber = 0; |
||
28 | |||
29 | public function __construct(string $text) |
||
33 | |||
34 | /** |
||
35 | * Returns the number of terminal rows the item takes |
||
36 | */ |
||
37 | public function getNumberOfRows() { |
||
40 | |||
41 | /** |
||
42 | * Sets the row number the item starts at in the frame |
||
43 | */ |
||
44 | public function setStartRowNumber(int $rowNumber) { |
||
47 | |||
48 | /** |
||
49 | * Returns the row number the item starts at in the frame |
||
50 | */ |
||
51 | public function getStartRowNumber() { |
||
54 | |||
55 | /** |
||
56 | * The output text for the item |
||
57 | */ |
||
58 | public function getRows(MenuStyle $style, bool $selected = false) : array |
||
66 | |||
67 | /** |
||
68 | * Can the item be selected |
||
69 | */ |
||
70 | public function canSelect() : bool |
||
74 | |||
75 | /** |
||
76 | * Execute the items callable if required |
||
77 | */ |
||
78 | public function getSelectAction() : ?callable |
||
82 | |||
83 | /** |
||
84 | * Return the raw string of text |
||
85 | */ |
||
86 | public function getText() : string |
||
90 | |||
91 | /** |
||
92 | * Whether or not the menu item is showing the menustyle extra value |
||
93 | */ |
||
94 | public function showsItemExtra() : bool |
||
98 | |||
99 | /** |
||
100 | * Enable showing item extra |
||
101 | */ |
||
102 | public function showItemExtra() : void |
||
106 | |||
107 | /** |
||
108 | * Disable showing item extra |
||
109 | */ |
||
110 | public function hideItemExtra() : void |
||
114 | } |
||
115 |