1 /*
2 * Tethys: GUI Utilities
3 * Copyright 2012-2026. Tony Washer
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17 package io.github.tonywasher.joceanus.tethys.api.button;
18
19 import io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar.OceanusEventProvider;
20 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIArrowIconId;
21 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent;
22 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIEvent;
23 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIIcon;
24 import io.github.tonywasher.joceanus.tethys.api.base.TethysUIIconId;
25
26 /**
27 * Tethys Button.
28 * <p>
29 * The EventProvider fires the following events.
30 * <ul>
31 * <li>TethysUIEvent.PRESSED is fired when a button is pressed
32 * </ul>
33 */
34 public interface TethysUIButton
35 extends OceanusEventProvider<TethysUIEvent>, TethysUIComponent {
36 /**
37 * Obtain icon size.
38 *
39 * @return the size
40 */
41 int getIconSize();
42
43 /**
44 * Set the icon size.
45 *
46 * @param pSize the size to set
47 */
48 void setIconSize(int pSize);
49
50 /**
51 * Set text for button.
52 *
53 * @param pText the text
54 */
55 void setText(String pText);
56
57 /**
58 * Set icon for button.
59 *
60 * @param pId the icon Id
61 */
62 void setIcon(TethysUIIconId pId);
63
64 /**
65 * Set icon for button.
66 *
67 * @param pIcon the icon
68 */
69 void setIcon(TethysUIArrowIconId pIcon);
70
71 /**
72 * Set icon for button.
73 *
74 * @param pIcon the icon
75 */
76 void setIcon(TethysUIIcon pIcon);
77
78 /**
79 * Set toolTip for button.
80 *
81 * @param pTip the toolTip
82 */
83 void setToolTip(String pTip);
84
85 /**
86 * Set Null Margins.
87 */
88 void setNullMargins();
89
90 /**
91 * Set Icon only.
92 */
93 void setIconOnly();
94
95 /**
96 * Set Text And Icon.
97 */
98 void setTextAndIcon();
99
100 /**
101 * Set Icon and Text.
102 */
103 void setIconAndText();
104
105 /**
106 * Set Text Only.
107 */
108 void setTextOnly();
109 }