1<?php
2
3/* Copyright (c) 2017 Richard Klees <richard.klees@concepts-and-training.de>, Alex Killing <killing@leifos.de> Extended GPL, see docs/LICENSE */
4
5namespace ILIAS\UI\Component\Item;
6
7/**
8 * Common interface to all items.
9 */
10interface Item extends \ILIAS\UI\Component\Component
11{
12    /**
13     * Gets the title of the item
14     *
15     * @return string|\ILIAS\UI\Component\Button\Shy
16     */
17    public function getTitle();
18
19    /**
20     * Create a new item with an attached description.
21     * @param string $description
22     * @return Item
23     */
24    public function withDescription($description);
25
26    /**
27     * Get the description of the item.
28     * @return string
29     */
30    public function getDescription();
31
32    /**
33     * Get a new item with the given properties as key-value pairs.
34     *
35     * The key is holding the title and the value is holding the content of the
36     * specific data set.
37     *
38     * @param array<string,string|\ILIAS\UI\Component\Button\Shy> $properties Label => Content
39     * @return self
40     */
41    public function withProperties(array $properties);
42
43    /**
44     * Get the properties of the appointment.
45     *
46     * @return array<string,string|\ILIAS\UI\Component\Button\Shy>		Title => Content
47     */
48    public function getProperties();
49
50    /**
51     * Create a new appointment item with a set of actions to perform on it.
52     *
53     * @param \ILIAS\UI\Component\Dropdown\Standard $actions
54     * @return Item
55     */
56    public function withActions(\ILIAS\UI\Component\Dropdown\Standard $actions);
57
58    /**
59     * Get the actions of the item.
60     *
61     * @return \ILIAS\UI\Component\Dropdown\Standard
62     */
63    public function getActions();
64
65    /**
66     * Set a color
67     *
68     * @param \ILIAS\Data\Color $a_color color
69     * @return Item
70     */
71    public function withColor(\ILIAS\Data\Color $a_color);
72
73    /**
74     * @return \ILIAS\Data\Color color
75     */
76    public function getColor();
77
78    /**
79     * Set image as lead
80     *
81     * @param \ILIAS\UI\Component\Image\Image $image lead image
82     * @return Item
83     */
84    public function withLeadImage(\ILIAS\UI\Component\Image\Image $image);
85
86    /**
87     * Set icon as lead
88     *
89     * @param \ILIAS\UI\Component\Icon\Icon $icon lead icon
90     * @return Icon
91     */
92    public function withLeadIcon(\ILIAS\UI\Component\Icon\Icon $icon);
93
94    /**
95     * Set image as lead
96     *
97     * @param string $text lead text
98     * @return Item
99     */
100    public function withLeadText($text);
101
102    /**
103     * Reset lead to null
104     * @return Item
105     */
106    public function withNoLead();
107
108    /**
109     * @return null|string|\ILIAS\UI\Component\Image\Image|\ILIAS\UI\Component\Icon\Icon
110     */
111    public function getLead();
112}
113