xbmc
Control.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "Alternative.h"
12 #include "ListItem.h"
13 #include "Tuple.h"
14 #include "guilib/GUIControl.h"
15 #include "guilib/GUIFont.h"
16 #include "input/Key.h"
17 #include "swighelper.h"
18 #include "utils/ColorUtils.h"
19 
20 #include <vector>
21 
22 
23 // hardcoded offsets for button controls (and controls that use button controls)
24 // ideally they should be dynamically read in as with all the other properties.
25 #define CONTROL_TEXT_OFFSET_X 10
26 #define CONTROL_TEXT_OFFSET_Y 2
27 
28 namespace XBMCAddon
29 {
30  namespace xbmcgui
31  {
32 
60  //
61  class Control : public AddonClass
62  {
63  protected:
64  Control() = default;
65 
66  public:
67  ~Control() override;
68 
69 #ifndef SWIG
70  virtual CGUIControl* Create();
71 #endif
72 
73  // currently we only accept messages from a button or controllist with a select action
74  virtual bool canAcceptMessages(int actionId) { return false; }
75 
76 #ifdef DOXYGEN_SHOULD_USE_THIS
77  getId()
94 #else
95  virtual int getId() { return iControlId; }
96 #endif
97 
98  inline bool operator==(const Control& other) const { return iControlId == other.iControlId; }
99  inline bool operator>(const Control& other) const { return iControlId > other.iControlId; }
100  inline bool operator<(const Control& other) const { return iControlId < other.iControlId; }
101 
102  // hack this because it returns a tuple
103 #ifdef DOXYGEN_SHOULD_USE_THIS
104  getPosition();
121 #else
122  virtual std::vector<int> getPosition();
123 #endif
124 
125 #ifdef DOXYGEN_SHOULD_USE_THIS
126  getX();
143 #else
144  int getX() { return dwPosX; }
145 #endif
146 
147 #ifdef DOXYGEN_SHOULD_USE_THIS
148  getY();
165 #else
166  int getY() { return dwPosY; }
167 #endif
168 
169 #ifdef DOXYGEN_SHOULD_USE_THIS
170  getHeight();
187 #else
188  virtual int getHeight() { return dwHeight; }
189 #endif
190 
191  // getWidth() Method
192 #ifdef DOXYGEN_SHOULD_USE_THIS
193  getWidth();
210 #else
211  virtual int getWidth() { return dwWidth; }
212 #endif
213 
214  // setEnabled() Method
215 #ifdef DOXYGEN_SHOULD_USE_THIS
216  setEnabled(...);
233 #else
234  virtual void setEnabled(bool enabled);
235 #endif
236 
237  // setVisible() Method
238 #ifdef DOXYGEN_SHOULD_USE_THIS
239  setVisible(...);
260 #else
261  virtual void setVisible(bool visible);
262 #endif
263 
264  // isVisible() Method
265 #ifdef DOXYGEN_SHOULD_USE_THIS
266  isVisible(...);
285 #else
286  virtual bool isVisible();
287 #endif
288 
289  // setVisibleCondition() Method
290 #ifdef DOXYGEN_SHOULD_USE_THIS
291  setVisibleCondition(...);
315 #else
316  virtual void setVisibleCondition(const char* visible, bool allowHiddenFocus = false);
317 #endif
318 
319  // setEnableCondition() Method
320 #ifdef DOXYGEN_SHOULD_USE_THIS
321  setEnableCondition(...);
343 #else
344  virtual void setEnableCondition(const char* enable);
345 #endif
346 
347  // setAnimations() Method
348 #ifdef DOXYGEN_SHOULD_USE_THIS
349  setAnimations(...);
374 #else
375  virtual void setAnimations(const std::vector< Tuple<String,String> >& eventAttr);
376 #endif
377 
378  // setPosition() Method
379 #ifdef DOXYGEN_SHOULD_USE_THIS
380  setPosition(...);
400 #else
401  virtual void setPosition(long x, long y);
402 #endif
403 
404  // setWidth() Method
405 #ifdef DOXYGEN_SHOULD_USE_THIS
406  setWidth(...);
423 #else
424  virtual void setWidth(long width);
425 #endif
426 
427  // setHeight() Method
428 #ifdef DOXYGEN_SHOULD_USE_THIS
429  setHeight(...);
446 #else
447  virtual void setHeight(long height);
448 #endif
449 
450  // setNavigation() Method
451 #ifdef DOXYGEN_SHOULD_USE_THIS
452  //
478  setNavigation(...);
479 #else
480  virtual void setNavigation(const Control* up, const Control* down,
481  const Control* left, const Control* right);
482 #endif
483 
484  // controlUp() Method
485 #ifdef DOXYGEN_SHOULD_USE_THIS
486  controlUp(...);
510 #else
511  virtual void controlUp(const Control* up);
512 #endif
513 
514  // controlDown() Method
515 #ifdef DOXYGEN_SHOULD_USE_THIS
516  controlDown(...);
540 #else
541  virtual void controlDown(const Control* control);
542 #endif
543 
544  // controlLeft() Method
545 #ifdef DOXYGEN_SHOULD_USE_THIS
546  controlLeft(...);
570 #else
571  virtual void controlLeft(const Control* control);
572 #endif
573 
574  // controlRight() Method
575 #ifdef DOXYGEN_SHOULD_USE_THIS
576  controlRight(...);
600 #else
601  virtual void controlRight(const Control* control);
602 #endif
603 
604 #ifndef SWIG
605  int iControlId = 0;
606  int iParentId = 0;
607  int dwPosX = 0;
608  int dwPosY = 0;
609  int dwWidth = 0;
610  int dwHeight = 0;
611  int iControlUp = 0;
612  int iControlDown = 0;
613  int iControlLeft = 0;
614  int iControlRight = 0;
615  std::string m_label{};
616  bool m_visible{true};
617  CGUIControl* pGUIControl = nullptr;
618 #endif
619 
620  };
622 
649  class ControlSpin : public Control
650  {
651  public:
652  ~ControlSpin() override;
653 
654 #ifdef DOXYGEN_SHOULD_USE_THIS
655  setTextures(...);
688 #else
689  virtual void setTextures(const char* up, const char* down,
690  const char* upFocus,
691  const char* downFocus,
692  const char* upDisabled, const char* downDisabled);
693 #endif
694 
695 #ifndef SWIG
696  UTILS::COLOR::Color color;
697  std::string strTextureUp;
698  std::string strTextureDown;
699  std::string strTextureUpFocus;
700  std::string strTextureDownFocus;
701  std::string strTextureUpDisabled;
702  std::string strTextureDownDisabled;
703 #endif
704 
705  private:
706  ControlSpin();
707 
708  friend class Window;
709  friend class ControlList;
710 
711  };
713 
766  class ControlLabel : public Control
767  {
768  public:
769  ControlLabel(long x, long y, long width, long height, const String& label,
770  const char* font = NULL, const char* textColor = NULL,
771  const char* disabledColor = NULL,
772  long alignment = XBFONT_LEFT,
773  bool hasPath = false, long angle = 0);
774 
775  ~ControlLabel() override;
776 
777 #ifdef DOXYGEN_SHOULD_USE_THIS
778  getLabel();
795 #else
796  virtual String getLabel();
797 #endif
798 
799 #ifdef DOXYGEN_SHOULD_USE_THIS
800  setLabel(...);
828 #else
829  virtual void setLabel(const String& label = emptyString,
830  const char* font = NULL,
831  const char* textColor = NULL,
832  const char* disabledColor = NULL,
833  const char* shadowColor = NULL,
834  const char* focusedColor = NULL,
835  const String& label2 = emptyString);
836 #endif
837 
838 #ifndef SWIG
839  ControlLabel() = default;
840 
841  std::string strFont;
842  std::string strText;
843  UTILS::COLOR::Color textColor;
844  UTILS::COLOR::Color disabledColor;
845  uint32_t align;
846  bool bHasPath = false;
847  int iAngle = 0;
848 
849  CGUIControl* Create() override;
850 
851 #endif
852  };
854 
855  // ControlEdit class
912  class ControlEdit : public Control
913  {
914  public:
915  ControlEdit(long x, long y, long width, long height, const String& label,
916  const char* font = NULL, const char* textColor = NULL,
917  const char* disabledColor = NULL,
918  long _alignment = XBFONT_LEFT, const char* focusTexture = NULL,
919  const char* noFocusTexture = NULL);
920 
921 
922  // setLabel() Method
923 #ifdef DOXYGEN_SHOULD_USE_THIS
924  setLabel(...);
952 #else
953  virtual void setLabel(const String& label = emptyString,
954  const char* font = NULL,
955  const char* textColor = NULL,
956  const char* disabledColor = NULL,
957  const char* shadowColor = NULL,
958  const char* focusedColor = NULL,
959  const String& label2 = emptyString);
960 #endif
961 
962  // getLabel() Method
963 #ifdef DOXYGEN_SHOULD_USE_THIS
964  getLabel();
981 #else
982  virtual String getLabel();
983 #endif
984 
985  // setText() Method
986 #ifdef DOXYGEN_SHOULD_USE_THIS
987  setText(...);
1004 #else
1005  virtual void setText(const String& text);
1006 #endif
1007 
1008  // getText() Method
1009 #ifdef DOXYGEN_SHOULD_USE_THIS
1010  getText();
1028 #else
1029  virtual String getText();
1030 #endif
1031 
1032 #ifndef SWIG
1033  ControlEdit() = default;
1034 
1035  std::string strFont;
1036  std::string strText;
1037  std::string strTextureFocus;
1038  std::string strTextureNoFocus;
1039  UTILS::COLOR::Color textColor;
1040  UTILS::COLOR::Color disabledColor;
1041  uint32_t align;
1042 
1043  CGUIControl* Create() override;
1044 #endif
1045 
1046  // setType() Method
1047 #ifdef DOXYGEN_SHOULD_USE_THIS
1048  setType(...);
1080 #else
1081  virtual void setType(int type, const String& heading);
1082 #endif
1083  };
1085 
1086  // ControlList class
1149  class ControlList : public Control
1150  {
1151  void internAddListItem(const AddonClass::Ref<ListItem>& listitem, bool sendMessage);
1152 
1153  public:
1154  ControlList(long x, long y, long width, long height, const char* font = NULL,
1155  const char* textColor = NULL, const char* buttonTexture = NULL,
1156  const char* buttonFocusTexture = NULL,
1157  const char* selectedColor = NULL,
1158  long _imageWidth=10, long _imageHeight=10, long _itemTextXOffset = CONTROL_TEXT_OFFSET_X,
1159  long _itemTextYOffset = CONTROL_TEXT_OFFSET_Y, long _itemHeight = 27, long _space = 2,
1160  long _alignmentY = XBFONT_CENTER_Y);
1161 
1162  ~ControlList() override;
1163 
1164 #ifdef DOXYGEN_SHOULD_USE_THIS
1165  addItem(...);
1182 #else
1183  virtual void addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage = true);
1184 #endif
1185 
1186 #ifdef DOXYGEN_SHOULD_USE_THIS
1187  addItems(...);
1208 #else
1209  virtual void addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items);
1210 #endif
1211 
1212 #ifdef DOXYGEN_SHOULD_USE_THIS
1213  selectItem(...);
1230 #else
1231  virtual void selectItem(long item);
1232 #endif
1233 
1234 #ifdef DOXYGEN_SHOULD_USE_THIS
1235  removeItem(...);
1253 #else
1254  virtual void removeItem(int index);
1255 #endif
1256 
1257 #ifdef DOXYGEN_SHOULD_USE_THIS
1258  reset();
1299 #else
1300  virtual void reset();
1301 #endif
1302 
1303 #ifdef DOXYGEN_SHOULD_USE_THIS
1304  getSpinControl();
1323 #else
1324  virtual Control* getSpinControl();
1325 #endif
1326 
1327 #ifdef DOXYGEN_SHOULD_USE_THIS
1328  getSelectedPosition();
1345 #else
1346  virtual long getSelectedPosition();
1347 #endif
1348 
1349 #ifdef DOXYGEN_SHOULD_USE_THIS
1350  getSelectedItem();
1372 #else
1373  virtual XBMCAddon::xbmcgui::ListItem* getSelectedItem();
1374 #endif
1375 
1376  // setImageDimensions() method
1377 #ifdef DOXYGEN_SHOULD_USE_THIS
1378  setImageDimensions(...);
1396 #else
1397  virtual void setImageDimensions(long imageWidth,long imageHeight);
1398 #endif
1399 
1400  // setItemHeight() method
1401 #ifdef DOXYGEN_SHOULD_USE_THIS
1402  setItemHeight(...);
1419 #else
1420  virtual void setItemHeight(long height);
1421 #endif
1422 
1423  // setSpace() method
1424 #ifdef DOXYGEN_SHOULD_USE_THIS
1425  setSpace(...);
1443 #else
1444  virtual void setSpace(int space);
1445 #endif
1446 
1447  // setPageControlVisible() method
1448 #ifdef DOXYGEN_SHOULD_USE_THIS
1449  setPageControlVisible(...);
1467 #else
1468  virtual void setPageControlVisible(bool visible);
1469 #endif
1470 
1471  // size() method
1472 #ifdef DOXYGEN_SHOULD_USE_THIS
1473  size();
1491 #else
1492  virtual long size();
1493 #endif
1494 
1495  // getItemHeight() Method
1496 #ifdef DOXYGEN_SHOULD_USE_THIS
1497  getItemHeight();
1515 #else
1516  virtual long getItemHeight();
1517 #endif
1518 
1519  // getSpace() Method
1520 #ifdef DOXYGEN_SHOULD_USE_THIS
1521  getSpace();
1539 #else
1540  virtual long getSpace();
1541 #endif
1542 
1543  // getListItem() method
1544 #ifdef DOXYGEN_SHOULD_USE_THIS
1545  getListItem(...);
1565 #else
1566  virtual XBMCAddon::xbmcgui::ListItem* getListItem(int index);
1567 #endif
1568 
1569 #ifdef DOXYGEN_SHOULD_USE_THIS
1570  setStaticContent(...);
1590 #else
1591  virtual void setStaticContent(const ListItemList* items);
1592 #endif
1593 
1594 #ifndef SWIG
1595  void sendLabelBind(int tail);
1596 
1597  bool canAcceptMessages(int actionId) override
1598  { return ((actionId == ACTION_SELECT_ITEM) | (actionId == ACTION_MOUSE_LEFT_CLICK)); }
1599 
1600  // This is called from AddonWindow.cpp but shouldn't be available
1601  // to the scripting languages.
1602  ControlList() = default;
1603 
1604  std::vector<AddonClass::Ref<ListItem> > vecItems;
1605  std::string strFont;
1606  AddonClass::Ref<ControlSpin> pControlSpin;
1607 
1608  UTILS::COLOR::Color textColor;
1609  UTILS::COLOR::Color selectedColor;
1610  std::string strTextureButton;
1611  std::string strTextureButtonFocus;
1612 
1613  int imageHeight = 0;
1614  int imageWidth = 0;
1615  int itemHeight = 0;
1616  int space = 0;
1617 
1618  int itemTextOffsetX = 0;
1619  int itemTextOffsetY = 0;
1620  uint32_t alignmentY;
1621 
1622  CGUIControl* Create() override;
1623 #endif
1624  };
1626 
1627  // ControlFadeLabel class
1681  class ControlFadeLabel : public Control
1682  {
1683  public:
1684  ControlFadeLabel(long x, long y, long width, long height,
1685  const char* font = NULL,
1686  const char* textColor = NULL,
1687  long _alignment = XBFONT_LEFT);
1688 
1689  // addLabel() Method
1690 #ifdef DOXYGEN_SHOULD_USE_THIS
1691  addLabel(...);
1710 #else
1711  virtual void addLabel(const String& label);
1712 #endif
1713 
1714 #ifdef DOXYGEN_SHOULD_USE_THIS
1715  setScrolling(...);
1734 #else
1735  virtual void setScrolling(bool scroll);
1736 #endif
1737 
1738 #ifdef DOXYGEN_SHOULD_USE_THIS
1739  reset();
1754 #else
1755  virtual void reset();
1756 #endif
1757 
1758 #ifndef SWIG
1759  std::string strFont;
1760  UTILS::COLOR::Color textColor;
1761  std::vector<std::string> vecLabels;
1762  uint32_t align;
1763 
1764  CGUIControl* Create() override;
1765 
1766  ControlFadeLabel() = default;
1767 #endif
1768  };
1770 
1771  // ControlTextBox class
1822  class ControlTextBox : public Control
1823  {
1824  public:
1825  ControlTextBox(long x, long y, long width, long height,
1826  const char* font = NULL,
1827  const char* textColor = NULL);
1828 
1829  // SetText() Method
1830 #ifdef DOXYGEN_SHOULD_USE_THIS
1831  setText(...);
1853 #else
1854  virtual void setText(const String& text);
1855 #endif
1856 
1857  // getText() Method
1858 #ifdef DOXYGEN_SHOULD_USE_THIS
1859  getText();
1879 #else
1880  virtual String getText();
1881 #endif
1882 
1883  // reset() Method
1884 #ifdef DOXYGEN_SHOULD_USE_THIS
1885  reset();
1902 #else
1903  virtual void reset();
1904 #endif
1905 
1906  // scroll() Method
1907 #ifdef DOXYGEN_SHOULD_USE_THIS
1908  scroll(...);
1929 #else
1930  virtual void scroll(long id);
1931 #endif
1932 
1933  // autoScroll() Method
1934 #ifdef DOXYGEN_SHOULD_USE_THIS
1935  autoScroll(...);
1958 #else
1959  virtual void autoScroll(int delay, int time, int repeat);
1960 #endif
1961 
1962 #ifndef SWIG
1963  std::string strFont;
1964  UTILS::COLOR::Color textColor;
1965 
1966  CGUIControl* Create() override;
1967 
1968  ControlTextBox() = default;
1969 #endif
1970  };
1972 
1973  // ControlImage class
2016  class ControlImage : public Control
2017  {
2018  public:
2019  ControlImage(long x, long y, long width, long height,
2020  const char* filename, long aspectRatio = 0,
2021  const char* colorDiffuse = NULL);
2022 
2023 #ifdef DOXYGEN_SHOULD_USE_THIS
2024  setImage(...);
2047 #else
2048  virtual void setImage(const char* imageFilename, const bool useCache = true);
2049 #endif
2050 
2051 #ifdef DOXYGEN_SHOULD_USE_THIS
2052  setColorDiffuse(...);
2072 #else
2073  virtual void setColorDiffuse(const char* hexString);
2074 #endif
2075 
2076 #ifndef SWIG
2077  ControlImage() = default;
2078 
2079  std::string strFileName;
2080  int aspectRatio = 0;
2081  UTILS::COLOR::Color colorDiffuse;
2082 
2083  CGUIControl* Create() override;
2084 #endif
2085  };
2087 
2088  // ControlImage class
2154  class ControlProgress : public Control
2155  {
2156  public:
2157  ControlProgress(long x, long y, long width, long height,
2158  const char* texturebg = NULL,
2159  const char* textureleft = NULL,
2160  const char* texturemid = NULL,
2161  const char* textureright = NULL,
2162  const char* textureoverlay = NULL);
2163 
2164 #ifdef DOXYGEN_SHOULD_USE_THIS
2165  setPercent(...);
2187 #else
2188  virtual void setPercent(float pct);
2189 #endif
2190 
2191 #ifdef DOXYGEN_SHOULD_USE_THIS
2192  getPercent();
2211 #else
2212  virtual float getPercent();
2213 #endif
2214 
2215 #ifndef SWIG
2216  std::string strTextureLeft;
2217  std::string strTextureMid;
2218  std::string strTextureRight;
2219  std::string strTextureBg;
2220  std::string strTextureOverlay;
2221  int aspectRatio = 0;
2222  UTILS::COLOR::Color colorDiffuse;
2223 
2224  CGUIControl* Create() override;
2225  ControlProgress() = default;
2226 #endif
2227  };
2229 
2230  // ControlButton class
2299  class ControlButton : public Control
2300  {
2301  public:
2302  ControlButton(long x, long y, long width, long height, const String& label,
2303  const char* focusTexture = NULL, const char* noFocusTexture = NULL,
2304  long textOffsetX = CONTROL_TEXT_OFFSET_X,
2305  long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2306  long alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
2307  const char* font = NULL, const char* textColor = NULL,
2308  const char* disabledColor = NULL, long angle = 0,
2309  const char* shadowColor = NULL, const char* focusedColor = NULL);
2310 
2311  // setLabel() Method
2312 #ifdef DOXYGEN_SHOULD_USE_THIS
2313  setLabel(...);
2342 #else
2343  virtual void setLabel(const String& label = emptyString,
2344  const char* font = NULL,
2345  const char* textColor = NULL,
2346  const char* disabledColor = NULL,
2347  const char* shadowColor = NULL,
2348  const char* focusedColor = NULL,
2349  const String& label2 = emptyString);
2350 #endif
2351 
2352  // setDisabledColor() Method
2353 #ifdef DOXYGEN_SHOULD_USE_THIS
2354  setDisabledColor(...);
2373 #else
2374  virtual void setDisabledColor(const char* color);
2375 #endif
2376 
2377  // getLabel() Method
2378 #ifdef DOXYGEN_SHOULD_USE_THIS
2379  getLabel();
2398 #else
2399  virtual String getLabel();
2400 #endif
2401 
2402  // getLabel2() Method
2403 #ifdef DOXYGEN_SHOULD_USE_THIS
2404  getLabel2();
2423 #else
2424  virtual String getLabel2();
2425 #endif
2426 
2427 #ifndef SWIG
2428  bool canAcceptMessages(int actionId) override { return true; }
2429 
2430  int textOffsetX = 0;
2431  int textOffsetY = 0;
2432  UTILS::COLOR::Color align;
2433  std::string strFont;
2434  UTILS::COLOR::Color textColor;
2435  UTILS::COLOR::Color disabledColor;
2436  int iAngle = 0;
2437  int shadowColor = 0;
2438  int focusedColor = 0;
2439  std::string strText;
2440  std::string strText2;
2441  std::string strTextureFocus;
2442  std::string strTextureNoFocus;
2443 
2444  CGUIControl* Create() override;
2445 
2446  ControlButton() = default;
2447 #endif
2448  };
2450 
2451  // ControlGroup class
2488  class ControlGroup : public Control
2489  {
2490  public:
2491  ControlGroup(long x, long y, long width, long height);
2492 
2493 #ifndef SWIG
2494  CGUIControl* Create() override;
2495 
2496  inline ControlGroup() = default;
2497 #endif
2498  };
2500 
2501  // ControlRadioButton class
2575  {
2576  public:
2577  ControlRadioButton(long x, long y, long width, long height, const String& label,
2578  const char* focusOnTexture = NULL, const char* noFocusOnTexture = NULL,
2579  const char* focusOffTexture = NULL, const char* noFocusOffTexture = NULL,
2580  const char* focusTexture = NULL, const char* noFocusTexture = NULL,
2581  long textOffsetX = CONTROL_TEXT_OFFSET_X,
2582  long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2583  long _alignment = (XBFONT_LEFT | XBFONT_CENTER_Y),
2584  const char* font = NULL, const char* textColor = NULL,
2585  const char* disabledColor = NULL, long angle = 0,
2586  const char* shadowColor = NULL, const char* focusedColor = NULL,
2587  const char* disabledOnTexture = NULL, const char* disabledOffTexture = NULL);
2588 
2589  // setSelected() Method
2590 #ifdef DOXYGEN_SHOULD_USE_THIS
2591  setSelected(...);
2614 #else
2615  virtual void setSelected(bool selected);
2616 #endif
2617 
2618  // isSelected() Method
2619 #ifdef DOXYGEN_SHOULD_USE_THIS
2620  isSelected();
2638 #else
2639  virtual bool isSelected();
2640 #endif
2641 
2642  // setLabel() Method
2643 #ifdef DOXYGEN_SHOULD_USE_THIS
2644  setLabel(...);
2680 #else
2681  virtual void setLabel(const String& label = emptyString,
2682  const char* font = NULL,
2683  const char* textColor = NULL,
2684  const char* disabledColor = NULL,
2685  const char* shadowColor = NULL,
2686  const char* focusedColor = NULL,
2687  const String& label2 = emptyString);
2688 #endif
2689 
2690  // setRadioDimension() Method
2691 #ifdef DOXYGEN_SHOULD_USE_THIS
2692  setRadioDimension(...);
2718 #else
2719  virtual void setRadioDimension(long x, long y, long width, long height);
2720 #endif
2721 
2722 #ifndef SWIG
2723  bool canAcceptMessages(int actionId) override { return true; }
2724 
2725  std::string strFont;
2726  std::string strText;
2727  std::string strTextureFocus;
2728  std::string strTextureNoFocus;
2729  std::string strTextureRadioOnFocus;
2730  std::string strTextureRadioOnNoFocus;
2731  std::string strTextureRadioOffFocus;
2732  std::string strTextureRadioOffNoFocus;
2733  std::string strTextureRadioOnDisabled;
2734  std::string strTextureRadioOffDisabled;
2735  UTILS::COLOR::Color textColor;
2736  UTILS::COLOR::Color disabledColor;
2737  int textOffsetX = 0;
2738  int textOffsetY = 0;
2739  uint32_t align;
2740  int iAngle = 0;
2741  UTILS::COLOR::Color shadowColor;
2742  UTILS::COLOR::Color focusedColor;
2743 
2744  CGUIControl* Create() override;
2745 
2746  ControlRadioButton() = default;
2747 #endif
2748  };
2750 
2791  class ControlSlider : public Control
2792  {
2793  public:
2794  ControlSlider(long x, long y, long width, long height,
2795  const char* textureback = NULL,
2796  const char* texture = NULL,
2797  const char* texturefocus = NULL, int orientation = 1);
2798 
2799 #ifdef DOXYGEN_SHOULD_USE_THIS
2800  getPercent();
2818 #else
2819  virtual float getPercent();
2820 #endif
2821 
2822 #ifdef DOXYGEN_SHOULD_USE_THIS
2823  setPercent(...);
2841 #else
2842  virtual void setPercent(float pct);
2843 #endif
2844 
2845 #ifdef DOXYGEN_SHOULD_USE_THIS
2846  getInt();
2865 #else
2866  virtual int getInt();
2867 #endif
2868 
2869 #ifdef DOXYGEN_SHOULD_USE_THIS
2870  setInt(...);
2892 #else
2893  virtual void setInt(int value, int min, int delta, int max);
2894 #endif
2895 
2896 #ifdef DOXYGEN_SHOULD_USE_THIS
2897  getFloat();
2916 #else
2917  virtual float getFloat();
2918 #endif
2919 
2920 #ifdef DOXYGEN_SHOULD_USE_THIS
2921  setFloat(...);
2943 #else
2944  virtual void setFloat(float value, float min, float delta, float max);
2945 #endif
2946 
2947 #ifndef SWIG
2948  std::string strTextureBack;
2949  std::string strTexture;
2950  std::string strTextureFoc;
2951  int iOrientation;
2952 
2953  CGUIControl* Create() override;
2954 
2955  inline ControlSlider() = default;
2956 #endif
2957  };
2959  }
2960 }
Definition: Control.h:649
constexpr int XBFONT_LEFT
Align X left.
Definition: GUIFont.h:38
constexpr int XBFONT_CENTER_Y
Align Y center.
Definition: GUIFont.h:41
Definition: Control.h:2016
Definition: Control.h:2299
This class is a smart pointer for a Referenced class.
Definition: AddonClass.h:154
Definition: Control.h:61
Definition: Control.h:1681
Base class for controls.
Definition: GUIControl.h:75
Definition: Control.h:1822
Definition: Control.h:2154
Definition: Control.h:2488
Definition: Control.h:2791
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: ListItem.h:52
Definition: Control.h:2574
Definition: Control.h:766
Definition: Window.h:186
Definition: Alternative.h:17
Definition: Control.h:912
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57
Definition: Tuple.h:32
Definition: Control.h:1149